コード例 #1
0
ファイル: TagAction.java プロジェクト: pqnelson/exchangerxml
  /**
   * Sets the current view.
   *
   * @param view the current view.
   */
  public void setView(Object view) {
    if (view instanceof Editor) {
      editor = (Editor) view;
    } else {
      editor = null;
    }

    setDocument(parent.getDocument());
  }
コード例 #2
0
ファイル: TagAction.java プロジェクト: pqnelson/exchangerxml
  /**
   * The implementation of the tag action, called after a user action.
   *
   * @param event the action event.
   */
  public void actionPerformed(ActionEvent event) {
    if (DEBUG) System.out.println("TagAction.actionPerformed( " + event + ")");

    if (dialog == null) {
      dialog = new TagDialog(parent);
    }

    dialog.init(editor);
    dialog.show();

    if (!dialog.isCancelled()) {
      String tag = dialog.getTag();

      if (tag != null && tag.trim().length() > 0) {
        parent.getRepeatTagAction().setTag(tag);
        editor.insertTag(tag);
      }
    }

    editor.setFocus();
  }
コード例 #3
0
 private void elementSelected() {
   parent.getView().getSchemaViewer().setRoot(getSelectedElement());
 }