/** 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"); }
public void add(PluggableEditor ed, int index) { // add(ed.getName(), ed.getDisplayComponent()); // wierd array bounds error thrown here? insertTab(ed.getName(), ed.getIcon(), ed.getDisplayComponent(), ed.getToolTip(), index); activeEditors.add(index, ed); }