private TextBox textBoxEditor(final RuleAttribute at, final boolean isReadOnly) {
    final TextBox box = new TextBox();
    box.setEnabled(!isReadOnly);
    box.setVisibleLength((at.getValue().length() < 3) ? 3 : at.getValue().length());
    box.setText(at.getValue());
    box.addChangeHandler(
        new ChangeHandler() {
          public void onChange(ChangeEvent event) {
            at.setValue(box.getText());
          }
        });

    if (at.getAttributeName().equals(DATE_EFFECTIVE_ATTR)
        || at.getAttributeName().equals(DATE_EXPIRES_ATTR)) {
      if (at.getValue() == null || "".equals(at.getValue())) {
        box.setText("");
      }

      box.setVisibleLength(10);
    }

    box.addKeyUpHandler(
        new KeyUpHandler() {
          public void onKeyUp(KeyUpEvent event) {
            int length = box.getText().length();
            box.setVisibleLength(length > 0 ? length : 1);
          }
        });
    return box;
  }
Пример #2
0
  protected void showEditor() {
    if (myTextEditor == null) {
      myTextEditor = new TextBox();
      myTextEditor.setStylePrimaryName("field_edit");
      myTextEditor.addValueChangeHandler(
          new ValueChangeHandler<String>() {
            public void onValueChange(ValueChangeEvent<String> aEvent) {
              hideEditor(true);
            }
          });
      myTextEditor.addBlurHandler(
          new BlurHandler() {

            public void onBlur(BlurEvent aEvent) {
              hideEditor(false);
            }
          });
    }
    if (allowHtml) {
      myTextEditor.setText(myHtmlView.getHTML());
      myOuterPanel.remove(myHtmlView);
    } else {
      myTextEditor.setText(myTextView.getText());
      myOuterPanel.remove(myTextView);
    }
    myOuterPanel.add(myTextEditor);
    myTextEditor.setFocus(true);
  }
Пример #3
0
 private void doFieldLabel() {
   if (nil(this.editingCol.getFactField())) {
     fieldLabel.setText(constants.pleaseChooseFactType());
   } else {
     fieldLabel.setText(editingCol.getFactField());
   }
 }
Пример #4
0
  /**
   * Invoked from the super class,
   *
   * @see org.usemon.gui.client.dimquery.wizard.WizardPanel#updateData()
   */
  protected void updateData(Widget widget) {
    if (widget instanceof RadioButton) {
      periodFromDate = null;
      periodToDate = null;
      fromDateTextBox.setText(null);
      toDateTextBox.setText(null);
    } else if (widget instanceof RadioButtonTimeFrame) {
      periodFromDate = null;
      periodToDate = null;
      fromDateTextBox.setText(null);
      toDateTextBox.setText(null);
      numberOfMilliSeconds = ((RadioButtonTimeFrame) widget).getTotalMillis();
    } else {
      DateTimeFormat formatter = DateTimeFormat.getFormat("dd.MM.yyyy");
      String fromDate = fromDateTextBox.getText();
      if (fromDate != null && fromDate.length() > 0) {
        periodFromDate = formatter.parse(fromDate);
        noValue.setChecked(true);
      } else {
        periodFromDate = null;
      }

      String toDate = toDateTextBox.getText();
      if (toDate != null && toDate.length() > 0) {
        periodToDate = formatter.parse(toDate);
        noValue.setChecked(true);
      } else {
        periodToDate = null;
      }
    }
  }
