Removed unneeded 'currentNode' member variable from DataContentTopComponent.

Disabled tabs in JTabbedPane in DataContentPanel on panel creation.
This commit is contained in:
Tim McIver 2013-01-23 10:57:45 -05:00
parent 34a36b3be1
commit faa78c614b
2 changed files with 7 additions and 2 deletions

View File

@ -44,13 +44,19 @@ public class DataContentPanel extends javax.swing.JPanel implements DataContent,
// add all implementors of DataContentViewer and put them in the tabbed pane // add all implementors of DataContentViewer and put them in the tabbed pane
Collection<? extends DataContentViewer> dcvs = Lookup.getDefault().lookupAll(DataContentViewer.class); Collection<? extends DataContentViewer> dcvs = Lookup.getDefault().lookupAll(DataContentViewer.class);
for (DataContentViewer factory : Lookup.getDefault().lookupAll(DataContentViewer.class)) { for (DataContentViewer factory : dcvs) {
DataContentViewer dcv = factory.getInstance(); DataContentViewer dcv = factory.getInstance();
viewers.add(new UpdateWrapper(dcv)); viewers.add(new UpdateWrapper(dcv));
jTabbedPane1.addTab(dcv.getTitle(), null, jTabbedPane1.addTab(dcv.getTitle(), null,
dcv.getComponent(), dcv.getToolTip()); dcv.getComponent(), dcv.getToolTip());
} }
// disable the tabs
int numTabs = jTabbedPane1.getTabCount();
for (int tab = 0; tab < numTabs; ++tab) {
jTabbedPane1.setEnabledAt(tab, false);
}
jTabbedPane1.addChangeListener(this); jTabbedPane1.addChangeListener(this);
} }

View File

@ -46,7 +46,6 @@ public final class DataContentTopComponent extends TopComponent implements DataC
// reference to the "default" TC that always stays open // reference to the "default" TC that always stays open
private static DataContentTopComponent defaultInstance; private static DataContentTopComponent defaultInstance;
private Node currentNode;
// set to true if this is the TC that always stays open and is the default place to display content // set to true if this is the TC that always stays open and is the default place to display content
private boolean isDefault; private boolean isDefault;