private void moveUpAndDownPage(boolean _up) {
   int index = tabbedPanel.getSelectedIndex();
   if (index < 0) return;
   Editor page = pageList.get(index);
   if (page == null) return;
   if (_up) {
     if (index == 0) return;
     pageList.removeElementAt(index);
     pageList.insertElementAt(page, index - 1);
     tabbedPanel.removeTabAt(index);
     tabbedPanel.insertTab(
         page.isActive() ? page.getName() : page.getName() + " (D)",
         null,
         page.getComponent(),
         tooltip,
         index - 1);
   } else {
     if (index == (pageList.size() - 1)) return;
     pageList.removeElementAt(index);
     pageList.insertElementAt(page, index + 1);
     tabbedPanel.removeTabAt(index);
     tabbedPanel.insertTab(
         page.isActive() ? page.getName() : page.getName() + " (D)",
         null,
         page.getComponent(),
         tooltip,
         index + 1);
   }
   tabbedPanel.setSelectedComponent(page.getComponent());
   changed = true;
 }
 protected void addPage(String _typeOfPage, String _name, String _code, boolean _enabled) {
   cardLayout.show(finalPanel, "TabbedPanel");
   _name = getUniqueName(_name);
   Editor page = createPage(_typeOfPage, _name, _code);
   page.setFont(myFont);
   page.setColor(myColor);
   int index = tabbedPanel.getSelectedIndex();
   if (index == -1) {
     pageList.addElement(page);
     if (tabbedPanel.getTabCount() == 0) {
       tabbedPanel.addTab(
           page.getName(),
           null,
           page.getComponent(),
           tooltip); // This causes an exception sometimes
     } else {
       tabbedPanel.insertTab(
           page.getName(), null, page.getComponent(), tooltip, tabbedPanel.getTabCount());
     }
     index = 0;
   } else {
     index++;
     pageList.insertElementAt(page, index);
     tabbedPanel.insertTab(page.getName(), null, page.getComponent(), tooltip, index);
   }
   tabbedPanel.setSelectedComponent(page.getComponent());
   page.setActive(_enabled);
   if (!_enabled) tabbedPanel.setTitleAt(index, page.getName() + " (D)");
   updatePageCounterField(pageList.size());
   // tabbedPanel.validate(); This hangs the computer when reading a file at start-up !!!???
   tabbedPanel.repaint();
   changed = true;
 }
  /** Refreshes the currently visible editor with new info. */
  public void refreshEditors(DXEntry entry, DataBrokerQueryInterface ds) {
    if (currentEditor != null) {
      this.entry = entry; // TE: make sure everything is in sink.
      dataSource = ds;

      currentEditor.getDataSink().displayEntry(entry, ds); // checks for unsaved changes...

      // check that the editor hasn't changed display component
      JComponent display = currentEditor.getDisplayComponent();

      // XXX hack alert - some editor writers change their display component
      // XXX mid-flight, and expect JX to magically notice, and change the
      // XXX the display.  This code attempts to do this.

      if (indexOfComponent(display) == -1) // we have a problem - the display component has changed
      {
        String title = currentEditor.getName();
        ImageIcon icon = currentEditor.getIcon();
        String toolTip = currentEditor.getToolTip();

        int index =
            getSelectedIndex(); // find the index of the editor (XXX - this relies on the
                                // activeEditor vector tracking the inherent tab pane order)

        super.remove(index);
        super.insertTab(title, icon, display, toolTip, index);
        super.setSelectedIndex(index);
      }
    } else log.warning("internal error - no editor available in AttributeDisplay");
  }