Exemplo n.º 1
0
  /** Updates the displayed widgets to mark them as readOnly if needed. */
  protected void updateControls() {
    for (Control container : self.getChildren()) {
      // TODO : Browse recursively ?
      if (container instanceof Composite) {
        for (Control control : ((Composite) container).getChildren()) {
          if (control instanceof AbstractEditor) {
            AbstractEditor editor = (AbstractEditor) control;
            editor.setReadOnly(getReadOnly() || editor.isReadOnly());
          }
        }
      }
    }

    self.setEnabled(!getReadOnly());
  }