Пример #5
0
 private void showEditForm(
     String nameStr, String userStr, String passStr, String deptStr, boolean editing) {
   VerticalPanel editPanel = new VerticalPanel();
   HorizontalPanel row1 = new HorizontalPanel();
   Label nameLabel = new Label("Name: ");
   row1.add(nameLabel);
   row1.add(nameBox);
   nameBox.setText(nameStr);
   editPanel.add(row1);
   HorizontalPanel row2 = new HorizontalPanel();
   Label userLabel = new Label("Username: "******"Password: "******"Department: ");
   row4.add(deptLabel);
   row4.add(deptBox);
   deptBox.setText(deptStr);
   editPanel.add(row4);
   if (editing) {
     editPanel.add(editSubmitButton);
   } else {
     editPanel.add(addSubmitButton);
   }
   mainPanel.clear();
   mainPanel.add(editPanel);
 }
  /** Show parameters when clicked. */
  public void onClick(Widget arg0) {

    if (parametersForm != null) {

      parametersForm.clear();

      // Add Type:
      parametersForm.addAttribute("Type", new Label(type.toString()));

      for (final ConnectionRef connectionRef : constraints.keySet()) {

        final Constraint constraint = constraints.get(connectionRef);

        final TextBox priorityTextBox = new TextBox();
        priorityTextBox.setWidth("30px");
        priorityTextBox.setText(constraint.getPriority() + "");

        priorityTextBox.addFocusListener(
            new FocusListener() {
              public void onFocus(Widget arg1) {
                priorityTextBox.selectAll();
              }

              public void onLostFocus(Widget arg1) {

                final Constraint constraint = constraints.get(connectionRef);
                constraint.setPriority(Integer.parseInt(priorityTextBox.getText()));
                constraints.put(connectionRef, constraint);
              }
            });

        final TextBox constraintTextBox = new TextBox();
        constraintTextBox.setWidth("300px");
        constraintTextBox.setText(constraint.getConstraint());

        constraintTextBox.addFocusListener(
            new FocusListener() {
              public void onFocus(Widget arg1) {
                constraintTextBox.selectAll();
              }

              public void onLostFocus(Widget arg1) {

                final Constraint constraint = constraints.get(connectionRef);
                constraint.setConstraint(constraintTextBox.getText());
                constraints.put(connectionRef, constraint);
              }
            });

        Panel panel = new HorizontalPanel();
        panel.add(new Label(" Priority: "));
        panel.add(priorityTextBox);
        panel.add(new Label(" Value: "));
        panel.add(constraintTextBox);

        parametersForm.addAttribute(constraint.getName(), panel);
      }
    }
  }
 @Override
 public void clearValue() {
   displayNameField.setText("");
   iriField.setText("");
   types.clearValue();
   assertions.clearValue();
   sameAs.clearValue();
 }
Пример #8
0
 /** Cleans all fields of the Login form */
 private static void cleanup() {
   inputUsername.setText("");
   inputPassword.setText("");
   inputConfirmPassword.setText("");
   inputEmail.setText("");
   lSignInStatus.setText("");
   lSignUpStatus.setText("");
   signUpDisclosure.setOpen(false);
 }
Пример #9
0
 @Override
 void resetForm() {
   resetLookup();
   listOrderEd.setText("");
   seasonEd.setText("");
   if (editRb.getValue()) {
     enableContentFields(false);
   }
 }
Пример #10
0
 public void setCurrentValue(String currentValue2) {
   if (currentValue2 == null) {
     currentValue.setText(NULL_STRING);
     currentValue.setEnabled(false);
     nullValue.setValue(true);
   } else {
     currentValue.setText(currentValue2);
   }
 }
  public void OpenEditPanel() {
    GeneralPanel.remove(PanelEdicion);
    GeneralPanel.add(PanelEdicion, 0, 0);
    PanelEdicion.setSize(
        PanelActivity.getOffsetWidth() + "px", PanelActivity.getOffsetHeight() + "px");
    PanelEdicion.clear();
    PanelEdicion.setStyleName("BlancoTransparente");
    Button Boton = new Button();

    Boton.setHTML(ConstantsInformation.END_EDIT_BOTTON);
    Boton.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            closeEditPanel();

            if (!SelectTeacherCatalogButtonTextBox.getText().isEmpty())
              BOTTON_TEACHER_CATALOG = SelectTeacherCatalogButtonTextBox.getText();
            else BOTTON_TEACHER_CATALOG = BOTTON_TEACHER_CATALOG_RESET;

            if (!SelectOpenCatalogButtonTextBox.getText().isEmpty())
              BOTTON_OPEN_CATALOG = SelectOpenCatalogButtonTextBox.getText();
            else BOTTON_OPEN_CATALOG = BOTTON_OPEN_CATALOG_RESET;

            ParsearFieldsAItems();
            SaveChages();
          }
        });
    SelectTeacherCatalogButtonTextBox = new TextBox();
    SelectTeacherCatalogButtonTextBox.setText(BOTTON_TEACHER_CATALOG);
    SelectTeacherCatalogButtonTextBox.setSize(
        SelectTeacherCatalogButton.getOffsetWidth() + "px",
        SelectTeacherCatalogButton.getOffsetHeight() + "px");
    PanelEdicion.add(
        SelectTeacherCatalogButtonTextBox,
        SelectTeacherCatalogButton.getAbsoluteLeft()
            - PanelActivity.getAbsoluteLeft()
            - DecoradorWidth,
        SelectTeacherCatalogButton.getAbsoluteTop()
            - PanelActivity.getAbsoluteTop()
            - DecoradorWidth);

    SelectOpenCatalogButtonTextBox = new TextBox();
    SelectOpenCatalogButtonTextBox.setText(BOTTON_OPEN_CATALOG);
    SelectOpenCatalogButtonTextBox.setSize(
        SelectOpenCatalogButton.getOffsetWidth() + "px",
        SelectOpenCatalogButton.getOffsetHeight() + "px");
    PanelEdicion.add(
        SelectOpenCatalogButtonTextBox,
        SelectOpenCatalogButton.getAbsoluteLeft()
            - PanelActivity.getAbsoluteLeft()
            - DecoradorWidth,
        SelectOpenCatalogButton.getAbsoluteTop() - PanelActivity.getAbsoluteTop() - DecoradorWidth);

    PanelEdicion.add(Boton, PanelEdicion.getOffsetWidth() - Constants.TAMANOBOTOBEDITON, 0);
  }
Пример #12
0
  public void setData(String[] data) {
    final int baseName = 12;
    final int basePrice = baseName + Constants.NO_OF_EXTRAS_IN_UI;
    final int basePriceValue = basePrice + Constants.NO_OF_EXTRAS_IN_UI;
    tbKeyId.setText(data[0]);
    String imageKey = data[1];
    if (imageKey != null) {
      imgItem.setUrl(GWT.getHostPageBaseURL() + "serveBlob?id=" + data[1]);
      imgItem.setVisible(true);
    }
    tbName.setText(data[2]);
    taDescription.setText(data[3]);
    editingExistingData = true;
    if (data[4] != null) {
      rbSinglePrice.setValue(true);
      rbSinglePrice.setFormValue("single");
      dbSinglePrice.setValue(Double.parseDouble(data[basePriceValue]));
    } else {
      rbMultiplePrice.setValue(true);
      rbMultiplePrice.setFormValue("multiple");
      if (data[5] != null) {
        cbSmall.setValue(true);
        dbSmallPrice.setValue(Double.parseDouble(data[basePriceValue + 1]));
      }
      if (data[6] != null) {
        cbMedium.setValue(true);
        dbMediumPrice.setValue(Double.parseDouble(data[basePriceValue + 2]));
      }
      if (data[7] != null) {
        cbLarge.setValue(true);
        dbLargePrice.setValue(Double.parseDouble(data[basePriceValue + 3]));
      }
      if (data[8] != null) {
        cbTapa.setValue(true);
        dbTapaPrice.setValue(Double.parseDouble(data[basePriceValue + 4]));
      }
      if (data[9] != null) {
        cbHalf.setValue(true);
        dbHalfPrice.setValue(Double.parseDouble(data[basePriceValue + 5]));
      }
      if (data[10] != null) {
        cbFull.setValue(true);
        dbFullPrice.setValue(Double.parseDouble(data[basePriceValue + 6]));
      }
    }
    if (data[11] != null) {
      tbExtrasName.setText(data[11]);
    }

    for (int i = 0; i < Constants.NO_OF_EXTRAS_IN_UI; i++) {
      String name = data[baseName + i];
      if (name != null) {
        tbExtras[i].setText(name);
        tbExtrasPrices[i].setText(data[basePrice + i]);
      }
    }
  }
