コード例 #1
0
ファイル: UISpaceSettings.java プロジェクト: binhdv/social
  /**
   * constructor
   *
   * @param name
   * @throws Exception
   */
  public UISpaceSettings(String name) throws Exception {
    super(name);
    WebuiRequestContext requestContext = WebuiRequestContext.getCurrentInstance();
    ResourceBundle resourceBundle = requestContext.getApplicationResourceBundle();
    UIFormStringInput spaceDisplayName =
        new UIFormStringInput(SPACE_DISPLAY_NAME, SPACE_DISPLAY_NAME, null);
    spaceDisplayName.setHTMLAttribute(
        HTML_ATTRIBUTE_PLACEHOLDER,
        resourceBundle.getString("UISpaceSettings.label.spaceDisplayName"));
    addUIFormInput(
        spaceDisplayName
            .addValidator(MandatoryValidator.class)
            .addValidator(
                ExpressionValidator.class, "^([\\p{L}\\s\\d\']+[\\s]?)+$", MSG_INVALID_SPACE_NAME)
            .addValidator(StringLengthValidator.class, 3, 30));

    UIFormTextAreaInput description =
        new UIFormTextAreaInput(SPACE_DESCRIPTION, SPACE_DESCRIPTION, null);
    description.setHTMLAttribute(
        HTML_ATTRIBUTE_PLACEHOLDER,
        resourceBundle.getString("UISpaceSettings.label.spaceDescription"));
    addUIFormInput(description.addValidator(StringLengthValidator.class, 0, 255));
  }
コード例 #2
0
ファイル: UISpaceInfo.java プロジェクト: boueslati/social
  /**
   * constructor
   *
   * @throws Exception
   */
  public UISpaceInfo() throws Exception {
    WebuiRequestContext requestContext = WebuiRequestContext.getCurrentInstance();
    ResourceBundle resourceBundle = requestContext.getApplicationResourceBundle();
    UIFormStringInput spaceId = new UIFormStringInput(SPACE_ID, SPACE_ID, null).setRendered(false);
    spaceId.setHTMLAttribute(
        HTML_ATTRIBUTE_TITLE, resourceBundle.getString("UISpaceInfo.label.SpaceId"));
    addUIFormInput(spaceId);

    UIFormStringInput spaceDisplayName =
        new UIFormStringInput(SPACE_DISPLAY_NAME, SPACE_DISPLAY_NAME, null);
    spaceDisplayName.setHTMLAttribute(
        HTML_ATTRIBUTE_PLACEHOLDER,
        resourceBundle.getString("UISpaceSettings.label.spaceDisplayName"));
    addUIFormInput(
        spaceDisplayName
            .addValidator(MandatoryValidator.class)
            .addValidator(
                ExpressionValidator.class,
                "^([\\p{L}\\d\']+[\\s]?)+$",
                "UISpaceInfo.msg.name-invalid")
            .addValidator(StringLengthValidator.class, 3, 30));

    UIFormTextAreaInput description =
        new UIFormTextAreaInput(SPACE_DESCRIPTION, SPACE_DESCRIPTION, null);
    description.setHTMLAttribute(
        HTML_ATTRIBUTE_PLACEHOLDER,
        resourceBundle.getString("UISpaceSettings.label.spaceDescription"));
    addUIFormInput(description.addValidator(StringLengthValidator.class, 0, 255));

    // temporary disable tag
    UIFormStringInput tag = new UIFormStringInput(SPACE_TAG, SPACE_TAG, null).setRendered(false);
    tag.setHTMLAttribute(HTML_ATTRIBUTE_TITLE, resourceBundle.getString("UISpaceInfo.label.tag"));
    addUIFormInput(tag);

    PopupContainer popupContainer = createUIComponent(PopupContainer.class, null, null);
    addChild(popupContainer);
  }