Ejemplo n.º 1
1
  public void actionUpdate() {
    if (ibName.getText().isEmpty()) {
      editError = "You must enter a name";
      requireRedraw();
      return;
    } else {
      editError = "";
    }

    if (tableModel.getUserConfigHandler().configNameExists(ibName.getText(), userConfig.getId())) {
      editError = "A configuration with this name already exists";
      requireRedraw();
      return;
    }

    userConfig =
        tableModel
            .getUserConfigHandler()
            .updateConfig(
                userConfig, ibName.getText(), ibDescription.getText(), rbtnYes.isSelected());

    updateFieldsValues();
    editMode = false;
    requireRedraw();

    fireEvent(EVENT_TYPE_UPDATE);
  }
Ejemplo n.º 2
1
  public void actionCancelUpdate() {
    // if it's a new config we need to fire the delete event to have the
    // control removed, since the entity will not be saved
    if (userConfig.getId() < 1) {
      fireEvent(EVENT_TYPE_DELETE);
      return;
    }

    ibName.setText(userConfig.getName());
    ibDescription.setText(userConfig.getDescription());
    if (userConfig.isPublic()) {
      rbtnYes.setSelected(true);
    } else {
      rbtnNo.setSelected(true);
    }

    editMode = false;
    requireRedraw();
  }
Ejemplo n.º 3
0
 public void actionDelete() {
   fireEvent(EVENT_TYPE_DELETE);
 }
Ejemplo n.º 4
0
 public void actionApply() {
   fireEvent(EVENT_TYPE_APPLY);
 }