Пример #13
0
  public GetSetRegControl2(final int addr, final int reg, String text) {
    super(addr);
    this.label = new Label(text);
    this.editHi = new TextBox();
    this.editLo = new TextBox();
    this.reg = reg;

    editHi.setWidth("25px");
    editLo.setWidth("25px");

    panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

    panel.add(label);
    panel.add(editHi);
    panel.add(editLo);

    editHi.setEnabled(false);
    editHi.setText("???");
    editLo.setEnabled(false);
    editLo.setText("???");

    Button setButton = new Button("Set");
    setButton.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            editHi.setEnabled(false);
            editLo.setEnabled(false);

            try {
              int val = Integer.valueOf(editHi.getText()) * 256 + Integer.valueOf(editLo.getText());
              controllersService.setReg(
                  addr,
                  reg,
                  val,
                  new AsyncCallback<Void>() {
                    @Override
                    public void onSuccess(Void result) {
                      editHi.setEnabled(true);
                      editLo.setEnabled(true);
                    }

                    @Override
                    public void onFailure(Throwable caught) {
                      if (caught instanceof AuthException) Window.alert(caught.getMessage());
                    }
                  });
            } catch (NumberFormatException e) {
              refresh();
            }
          }
        });
    panel.add(setButton);

    initWidget(panel);
  }
Пример #14
0
 @UiHandler("nullValue")
 void handleClick(ClickEvent e) {
   if (nullValue.getValue() == true) {
     currentValue.setText(NULL_STRING);
     currentValue.setEnabled(false);
   } else {
     currentValue.setText("");
     currentValue.setEnabled(true);
   }
 }
Пример #15
0
  public static void reloadForm() {

    inputUsername.setText("");
    inputPassword.setText("");
    inputConfirmPassword.setText("");
    inputEmail.setText("");
    lSignInStatus.setText("");
    lSignUpStatus.setText("");
    signUpDisclosure.setOpen(false);
  }
Пример #16
0
 private void setOccurrenceGroup(VariableDto variableDto) {
   if (variableDto.getIsRepeatable()) {
     occurrenceGroup.setEnabled(true);
     occurrenceGroup.setText(
         variableDto.hasOccurrenceGroup() ? variableDto.getOccurrenceGroup() : "");
   } else {
     occurrenceGroup.setEnabled(false);
     occurrenceGroup.setText("");
   }
 }
Пример #17
0
 @Override
 public void formClear() {
   variableName.setText("");
   repeatableCheckbox.setValue(false);
   occurrenceGroup.setText("");
   occurrenceGroup.setEnabled(
       false); // Occurrence group is only enabled when repeatableCheckbox is true.
   unit.setText("");
   mimeType.setText("");
 }
 @Override
 public void setClassData(ClasspageDo classpageDo) {
   this.classpageDo = classpageDo;
   this.visiblity = classpageDo.isVisibility();
   if (classpageDo.getMinimumScore() > 0) {
     scoreTextBox.setText(classpageDo.getMinimumScore() + "");
   } else {
     scoreTextBox.setText("0");
   }
 }
  public void setCustomer(CustomerModel c) {
    customer = c;

    if (customer != null) {
      // Display the fields
      firstname.setText(customer.getFirstname());
      lastname.setText(customer.getLastname());
      birthdate.setValue(customer.getBirthdate());
    }
  }
Пример #20
0
  private void checkInputLabel_key(boolean click) {

    if (getConsumerKey().length() == 0 && click == false) {
      tbConsumerKey.setText(inputLabel_ConsumerKey);
      tbConsumerKey.addStyleName("login-Ui-InputLabel");

    } else if (getConsumerKey().equals(inputLabel_ConsumerKey) == true) {
      tbConsumerKey.setText("");
      tbConsumerKey.removeStyleName("login-Ui-InputLabel");
    }
  }
Пример #21
0
  private void displayReport() {
    errorText.setInnerText("");
    purposeText.setText(report.getPurpose());
    notesText.setText(report.getNotes());
    String department = report.getDepartment();
    departmentList.setSelectedIndex(0);
    for (int i = 0; i < Expenses.DEPARTMENTS.length; i++) {
      if (Expenses.DEPARTMENTS[i].equals(department)) {
        departmentList.setSelectedIndex(i);
      }
    }

    Date d = report.getCreated();
    showCreationDate(d);
  }
