Skip to content
Snippets Groups Projects
Commit f5f69f18 authored by Raphael GIRARDOT's avatar Raphael GIRARDOT Committed by Patrick MADELA
Browse files

some code refactoring

parent 57827189
Branches
Tags
No related merge requests found
...@@ -22,34 +22,21 @@ public class InfoNodeViewFactory extends AbstractViewFactory { ...@@ -22,34 +22,21 @@ public class InfoNodeViewFactory extends AbstractViewFactory {
} }
@Override @Override
public IView addView(String title, Icon icon, Component component, Object id, JComponent dockingArea) { protected IView createView(String title, Icon icon, Component component, Object id) {
IView addedView = null; return new InfoNodeView(title, icon, component, id);
boolean added = false;
if (id != null) {
synchronized (views) {
if (!views.containsKey(id)) {
addedView = new InfoNodeView(title, icon, component, id);
views.put(id, addedView);
added = true;
} }
addedView = views.get(id);
} @Override
} protected void updateViewForDockingArea(IView view, JComponent dockingArea) {
if ((addedView != null) && added) { if ((view instanceof InfoNodeView) && (dockingArea instanceof RootWindow)) {
InfoNodeView view = (InfoNodeView) addedView; InfoNodeView infoNodeView = (InfoNodeView) view;
if (dockingArea instanceof RootWindow) { RootWindow rootWindow = (RootWindow) dockingArea;
view.getWindowProperties().getTabProperties().getNormalButtonProperties().getCloseButtonProperties() infoNodeView.getWindowProperties().getTabProperties().getNormalButtonProperties()
.setVisible(false);
view.getWindowProperties().getTabProperties().getHighlightedButtonProperties()
.getCloseButtonProperties().setVisible(false); .getCloseButtonProperties().setVisible(false);
DockingUtil.addWindow(view, (RootWindow) dockingArea); infoNodeView.getWindowProperties().getTabProperties().getHighlightedButtonProperties()
} else { .getCloseButtonProperties().setVisible(false);
synchronized (support) { DockingUtil.addWindow(infoNodeView, rootWindow);
support.firePropertyChange(VIEWS, null, addedView);
}
}
} }
return addedView;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment