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

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

    tableComponent.setModel(department.getDivisions());

    tableComponent.dataBind();

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

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