use of com.revolsys.swing.TabbedPane in project com.revolsys.open by revolsys.
the class ProjectFrame method newTabLeftCatalogPanel.
protected void newTabLeftCatalogPanel() {
final BaseTreeNode recordStores = RecordStoreConnectionTrees.newRecordStoreConnectionsTreeNode();
final BaseTreeNode fileSystems = PathTreeNode.newFileSystemsTreeNode();
final BaseTreeNode folderConnections = FolderConnectionsTrees.newFolderConnectionsTreeNode();
final BaseTreeNode webServices = WebServiceConnectionTrees.newWebServiceConnectionsTreeNode();
final ListTreeNode root = new ListTreeNode("/", recordStores, fileSystems, folderConnections, webServices);
final BaseTree tree = new BaseTree(root);
tree.setRootVisible(false);
recordStores.expandChildren();
fileSystems.expand();
folderConnections.expandChildren();
webServices.expandChildren();
this.catalogTree = tree;
final Icon icon = Icons.getIconWithBadge("folder", "tree");
final TabbedPane tabs = this.leftTabs;
final Component component = this.catalogTree;
tabs.addTab(icon, "Catalog", component, true);
}
use of com.revolsys.swing.TabbedPane in project com.revolsys.open by revolsys.
the class ProjectFrame method addBottomTab.
public void addBottomTab(final ProjectFramePanel panel, final Map<String, Object> config) {
Invoke.later(() -> {
final TabbedPane tabs = getBottomTabs();
final Object tableView = panel.getProperty(BOTTOM_TAB);
Component component = null;
if (tableView instanceof Component) {
component = (Component) tableView;
if (component.getParent() != tabs) {
component = null;
}
}
if (component == null) {
component = panel.newPanelComponent(config);
if (component != null) {
final Component panelComponent = component;
panel.activatePanelComponent(panelComponent, config);
final int tabIndex = tabs.getTabCount();
panel.setPropertyWeak(BOTTOM_TAB, panelComponent);
final String layerPath = panel.getPath();
final Runnable closeAction = () -> removeBottomTab(panel);
synchronized (this.bottomTabLayerPaths) {
this.bottomTabLayerPaths.add(layerPath);
}
final String name = panel.getName();
final Icon icon = panel.getIcon();
final TabClosableTitle tab = tabs.addClosableTab(name, icon, panelComponent, closeAction);
tab.setMenu(panel);
tabs.setSelectedIndex(tabIndex);
panel.setPropertyWeak(BOTTOM_TAB_LISTENER, //
Arrays.asList(EventQueue.addPropertyChange(panel, "name", () -> {
final int index = tabs.indexOfComponent(panelComponent);
if (index != -1) {
final String newName = panel.getName();
tabs.setTitleAt(index, newName);
}
}), //
EventQueue.addPropertyChange(panel, "icon", () -> {
final int index = tabs.indexOfComponent(panelComponent);
if (index != -1) {
final Icon newName = panel.getIcon();
tabs.setIconAt(index, newName);
}
})));
}
} else {
panel.activatePanelComponent(component, config);
tabs.setSelectedComponent(component);
}
});
}
Aggregations