Ejemplo n.º 1
0
  /**
   * Sets the current editor to the specified editor, loads the current entry, and makes sure that
   * it is visible to the user.
   *
   * @param makeCurrent the editor to select.
   */
  protected void setCurrentEditor(PluggableEditor makeCurrent) {
    currentEditor = makeCurrent;
    if (currentEditor != null && currentEditor.getDataSink() != null)
      currentEditor.getDataSink().displayEntry(entry, dataSource);

    int index = activeEditors.indexOf(makeCurrent);

    if (index == -1) {
      clearPluggableEditors();
      addEditor(makeCurrent);

      setSelectedIndex(activeEditors.indexOf(makeCurrent));

    } else if (index != getSelectedIndex()) {
      setSelectedIndex(index);
    }
  }