Exemplo n.º 1
0
  @Override
  public void setReadOnly(boolean readOnly) {
    super.setReadOnly(readOnly);

    tableComponent.setReadOnly(readOnly);
    tableComponent.setUserSelectable(!readOnly);
  }
Exemplo n.º 2
0
  @Override
  public void dataBind() {
    tableComponent.setParentModel(department);

    tableComponent.setModel(department.getDivisions());

    tableComponent.dataBind();

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

    setCaption(getLocalizedString("DIALOG_CAPTION"));
    tableComponent.setCaption(getLocalizedString("TABLE_CAPTION"));
  }
Exemplo n.º 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();
              }
            });
  }
Exemplo n.º 5
0
 protected void onAccept() {
   setModel(tableComponent.getSelectedItem());
 }