Class WindowOptions

java.lang.Object
com.iizix.gyro.WindowOptions

public class WindowOptions extends Object
Class used to hold the Window options when opening a pop-up window on the client side from a browser session. This class is not used when the client is running inside iiziRun.
Author:
Christopher Mindus
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final boolean
    Flag indicating "spawn mode" is used and the Window will not be tracked.
    static final WindowOptions
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor, spawn mode = false, default width = 600 and height = 450, status bar, no menu bar, scroll bars.
    WindowOptions(boolean spawn)
    Constructor to set the spawn mode.
    WindowOptions(int width, int height)
    Constructor with options: spawn mode = false, status bar, no menu bar and scroll bars.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    iOS only: set to yes or no to allow in-line HTML5 media playback, displaying within the browser window rather than a device-specific playback interface.
    void
    channelMode(boolean on)
    Whether or not to display the window in theater mode.
    boolean
    Checks for equality.
    void
    footer(boolean on)
    Android only: set to true to show a close button in the footer similar to the iOS Done button.
    void
    fullscreen(boolean on)
    Whether or not to display the browser in full-screen mode.
    Gets the options that are used in the window.open function call.
    int
    Hash code.
    void
    height(int height)
    Sets the height.
    void
    location(boolean on)
    Whether or not to display the address field.
    void
    iOS only: set to yes to prevent HTML5 audio or video from autoplaying (defaults to no).
    void
    menubar(boolean on)
    Whether or not to display the menu bar.
    void
    resizable(boolean on)
    Whether or not the window is resizable.
    void
    setScrollbars(boolean on)
    Whether or not to display scroll bars.
    void
    setStatus(boolean on)
    Whether or not to add a status bar.
    void
    titlebar(boolean on)
    Whether or not to display the title bar.
    void
    toolbar(boolean on)
    Whether or not to display the browser toolbar.
    Outputs a debug string.
    void
    width(int width)
    Sets the width.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • SPAWN_BLANK

      public static final WindowOptions SPAWN_BLANK
    • spawn

      public final boolean spawn
      Flag indicating "spawn mode" is used and the Window will not be tracked.
  • Constructor Details

    • WindowOptions

      public WindowOptions()
      Constructor, spawn mode = false, default width = 600 and height = 450, status bar, no menu bar, scroll bars.
    • WindowOptions

      public WindowOptions(boolean spawn)
      Constructor to set the spawn mode. If spawn mode is false, these settings are preset: default width = 600 and height = 450, status bar, no menu bar, scroll bars.

      "Spawn mode" means that JavaScript "window.open(...)" is not used, but rather a creation of a hyperlink element that is clicked. This prevents blocking and does not enable setting width, height, nor checking when the window is closed.

      Parameters:
      spawn - The spawn mode flag.
    • WindowOptions

      public WindowOptions(int width, int height)
      Constructor with options: spawn mode = false, status bar, no menu bar and scroll bars.
      Parameters:
      width - The width, minimum 100 pixels (is set automatically).
      height - The height, minimum 100 pixels (is set automatically).
  • Method Details

    • width

      public void width(int width)
      Sets the width. A minimum value of 100 is set if smaller.
      Parameters:
      width - The width in pixels.
      Throws:
      IllegalStateException - If spawn mode is used.
    • height

      public void height(int height)
      Sets the height. A minimum value of 100 is set if smaller.
      Parameters:
      height - The height in pixels.
      Throws:
      IllegalStateException - If spawn mode is used.
    • channelMode

      public void channelMode(boolean on)
      Whether or not to display the window in theater mode. Default is no. IE only.
      Parameters:
      on - true to turn on, false to turn off.
      Throws:
      IllegalStateException - If spawn mode is used.
    • fullscreen

      public void fullscreen(boolean on)
      Whether or not to display the browser in full-screen mode. Default is no. A window in full-screen mode must also be in theater mode. IE only.
      Parameters:
      on - true to turn on, false to turn off.
      Throws:
      IllegalStateException - If spawn mode is used.
    • location

      public void location(boolean on)
      Whether or not to display the address field. Opera only.
      Parameters:
      on - true to turn on, false to turn off.
      Throws:
      IllegalStateException - If spawn mode is used.
    • resizable

      public void resizable(boolean on)
      Whether or not the window is resizable. IE only.
      Parameters:
      on - true to turn on, false to turn off.
      Throws:
      IllegalStateException - If spawn mode is used.
    • setScrollbars

      public void setScrollbars(boolean on)
      Whether or not to display scroll bars. IE, Firefox & Opera only.
      Parameters:
      on - true to turn on, false to turn off.
      Throws:
      IllegalStateException - If spawn mode is used.
    • setStatus

      public void setStatus(boolean on)
      Whether or not to add a status bar.
      Parameters:
      on - true to turn on, false to turn off.
      Throws:
      IllegalStateException - If spawn mode is used.
    • titlebar

      public void titlebar(boolean on)
      Whether or not to display the title bar. Ignored unless the calling application is an HTML Application or a trusted dialog box.
      Parameters:
      on - true to turn on, false to turn off.
      Throws:
      IllegalStateException - If spawn mode is used.
    • toolbar

      public void toolbar(boolean on)
      Whether or not to display the browser toolbar. IE and Firefox only.
      Parameters:
      on - true to turn on, false to turn off.
      Throws:
      IllegalStateException - If spawn mode is used.
    • footer

      public void footer(boolean on)
      Android only: set to true to show a close button in the footer similar to the iOS Done button. The close button will appear the same as for the header hence use closebuttoncaption and closebuttoncolor to set its properties.Whether or not to display the browser toolbar. IE and Firefox only.
      Parameters:
      on - true to turn on, false to turn off.
      Throws:
      IllegalStateException - If spawn mode is used.
    • allowInlineMediaPlayback

      public void allowInlineMediaPlayback(boolean on)
      iOS only: set to yes or no to allow in-line HTML5 media playback, displaying within the browser window rather than a device-specific playback interface. The HTML's video element must also include the webkit-playsinline attribute (defaults to no).
      Parameters:
      on - true to turn on, false to turn off.
      Throws:
      IllegalStateException - If spawn mode is used.
    • mediaPlaybackRequiresUserAction

      public void mediaPlaybackRequiresUserAction(boolean on)
      iOS only: set to yes to prevent HTML5 audio or video from autoplaying (defaults to no).
      Parameters:
      on - true to turn on, false to turn off.
      Throws:
      IllegalStateException - If spawn mode is used.
    • getOptions

      public String getOptions()
      Gets the options that are used in the window.open function call.
      Returns:
      A string as "width=600,height=450,...".
    • equals

      public boolean equals(Object o)
      Checks for equality.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Hash code.
      Overrides:
      hashCode in class Object
      Returns:
      Returns the hash code.
    • toString

      public String toString()
      Outputs a debug string.
      Overrides:
      toString in class Object