Пример #22
0
 @UiHandler("clearSessionFiltersButton")
 void handleClearSessionFiltersButtonClick(ClickEvent e) {
   sessionsTo.setValue(null, true);
   sessionsFrom.setValue(null, true);
   sessionIdsTextBox.setText(null);
   stopTypingSessionIdsTimer.schedule(10);
 }
  public InlineMultiSelect() {
    popup.setAutoHideEnabled(true);
    popup.addAutoHidePartner(textbox.getElement());

    multiSelect.addValueChangeHandler(
        new ValueChangeHandler<List<String>>() {

          @Override
          public void onValueChange(ValueChangeEvent<List<String>> event) {
            int size = event.getValue().size();
            textbox.setText(size + " selected");
          }
        });
    popup.add(multiSelect);

    textbox.setText("Make a selection");
    textbox.setReadOnly(true);
    panel.add(textbox);
    panel.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            popup.showRelativeTo(panel);
          }
        });

    initWidget(panel);
  }
 @Override
 public void setValue(double value) {
   this.value = value;
   valid = true;
   String formattedValue = NumberFormat.getCurrencyFormat().format(value);
   textBox.setText(formattedValue);
 }
Пример #25
0
 /** clean */
 private void clean() {
   SearchSimple searchSimple = Main.get().mainPanel.search.searchBrowser.searchIn.searchSimple;
   SearchNormal searchNormal = Main.get().mainPanel.search.searchBrowser.searchIn.searchNormal;
   SearchAdvanced searchAdvanced =
       Main.get().mainPanel.search.searchBrowser.searchIn.searchAdvanced;
   searchSimple.fullText.setText("");
   searchNormal.context.setSelectedIndex(
       Main.get().mainPanel.search.searchBrowser.searchIn.posTaxonomy);
   searchNormal.content.setText("");
   searchAdvanced.path.setText("");
   searchAdvanced.categoryPath.setText("");
   searchAdvanced.categoryUuid = "";
   searchNormal.name.setText("");
   searchNormal.keywords.setText("");
   searchSavedName.setText("");
   searchButton.setEnabled(false);
   saveSearchButton.setEnabled(false);
   controlSearch.setVisible(false);
   Main.get().mainPanel.search.searchBrowser.searchIn.resetMetadata();
   searchAdvanced.typeDocument.setValue(true);
   searchAdvanced.typeFolder.setValue(false);
   searchAdvanced.typeMail.setValue(false);
   searchAdvanced.mimeTypes.setSelectedIndex(0);
   searchNormal.userListBox.setSelectedIndex(0);
   searchNormal.startDate.setText("");
   searchNormal.endDate.setText("");
   searchNormal.modifyDateFrom = null;
   searchNormal.modifyDateTo = null;
   searchAdvanced.from.setText("");
   searchAdvanced.to.setText("");
   searchAdvanced.subject.setText("");
   Main.get().mainPanel.search.searchBrowser.searchResult.removeAllRows();
 }
Пример #26
0
        public void onSuccess(Long result) {
          params.setId(result.intValue());

          if (isUserNews) {
            Main.get().mainPanel.search.historySearch.userNews.addNewSavedSearch(params.clone());
            Main.get()
                .mainPanel
                .search
                .historySearch
                .stackPanel
                .showStack(UISearchConstants.SEARCH_USER_NEWS);
            Main.get().mainPanel.dashboard.newsDashboard.getUserSearchs(true);
          } else {
            Main.get().mainPanel.search.historySearch.searchSaved.addNewSavedSearch(params.clone());
            Main.get()
                .mainPanel
                .search
                .historySearch
                .stackPanel
                .showStack(UISearchConstants.SEARCH_SAVED);
          }

          searchSavedName.setText(""); // Clean name atfer saved
          Main.get().mainPanel.search.searchBrowser.searchIn.status.unsetFlag_saveSearch();
        }
