consolidate case for property labels

This commit is contained in:
Branislav Stojkovic
2019-01-12 10:46:50 +01:00
parent facf816458
commit 5ce3d6d4b3
8 changed files with 44 additions and 8 deletions
Binary file not shown.
Binary file not shown.
@@ -64,13 +64,15 @@ class ComponentTabbedPane extends JTabbedPane {
public static int SCROLL_STEP = Presenter.ICON_SIZE + ComponentButtonFactory.MARGIN * 2 + 2;
private final IPlugInPort plugInPort;
private Container recentToolbar;
private Container recentToolbar;
private Container buildingBlocksToolbar;
private List<String> pendingRecentComponents = null;
public ComponentTabbedPane(IPlugInPort plugInPort) {
super();
this.plugInPort = plugInPort;
addTab("Recently Used", createRecentComponentsPanel());
addTab("Recently Used", createRecentComponentsPanel());
// addTab("Building Blocks", createBuildingBlocksPanel());
Map<String, List<ComponentType>> componentTypes = plugInPort.getComponentTypes();
List<String> categories = new ArrayList<String>(componentTypes.keySet());
Collections.sort(categories);
@@ -152,6 +154,14 @@ class ComponentTabbedPane extends JTabbedPane {
recentToolbar.setLayout(new BoxLayout(recentToolbar, BoxLayout.X_AXIS));
}
return recentToolbar;
}
public Container getBuildingBlocksToolbar() {
if (buildingBlocksToolbar == null) {
buildingBlocksToolbar = new Container();
buildingBlocksToolbar.setLayout(new BoxLayout(buildingBlocksToolbar, BoxLayout.X_AXIS));
}
return buildingBlocksToolbar;
}
private Component createComponentPanel(List<ComponentType> componentTypes) {
@@ -193,7 +203,33 @@ class ComponentTabbedPane extends JTabbedPane {
panel.add(toolbar, BorderLayout.CENTER);
return panel;
}
}
@SuppressWarnings("unchecked")
private Component createBuildingBlocksPanel() {
JPanel panel = new JPanel(new BorderLayout());
panel.setOpaque(false);
final Container toolbar = getBuildingBlocksToolbar();
// refreshRecentComponentsToolbar(
// toolbar,
// (List<String>) ConfigurationManager.getInstance().readObject(IPlugInPort.RECENT_COMPONENTS_KEY,
// new ArrayList<String>()));
// ConfigurationManager.getInstance().addConfigListener(IPlugInPort.RECENT_COMPONENTS_KEY, new IConfigListener() {
//
// @Override
// public void valueChanged(String key, Object value) {
// // Cache the new list, we'll refresh when there's a
// // chance
// pendingRecentComponents = (List<String>) value;
// }
// });
panel.add(toolbar, BorderLayout.CENTER);
return panel;
}
@SuppressWarnings("unchecked")
private void refreshRecentComponentsToolbar(Container toolbar, List<String> recentComponentClassList) {