예제 #1
0
  @Override
  public void setReadOnly(boolean readOnly) {
    super.setReadOnly(readOnly);

    tableComponent.setReadOnly(readOnly);
    tableComponent.setUserSelectable(!readOnly);
  }
예제 #2
0
  @Override
  public void dataBind() {
    tableComponent.setParentModel(department);

    tableComponent.setModel(department.getDivisions());

    tableComponent.dataBind();

    if (getModel() != null) tableComponent.setSelectedValue(getModel().getBean());
  }
예제 #3
0
  @Override
  protected void setupLocalizedCaptions(Locale locale) {
    super.setupLocalizedCaptions(locale);

    setCaption(getLocalizedString("DIALOG_CAPTION"));
    tableComponent.setCaption(getLocalizedString("TABLE_CAPTION"));
  }
예제 #4
0
  public ChooseDivisionDialog(Department department) {
    if (department == null)
      throw new IllegalArgumentException("Argument 'department' must not be null.");

    this.department = department;

    tableComponent = new DivisionsTableComponent();

    tableComponent.setSizeFull();

    addComponent(tableComponent);

    getOkCancelView()
        .addExecuteListener(
            new IListener<CommandExecutionVote>() {
              @Override
              public void onEvent(CommandExecutionVote event) {
                onAccept();
              }
            });
  }
예제 #5
0
 protected void onAccept() {
   setModel(tableComponent.getSelectedItem());
 }