Пример #27
0
 public void createDeepLink() {
   if (tabContent instanceof IFrameTabPanel) {
     PromptDialogBox dialogBox =
         new PromptDialogBox(
             Messages.getString("deepLink"),
             Messages.getString("ok"),
             Messages.getString("cancel"),
             false, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
             true);
     String url =
         Window.Location.getProtocol()
             + "//"
             + Window.Location.getHostName()
             + ":"
             + Window.Location.getPort()
             + Window.Location.getPath() // $NON-NLS-1$ //$NON-NLS-2$
             + "?name="
             + textLabel.getText()
             + "&startup-url="; //$NON-NLS-1$ //$NON-NLS-2$
     String startup = ((IFrameTabPanel) tabContent).getUrl();
     TextBox urlbox = new TextBox();
     urlbox.setText(url + URL.encodeComponent(startup));
     urlbox.setVisibleLength(80);
     dialogBox.setContent(urlbox);
     dialogBox.center();
   }
 }
Пример #28
0
    public void initLayout() {
      lang = new ListBox();
      lang =
          Convert.makeSelectedLanguageListBox(
              (ArrayList<String[]>) MainApp.getLanguage(), tObj.getLang());
      lang.setWidth("100%");
      lang.setEnabled(false);

      term = new TextBox();
      term.setText(tObj.getLabel());
      term.setWidth("100%");

      main = new CheckBox(constants.conceptPreferredTerm());
      if (tObj.isMainLabel()) {
        main.setValue(tObj.isMainLabel());
        // main.setEnabled(false);
      }

      Grid table = new Grid(2, 2);
      table.setWidget(0, 0, new HTML(constants.conceptTerm()));
      table.setWidget(1, 0, new HTML(constants.conceptLanguage()));
      table.setWidget(0, 1, term);
      table.setWidget(1, 1, lang);
      table.setWidth("100%");
      table.getColumnFormatter().setWidth(1, "80%");

      VerticalPanel vp = new VerticalPanel();
      vp.add(GridStyle.setTableConceptDetailStyleleft(table, "gslRow1", "gslCol1", "gslPanel1"));
      vp.add(main);
      vp.setSpacing(0);
      vp.setWidth("100%");
      vp.setCellHorizontalAlignment(main, HasHorizontalAlignment.ALIGN_RIGHT);

      addWidget(vp);
    }
  public CustomizeAlertPanel(
      TenantIdentifier tenant, JobIdentifier job, AlertDefinition alert, JobMetrics result) {
    super();

    _alert = alert;
    metricAnchor = new MetricAnchor(tenant);
    metricAnchor.setJobMetrics(result);
    metricAnchor.setMetric(_alert.getMetricIdentifier());

    initWidget(uiBinder.createAndBindUi(this));

    _severityIntelligenceRadio =
        createRadioButton("alert_severity", "Intelligence", AlertSeverity.INTELLIGENCE);
    _severitySurveillanceRadio =
        createRadioButton("alert_severity", "Surveillance", AlertSeverity.SURVEILLANCE);
    _severityWarningRadio = createRadioButton("alert_severity", "Warning", AlertSeverity.WARNING);
    _severityFatalRadio = createRadioButton("alert_severity", "Fatal", AlertSeverity.FATAL);

    if (getSelectedSeverity() == null) {
      // set default severity
      _severityIntelligenceRadio.setValue(true);
    }

    descriptionTextBox.setText(_alert.getDescription());
    minimumValueTextBox.setNumberValue(_alert.getMinimumValue());
    maximumValueTextBox.setNumberValue(_alert.getMaximumValue());
  }
Пример #30
0
  /**
   * Ajoute une tache dans la table des tâches. Déclenchée par un click sur le addTaskButton ou par
   * la touche Enter depuis le champ newTaskTextBox.
   */
  private void addTask() {
    String symbol = newTaskTextBox.getText().trim();
    newTaskTextBox.setFocus(true);

    // Stock code must be between 1 and 10 chars that are numbers, letters, or dots.
    if (symbol.length() < 3) {
      Window.alert("le nom de la tâche doit faire plus de 3 caractères.");
      newTaskTextBox.selectAll();
      return;
    }

    newTaskTextBox.setText("");

    // Rename the task if it's already in the table.
    if (tasks.contains(symbol)) {
      int n = 1;
      while (tasks.contains(symbol + " (" + n + ")")) {
        n++;
      }
      symbol = symbol + " (" + n + ")";
    }

    final String finalSymbol = symbol;
    addStock(symbol);
  }