Class WindowOptions

java.lang.Object
com.openfin.desktop.JsonBean
com.openfin.desktop.WindowOptions
Direct Known Subclasses:
PlatformWindowOptions

public class WindowOptions
extends JsonBean
A class representing the options for a Window.
  • Field Summary

    Fields inherited from class com.openfin.desktop.JsonBean

    json
  • Constructor Summary

    Constructors 
    Constructor Description
    WindowOptions()
    Default constructor
    WindowOptions​(java.lang.String name, java.lang.String url)
    Contructor with name and url
    WindowOptions​(org.json.JSONObject options)
    Constructs an instance with a new underlying JSONObject
  • Method Summary

    Modifier and Type Method Description
    AcceleratorOptions getAccelerator()
    Get keyboard shortcut options.
    boolean getAutoShow()
    The AutoShow property represents a flag to automatically show the Window when it is created.
    boolean getContextMenu()
    The ContextMenu property represents a flag to show the context menu when right-clicking on a window.
    int getCornerRoundingHeight()
    The CornerRoundingHeight property represents the rounded corners to apply.
    int getCornerRoundingWidth()
    The CornerRoundingHeight property represents the rounded corners to apply.
    boolean getDefaultCentered()
    The DefaultCentered property specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine.
    int getDefaultHeight()
    The DefaultWidth property represents the window's default height in pixels.
    int getDefaultLeft()
    The DefaultLeft property represents the window's default left position.
    int getDefaultTop()
    The DefaultTop property represents the window's default top position.
    int getDefaultWidth()
    The DefaultWidth property represents the window's default width in pixels.
    boolean getFrame()
    The Frame property represents a flag to show the frame.
    boolean getHideOnClose()
    The HideOnClose property represents a flag to allow a window to be hidden when the close button is clicked.
    org.json.JSONObject getJson()
    Gets the underlying JSONObject
    LayoutOptions getLayoutOptions()  
    int getMaxHeight()
    The MaxHeight property represents the maximum height of a window.
    boolean getMaximizable()
    The Maximizable property represents a flag that lets the window be maximized.
    int getMaxWidth()
    The MaxWidth property represents the maximum width of a window.
    int getMinHeight()
    The MinHeight property represents the minimum height of a window.
    boolean getMinimizable()  
    int getMinWidth()
    The MinWidth property represents the minimum width of a window.
    java.lang.String getName()
    Get name of the window
    double getOpacity()
    The Opacity property represents a flag that specifies how transparent the window will be.
    java.lang.String getPreload()
    Get the URL of the preload script that will be retrieved (and cached, if needed) and eval'ed before any other script.
    boolean getResizable()
    The Resizable property represents a flag which allows the user to resize the window.
    int getResizeRegionBottomRightCorner()
    The ResizeRegionBottomRightCorner property defines an additional square region located at the bottom right corner of a frameless window.
    int getResizeRegionSize()
    The ResizeRegionSize property defines a region in pixels that will respond to user mouse interaction for resizing a frameless window
    boolean getSaveWindowState()
    The SaveWindowState property defines whether or not a window should maintain a persistent cache of its position/size.
    boolean getShowTaskbarIcon()
    The ShowTaskbarIcon property represents a flag to show the Window's icon in the taskbar.
    java.lang.String getState()
    The State property represents a string that sets the window to be "minimized", "maximized", or "normal" on creation.
    java.lang.String getTaskbarIcon()
    The TaskbarIcon property represents the URL of an icon to be shown on the desktop.
    java.lang.String getUrl()
    Get URL of the window
    boolean isDisableIabSecureLogging()
    The disableIabSecureLogging property represents a flag to disable secure logging in IAB Default: false
    void setAccelerator​(AcceleratorOptions acceleratorOptions)
    Set keyboard shortcut options.
    void setAutoShow​(boolean autoShow)
    The AutoShow property represents a flag to automatically show the Window when it is created.
    void setContextMenu​(boolean contextMenu)
    The ContextMenu property represents a flag to show the context menu when right-clicking on a window.
    void setCornerRounding​(int width, int height)
    The CornerRoundingHeight property represents the rounded corners to apply.
    void setDefaultCentered​(boolean defaultCentered)
    The DefaultCentered property specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine.
    void setDefaultHeight​(int defaultHeight)
    The DefaultWidth property represents the window's default height in pixels.
    void setDefaultLeft​(int defaultLeft)
    The DefaultLeft property represents the window's default left position.
    void setDefaultTop​(int defaultTop)
    The DefaultTop property represents the window's default top position.
    void setDefaultWidth​(int defaultWidth)  
    void setDisableIabSecureLogging​(boolean disable)
    The disableIabSecureLogging property represents a flag to disable secure logging in IAB Default: false
    void setFrame​(boolean frame)
    The Frame property represents a flag to show the frame.
    void setHideOnClose​(boolean hideOnClose)
    The HideOnClose property represents a flag to allow a window to be hidden when the close button is clicked.
    void setLayoutOptions​(LayoutOptions layoutOptions)  
    void setMaxHeight​(int maxHeight)
    The MaxHeight property represents the maximum height of a window.
    void setMaximizable​(boolean maximizable)
    The Maximizable property represents a flag that lets the window be maximized.
    void setMaxWidth​(int maxWidth)
    The MaxWidth property represents the maximum width of a window.
    void setMinHeight​(int minHeight)
    The MinHeight property represents the minimum height of a window.
    void setMinimizable​(boolean maximizable)
    The Minimizable property represents a flag that lets the window be minimized.
    void setMinWidth​(int minWidth)
    The MinWidth property represents the minimum width of a window.
    void setName​(java.lang.String name)
    Set name of the window
    void setOpacity​(double opacity)
    The Opacity property represents a flag that specifies how transparent the window will be.
    void setPreload​(java.lang.String url)
    Set A URL of the preload script that will be retrieved (and cached, if needed) and eval'ed before any other script.
    void setResizable​(boolean resizable)
    The Resizable property represents a flag which allows the user to resize the window.
    void setResizeRegionBottomRightCorner​(int resizeRegionBottomRightCorner)
    The ResizeRegionBottomRightCorner property defines an additional square region located at the bottom right corner of a frameless window.
    void setResizeRegionSize​(int resizeRegionSize)
    The ResizeRegionSize property defines a region in pixels that will respond to user mouse interaction for resizing a frameless window Default value: 2
    void setSaveWindowState​(boolean saveWindowState)
    The SaveWindowState property defines whether or not a window should maintain a persistent cache of its position/size.
    void setShowTaskbarIcon​(boolean showTaskbarIcon)
    The ShowTaskbarIcon property represents a flag to show the Window's icon in the taskbar.
    void setState​(java.lang.String state)
    The State property represents a string that sets the window to be "minimized", "maximized", or "normal" on creation.
    void setTaskbarIcon​(java.lang.String taskbarIcon)
    The TaskbarIcon property represents the URL of an icon to be shown on the desktop for a child window.
    void setUrl​(java.lang.String url)
    Set name of the window

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • WindowOptions

      public WindowOptions()
      Default constructor
    • WindowOptions

      public WindowOptions​(java.lang.String name, java.lang.String url)
      Contructor with name and url
      Parameters:
      name - name of the Window
      url - URL of the window
    • WindowOptions

      public WindowOptions​(org.json.JSONObject options)
      Constructs an instance with a new underlying JSONObject
      Parameters:
      options - underlying options
  • Method Details

    • setShowTaskbarIcon

      public void setShowTaskbarIcon​(boolean showTaskbarIcon)
      The ShowTaskbarIcon property represents a flag to show the Window's icon in the taskbar. Default: false
      Parameters:
      showTaskbarIcon - show taskbar icon if true
    • getName

      public java.lang.String getName()
      Get name of the window
      Returns:
      name
    • setName

      public void setName​(java.lang.String name)
      Set name of the window
      Parameters:
      name - name of the Window
    • getUrl

      public java.lang.String getUrl()
      Get URL of the window
      Returns:
      url of the Window
    • setUrl

      public void setUrl​(java.lang.String url)
      Set name of the window
      Parameters:
      url - name of the window
    • getShowTaskbarIcon

      public boolean getShowTaskbarIcon()
      The ShowTaskbarIcon property represents a flag to show the Window's icon in the taskbar. Default: false
      Returns:
      value of showTaskbarIcon
    • setDefaultWidth

      public void setDefaultWidth​(int defaultWidth)
    • getDefaultWidth

      public int getDefaultWidth()
      The DefaultWidth property represents the window's default width in pixels. Default: 800
      Returns:
      value of defaultWidth
    • setDefaultHeight

      public void setDefaultHeight​(int defaultHeight)
      The DefaultWidth property represents the window's default height in pixels. Default: 500
      Parameters:
      defaultHeight - value of defaultHeight
    • getDefaultHeight

      public int getDefaultHeight()
      The DefaultWidth property represents the window's default height in pixels. Default: 500
      Returns:
      value of defaultHeight
    • setDefaultTop

      public void setDefaultTop​(int defaultTop)
      The DefaultTop property represents the window's default top position. Default: 100
      Parameters:
      defaultTop - value of defaultTop
    • getDefaultTop

      public int getDefaultTop()
      The DefaultTop property represents the window's default top position. Default: 100
      Returns:
      value of defaultTop
    • setDefaultLeft

      public void setDefaultLeft​(int defaultLeft)
      The DefaultLeft property represents the window's default left position. Default: 100
      Parameters:
      defaultLeft - value of defaultLeft
    • getDefaultLeft

      public int getDefaultLeft()
      The DefaultLeft property represents the window's default left position. Default: 100
      Returns:
      value of defaultLeft
    • setFrame

      public void setFrame​(boolean frame)
      The Frame property represents a flag to show the frame. Default: true
      Parameters:
      frame - value of frame
    • getFrame

      public boolean getFrame()
      The Frame property represents a flag to show the frame. Default: true
      Returns:
      value of frame
    • setResizable

      public void setResizable​(boolean resizable)
      The Resizable property represents a flag which allows the user to resize the window. This property will be deprecated in a future release. Default: true
      Parameters:
      resizable - value of resizable
    • getResizable

      public boolean getResizable()
      The Resizable property represents a flag which allows the user to resize the window. This property will be deprecated in a future release. Default: true
      Returns:
      value of resizable
    • setAutoShow

      public void setAutoShow​(boolean autoShow)
      The AutoShow property represents a flag to automatically show the Window when it is created. Default: false
      Parameters:
      autoShow - value of autoShow
    • getAutoShow

      public boolean getAutoShow()
      The AutoShow property represents a flag to automatically show the Window when it is created. Default: false
      Returns:
      value of autoShow
    • setState

      public void setState​(java.lang.String state)
      The State property represents a string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal"
      Parameters:
      state - value of state
    • getState

      public java.lang.String getState()
      The State property represents a string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal"
      Returns:
      value of state
    • setOpacity

      public void setOpacity​(double opacity)
      The Opacity property represents a flag that specifies how transparent the window will be. Default: 1.0
      Parameters:
      opacity - value of opacity
    • getOpacity

      public double getOpacity()
      The Opacity property represents a flag that specifies how transparent the window will be. Default: 1.0
      Returns:
      value of opacity
    • setCornerRounding

      public void setCornerRounding​(int width, int height)
      The CornerRoundingHeight property represents the rounded corners to apply.
      Parameters:
      width - width of rounded corners
      height - height of rounded corners
    • getCornerRoundingHeight

      public int getCornerRoundingHeight()
      The CornerRoundingHeight property represents the rounded corners to apply.
      Returns:
      height of rounded corners
    • getCornerRoundingWidth

      public int getCornerRoundingWidth()
      The CornerRoundingHeight property represents the rounded corners to apply.
      Returns:
      width of of rounded corners
    • setMinWidth

      public void setMinWidth​(int minWidth)
      The MinWidth property represents the minimum width of a window. Default: 0
      Parameters:
      minWidth - value of minWidth
    • getMinWidth

      public int getMinWidth()
      The MinWidth property represents the minimum width of a window. Default: 0
      Returns:
      value of minWidth
    • setMaxWidth

      public void setMaxWidth​(int maxWidth)
      The MaxWidth property represents the maximum width of a window. The value will default to the OS defined value if set to -1. Default: -1
      Parameters:
      maxWidth - value of maxWidth
    • getMaxWidth

      public int getMaxWidth()
      The MaxWidth property represents the maximum width of a window. The value will default to the OS defined value if set to -1. Default: -1
      Returns:
      value of maxWidth
    • setMinHeight

      public void setMinHeight​(int minHeight)
      The MinHeight property represents the minimum height of a window. Default: 0
      Parameters:
      minHeight - value of minHeight
    • getMinHeight

      public int getMinHeight()
      The MinHeight property represents the minimum height of a window. Default: 0
      Returns:
      value of minHeight
    • setMaxHeight

      public void setMaxHeight​(int maxHeight)
      The MaxHeight property represents the maximum height of a window. Will default to the OS defined value if set to -1. Default: -1
      Parameters:
      maxHeight - value of maxHeight
    • getMaxHeight

      public int getMaxHeight()
      The MaxHeight property represents the maximum height of a window. Will default to the OS defined value if set to -1. Default: -1
      Returns:
      value of maxHeight
    • setSaveWindowState

      public void setSaveWindowState​(boolean saveWindowState)
      The SaveWindowState property defines whether or not a window should maintain a persistent cache of its position/size. Default: true
      Parameters:
      saveWindowState - value of saveWindowState
    • getSaveWindowState

      public boolean getSaveWindowState()
      The SaveWindowState property defines whether or not a window should maintain a persistent cache of its position/size. Default: true
      Returns:
      value of saveWindowState
    • setMinimizable

      public void setMinimizable​(boolean maximizable)
      The Minimizable property represents a flag that lets the window be minimized. Default: true
      Parameters:
      maximizable - value of maximizable
    • getMinimizable

      public boolean getMinimizable()
    • setMaximizable

      public void setMaximizable​(boolean maximizable)
      The Maximizable property represents a flag that lets the window be maximized. Default: true
      Parameters:
      maximizable - value of maximizable
    • getMaximizable

      public boolean getMaximizable()
      The Maximizable property represents a flag that lets the window be maximized. Default: true
      Returns:
      value of maximizable
    • setHideOnClose

      public void setHideOnClose​(boolean hideOnClose)
      The HideOnClose property represents a flag to allow a window to be hidden when the close button is clicked.
      Parameters:
      hideOnClose - value of hideOnClose
    • getHideOnClose

      public boolean getHideOnClose()
      The HideOnClose property represents a flag to allow a window to be hidden when the close button is clicked.
      Returns:
      value of hideOnClose
    • setContextMenu

      public void setContextMenu​(boolean contextMenu)
      The ContextMenu property represents a flag to show the context menu when right-clicking on a window. Default: false
      Parameters:
      contextMenu - value of contextMenu
    • getContextMenu

      public boolean getContextMenu()
      The ContextMenu property represents a flag to show the context menu when right-clicking on a window. Default: false
      Returns:
      value of contextMenu
    • setTaskbarIcon

      public void setTaskbarIcon​(java.lang.String taskbarIcon)
      The TaskbarIcon property represents the URL of an icon to be shown on the desktop for a child window. To set URL of taskbar icon for main window of an app, ApplicationOptions.setApplicationIcon should be called.
      Parameters:
      taskbarIcon - value of taskbarIcon
    • getTaskbarIcon

      public java.lang.String getTaskbarIcon()
      The TaskbarIcon property represents the URL of an icon to be shown on the desktop.
      Returns:
      value of taskbarIcon
    • setResizeRegionBottomRightCorner

      public void setResizeRegionBottomRightCorner​(int resizeRegionBottomRightCorner)
      The ResizeRegionBottomRightCorner property defines an additional square region located at the bottom right corner of a frameless window. Default value: 4
      Parameters:
      resizeRegionBottomRightCorner - an additional square region
    • getResizeRegionBottomRightCorner

      public int getResizeRegionBottomRightCorner()
      The ResizeRegionBottomRightCorner property defines an additional square region located at the bottom right corner of a frameless window.
      Returns:
      value of resizeRegionBottomRightCorner, or -1 if it is not set
    • setResizeRegionSize

      public void setResizeRegionSize​(int resizeRegionSize)
      The ResizeRegionSize property defines a region in pixels that will respond to user mouse interaction for resizing a frameless window Default value: 2
      Parameters:
      resizeRegionSize - new value of resizeRegionSize
    • getResizeRegionSize

      public int getResizeRegionSize()
      The ResizeRegionSize property defines a region in pixels that will respond to user mouse interaction for resizing a frameless window
      Returns:
      value of resizeRegionSize, or -1 if it is not set
    • setDefaultCentered

      public void setDefaultCentered​(boolean defaultCentered)
      The DefaultCentered property specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. Default: false
      Parameters:
      defaultCentered - new value of defaultCentered
    • getDefaultCentered

      public boolean getDefaultCentered()
      The DefaultCentered property specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. Default: false
      Returns:
      value of defaultCentered
    • getPreload

      public java.lang.String getPreload()
      Get the URL of the preload script that will be retrieved (and cached, if needed) and eval'ed before any other script. Default: inherited from the parent application.
      Returns:
      url of the preload script
    • setPreload

      public void setPreload​(java.lang.String url)
      Set A URL of the preload script that will be retrieved (and cached, if needed) and eval'ed before any other script. Default: inherited from the parent application.
      Parameters:
      url - of the preload script
    • isDisableIabSecureLogging

      public boolean isDisableIabSecureLogging()
      The disableIabSecureLogging property represents a flag to disable secure logging in IAB Default: false
      Returns:
      value of disableIabSecureLogging
    • setDisableIabSecureLogging

      public void setDisableIabSecureLogging​(boolean disable)
      The disableIabSecureLogging property represents a flag to disable secure logging in IAB Default: false
      Parameters:
      disable - new value of disableIabSecureLogging
    • setAccelerator

      public void setAccelerator​(AcceleratorOptions acceleratorOptions)
      Set keyboard shortcut options.
      Parameters:
      acceleratorOptions - Keyboard shortcuts options for devtools, zoom, reload, and reload ignoring cache.
    • getAccelerator

      public AcceleratorOptions getAccelerator()
      Get keyboard shortcut options.
      Returns:
      Keyboard shortcuts options
    • getLayoutOptions

      public LayoutOptions getLayoutOptions()
    • setLayoutOptions

      public void setLayoutOptions​(LayoutOptions layoutOptions)
    • getJson

      public org.json.JSONObject getJson()
      Description copied from class: JsonBean
      Gets the underlying JSONObject
      Overrides:
      getJson in class JsonBean
      Returns:
      JSONObject