コード例 #1
0
ファイル: ViewEditor.java プロジェクト: go2zo/flaming-bear
  /** 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());
  }