コード例 #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());
 }