Example #1
0
  /**
   * This method sets the property theme for the component.
   *
   * @param theme The theme to use.
   */
  public void setTheme(String theme) {
    Props props = getPage().getPageProperties();

    String font = props.getThemeProperty(theme, Props.SUBMIT_IMAGE_FONT_FACE);
    int fontStyle = props.getThemeIntProperty(theme, Props.SUBMIT_IMAGE_FONT_STYLE);
    int size = props.getThemeIntProperty(theme, Props.SUBMIT_IMAGE_FONT_SIZE);
    setFont(font, fontStyle, size);

    Color c = props.getThemeColorProperty(theme, Props.SUBMIT_IMAGE_TEXT_COLOR);

    if (c != null) {
      _textColor = c;
    }

    c = props.getThemeColorProperty(theme, Props.SUBMIT_IMAGE_BACKGROUND_COLOR);

    if (c != null) {
      _backgroundColor = c;
    }

    if (_height == -1) {
      _height = props.getThemeIntProperty(theme, Props.SUBMIT_IMAGE_DEFAULT_HEIGHT);
    }

    c = props.getThemeColorProperty(theme, Props.SUBMIT_IMAGE_TOPLEFT_BORDER_COLOR);

    if (c != null) {
      _topLeftBorder = c;
    }

    c = props.getThemeColorProperty(theme, Props.SUBMIT_IMAGE_BOTTOMRIGHT_BORDER_COLOR);

    if (c != null) {
      _bottomRightBorder = c;
    }

    c = props.getThemeColorProperty(theme, Props.SUBMIT_IMAGE_TRANSPARENT_COLOR);

    if (c != null) {
      _transparentColor = c;
    }

    String style = props.getThemeProperty(theme, Props.SUBMIT_IMAGE_STYLE);

    if (style != null) {
      if (style.toUpperCase().equals(STYLE_OVAL)) {
        _displayStyle = STYLE_OVAL;
      } else {
        _displayStyle = STYLE_RECTANGLE;
      }
    }

    _theme = theme;
  }
  /*
   * (non-Javadoc)
   *
   * @see com.salmonllc.html.HtmlComponent#setTheme(java.lang.String)
   */
  public void setTheme(String theme) {
    Props p = getPage().getPageProperties();
    _popupAttributes = p.getThemeProperty(theme, Props.LOOKUP_COMPONENT_POPUPATTRIBUTES);

    _lookUpPageURL = p.getThemeProperty(theme, Props.LOOKUP_COMPONENT_URL);
    _usePopup = p.getThemeBooleanProperty(theme, Props.LOOKUP_COMPONENT_USEPOPUP, false);
    _useModal = p.getThemeBooleanProperty(theme, Props.LOOKUP_COMPONENT_POPUPMODAL, false);
    _popupWidth = p.getThemeIntProperty(theme, Props.LOOKUP_COMPONENT_POPUPWIDTH, 300);
    _popupHeight = p.getThemeIntProperty(theme, Props.LOOKUP_COMPONENT_POPUPHEIGHT, 300);
    _popupTop = p.getThemeIntProperty(theme, Props.LOOKUP_COMPONENT_POPUPTOP, 0);
    _popupLeft = p.getThemeIntProperty(theme, Props.LOOKUP_COMPONENT_POPUPLEFT, 0);
    _popupPosition =
        p.getThemeProperty(
            theme, Props.LOOKUP_COMPONENT_POPUPPOSITION, Constants.POPUP_POSITION_CUSTOM);
    _useDiv = p.getThemeBooleanProperty(theme, Props.LOOKUP_COMPONENT_POPUPDIV, false);
    _divBorderStyle = p.getThemeProperty(theme, Props.LOOKUP_COMPONENT_POPUPDIVBORDERSTYLE);
    setEditDescription(p.getThemeBooleanProperty(theme, Props.LOOKUP_COMPONENT_EDITDESCRIPTION));
    super.setTheme(theme);
  }