@Override
 public JsStatement statement() {
   JsStatement statement;
   if (options.getJavaScriptOptions().length() > 2) {
     statement =
         new JsQuery(this.getComponent())
             .$()
             .chain("multiboxesselection", options.getJavaScriptOptions());
   } else {
     statement = new JsQuery(this.getComponent()).$().chain("multiboxesselection");
   }
   return statement;
 }
示例#2
0
  /** Returns the window's height. */
  public int getHeight() {
    if (this.options.containsKey("height")) {
      return options.getInt("height");
    }

    return 0;
  }
示例#3
0
  /** Returns <code>true</code> if this window is resizable. */
  public boolean isResizable() {
    if (this.options.containsKey("resizable")) {
      return options.getBoolean("resizable");
    }

    return true;
  }
示例#4
0
  /** @return if this window is modal. */
  public boolean isModal() {
    if (this.options.containsKey("modal")) {
      return options.getBoolean("modal");
    }

    return false;
  }
示例#5
0
  /** Returns the window's max width. */
  public int getMinWidth() {
    if (this.options.containsKey("minWidth")) {
      return options.getInt("minWidth");
    }

    return 150;
  }
示例#6
0
  /** Returns the window's max width. */
  public int getMaxWidth() {
    if (this.options.containsKey("maxWidth")) {
      return options.getInt("maxWidth");
    }

    return 0;
  }
示例#7
0
  /** Returns the dialog's width. */
  public int getWidth() {
    if (this.options.containsKey("width")) {
      return options.getInt("width");
    }

    return 300;
  }
示例#8
0
  /** @return if this window auto opens on page loading. */
  public boolean isAutoOpen() {
    if (this.options.containsKey("autoOpen")) {
      return options.getBoolean("autoOpen");
    }

    return true;
  }
示例#9
0
  /** Returns the window's min height. */
  public int getMinHeight() {
    if (this.options.containsKey("minHeight")) {
      return options.getInt("minHeight");
    }

    return 150;
  }
示例#10
0
 /**
  * Sets the effect used when the window shows itself.
  *
  * @param hideEffect {@link String} with the given effect's name.
  * @return instance of the current component
  */
 public Dialog setShowEffect(String hideEffect) {
   options.putLiteral("show", hideEffect);
   return this;
 }
示例#11
0
 /**
  * Sets the effect used when the window closes.
  *
  * @param hideEffect {@link String} with the given effect's name.
  * @return instance of the current component
  */
 public Dialog setHideEffect(String hideEffect) {
   options.putLiteral("hide", hideEffect);
   return this;
 }
示例#12
0
 /*
  * (non-Javadoc)
  * @see org.objetdirect.wickext.core.commons.JavaScriptCallable#statement()
  */
 public JsStatement statement() {
   return new JsQuery(this).$().chain("dialog", options.getJavaScriptOptions());
 }
示例#13
0
 /**
  * The specified class name(s) will be added to the dialog, for additional theming.
  *
  * @return instance of the current component
  */
 public Dialog setDialogClass(String dialogClass) {
   options.putLiteral("dialogClass", dialogClass);
   return this;
 }
示例#14
0
 /**
  * Sets if this window is modal or not.
  *
  * @param modal true if the window is modal, false otherwise
  * @return instance of the current component
  */
 public Dialog setModal(boolean modal) {
   options.put("modal", modal);
   return this;
 }
示例#15
0
 /**
  * Sets the window's height.
  *
  * @return instance of the current component
  */
 public Dialog setHeight(int height) {
   options.put("height", height);
   return this;
 }
示例#16
0
 /**
  * Sets the window's width.
  *
  * @return instance of the current component
  */
 public Dialog setWidth(int width) {
   options.put("width", width);
   return this;
 }
示例#17
0
 /**
  * Sets the overlay under the window. This parameter will take effect only if the {@link
  * #setModal(boolean)} method is call with true.
  *
  * @param ratio a float value between 0 and 1 (1 is 100% black overlay)
  * @return instance of the current component
  * @deprecated will be removed in 1.3
  */
 @Deprecated
 public Dialog setOverlayRatio(float ratio) {
   // TODO nested options !
   options.put("overlay", "{opacity: " + ratio + ", background: 'black'}");
   return this;
 }
示例#18
0
 /**
  * Sets the window's max height.
  *
  * @return instance of the current component
  */
 public Dialog setMaxHeight(int maxHeight) {
   options.put("maxHeight", maxHeight);
   return this;
 }
示例#19
0
 /**
  * Sets the window's max width.
  *
  * @return instance of the current component
  */
 public Dialog setMaxWidth(int maxWidth) {
   options.put("maxWidth", maxWidth);
   return this;
 }
示例#20
0
 /**
  * Sets if this window opens autmatically after the page is loaded.
  *
  * @param autoOpen true if the window auto opens, false otherwise
  * @return instance of the current component
  */
 public Dialog setAutoOpen(boolean autoOpen) {
   options.put("autoOpen", autoOpen);
   return this;
 }
示例#21
0
 /**
  * Sets the window's min height.
  *
  * @return instance of the current component
  */
 public Dialog setMinHeight(int minHeight) {
   options.put("minHeight", minHeight);
   return this;
 }
示例#22
0
 /**
  * Sets the window's position.
  *
  * @return instance of the current component
  */
 public Dialog setPosition(WindowPosition windowPosition) {
   options.putLiteral("position", windowPosition.name().toLowerCase());
   return this;
   // TODO change the parameter of this method
 }
示例#23
0
 /**
  * Sets the window's min width.
  *
  * @return instance of the current component
  */
 public Dialog setMinWidth(int minWidth) {
   options.put("minWidth", minWidth);
   return this;
 }
示例#24
0
 /** Returns the {@link WindowPosition}. */
 public WindowPosition getPosition() {
   String literal = options.getLiteral("position");
   return literal == null ? WindowPosition.CENTER : WindowPosition.valueOf(literal.toUpperCase());
 }
示例#25
0
 /**
  * Sets if this window is resizable or not.
  *
  * @return instance of the current component
  */
 public Dialog setResizable(boolean resizable) {
   options.put("resizable", resizable);
   return this;
 }
示例#26
0
 /**
  * Sets a the text for the close button
  *
  * @return instance of the current component
  */
 public Dialog setCloseText(String closeText) {
   options.putLiteral("closeText", closeText);
   return this;
 }
示例#27
0
 /**
  * Sets the window's title.
  *
  * <p><strong>Note:</strong> the title can be automatically sets when the HTML <code>title</code>
  * attribute is set.
  *
  * @return instance of the current component
  */
 public Dialog setTitle(IModel<String> title) {
   options.putLiteral("title", title);
   return this;
 }
示例#28
0
 /** @return the closeText option */
 public String getCloseText() {
   String closeText = options.getLiteral("closeText");
   return closeText == null ? "close" : closeText;
 }
示例#29
0
 /** Binds the <code>css</code> statement. */
 public static ChainableStatement css(Options options) {
   return new DefaultChainableStatement("css", options.getJavaScriptOptions());
 }
示例#30
0
 /** Returns the css class applied to customize this window. */
 public String getCssClass() {
   String dialogClass = options.getLiteral("dialogClass");
   return dialogClass == null ? "*" : dialogClass;
 }