示例#1
0
  private final ContentPanel createPropertiesContent() {
    FormPanel panel = new FormPanel();
    panel.setHeaderVisible(false);
    panel.setButtonAlign(HorizontalAlignment.RIGHT);
    panel.setStyleAttribute("padding", "20");

    KeyListener keyListener =
        new KeyListener() {
          public void componentKeyUp(ComponentEvent event) {
            editor.markDirty();
          }
        };

    name = new TextField<String>();
    name.setFieldLabel(constants.name());
    name.setEmptyText(constants.groupName());
    name.setAllowBlank(false);
    name.setMinLength(2);
    name.addKeyListener(keyListener);
    name.setStyleAttribute("marginTop", "5");
    name.setStyleAttribute("marginBottom", "5");
    panel.add(name);

    description = new TextArea();
    description.setPreventScrollbars(true);
    description.setFieldLabel(constants.description());
    description.addKeyListener(keyListener);
    description.setStyleAttribute("marginTop", "5");
    description.setStyleAttribute("marginBottom", "5");
    panel.add(description);

    return panel;
  }
示例#2
0
 @Override
 public void setMessages(FilterMessages messages) {
   super.setMessages(messages);
   if (field != null) {
     field.setEmptyText(getMessages().getEmptyText());
   }
 }
示例#3
0
  private TextField<String> buildFilterField() {
    filter =
        new TextField<String>() {
          @Override
          public void onKeyUp(FieldEvent fe) {
            String val = getValue();
            if (val == null || val.isEmpty()) {
              search("");
              return;
            }

            if (fe.getKeyCode() == 13) {
              if (val.length() >= 3) {
                search(val);
              }
            }
          }
        };

    filter.setEmptyText(I18N.DISPLAY.searchToolTip());
    filter.setToolTip(I18N.DISPLAY.searchToolTip());
    filter.setId(ID_SEARCH_FLD);
    filter.setWidth(350);
    return filter;
  }
示例#4
0
 /**
  * Instantiates a new prompt top dialog.
  *
  * @param builder the builder
  */
 protected PromptTopDialog(final Builder builder) {
   super(builder);
   promptLabel = new Label();
   promptLabel.addStyleName("kune-Margin-Medium-b");
   if (builder.promptLines > 1) {
     textField = new TextArea();
     textField.setHeight(20 * builder.promptLines);
   } else {
     textField = new TextField<String>();
   }
   if (TextUtils.notEmpty(builder.textFieldStyle)) {
     textField.addStyleName(builder.textFieldStyle);
   }
   textField.setRegex(builder.regex);
   textField.getMessages().setRegexText(builder.regexText);
   textField.getMessages().setMinLengthText(builder.minLengthText);
   textField.getMessages().setMaxLengthText(builder.maxLengthText);
   textField.setTabIndex(1);
   textField.setId(builder.textboxId);
   if (TextUtils.notEmpty(builder.emptyText)) {
     textField.setEmptyText(builder.emptyText);
   }
   if (builder.textFieldWidth != 0) {
     textField.setWidth(builder.textFieldWidth);
   }
   if (builder.minLength != 0) {
     textField.setMinLength(builder.minLength);
   }
   if (builder.maxLength != 0) {
     textField.setMaxLength(builder.maxLength);
   }
   if (builder.promptWidth != 0) {
     textField.setWidth(builder.promptWidth);
   }
   textField.setAllowBlank(builder.allowBlank);
   textField.addListener(
       Events.OnKeyPress,
       new Listener<FieldEvent>() {
         @Override
         public void handleEvent(final FieldEvent fe) {
           if (fe.getEvent().getKeyCode() == 13) {
             builder.onEnter.onEnter();
           }
         }
       });
   if (TextUtils.notEmpty(builder.promptText)) {
     promptLabel.setText(builder.promptText);
   }
   super.getInnerPanel().add(promptLabel);
   super.getInnerPanel().add(textField);
 }
示例#5
0
  private final ContentPanel createPropertiesPanel() {
    FormPanel panel = new FormPanel();
    panel.setHeaderVisible(false);
    panel.setButtonAlign(HorizontalAlignment.RIGHT);
    panel.setStyleAttribute("padding", "20");

    serverName = new TextField<String>();
    serverName.setFieldLabel("Server Name");
    serverName.setEmptyText("Please enter the server name");
    serverName.setAllowBlank(false);
    serverName.setMinLength(1);
    panel.add(serverName);

    return panel;
  }
  private HorizontalPanel getSearchPanel() {
    HorizontalPanel searchBox = new HorizontalPanel();
    TextField<String> msisdnField = new TextField<String>();
    msisdnField.setFieldLabel("MSISDN");
    msisdnField.setWidth(200);
    msisdnField.setEmptyText("Enter MSISDN");
    Button searchButton = new Button("Search");
    searchBox.setShadow(true);
    searchBox.setSpacing(5);
    searchBox.add(msisdnField);
    searchBox.add(searchButton);
    searchBox.setHorizontalAlign(HorizontalAlignment.CENTER);
    searchButton.addSelectionListener(
        new SelectionListener<ButtonEvent>() {

          @Override
          public void componentSelected(ButtonEvent ce) {}
        });
    return searchBox;
  }