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

some code refactoring

parent 57827189
No related branches found
No related tags found
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) { @Override
if (!views.containsKey(id)) { protected void updateViewForDockingArea(IView view, JComponent dockingArea) {
addedView = new InfoNodeView(title, icon, component, id); if ((view instanceof InfoNodeView) && (dockingArea instanceof RootWindow)) {
views.put(id, addedView); InfoNodeView infoNodeView = (InfoNodeView) view;
added = true; RootWindow rootWindow = (RootWindow) dockingArea;
} infoNodeView.getWindowProperties().getTabProperties().getNormalButtonProperties()
addedView = views.get(id); .getCloseButtonProperties().setVisible(false);
} infoNodeView.getWindowProperties().getTabProperties().getHighlightedButtonProperties()
} .getCloseButtonProperties().setVisible(false);
if ((addedView != null) && added) { DockingUtil.addWindow(infoNodeView, rootWindow);
InfoNodeView view = (InfoNodeView) addedView;
if (dockingArea instanceof RootWindow) {
view.getWindowProperties().getTabProperties().getNormalButtonProperties().getCloseButtonProperties()
.setVisible(false);
view.getWindowProperties().getTabProperties().getHighlightedButtonProperties()
.getCloseButtonProperties().setVisible(false);
DockingUtil.addWindow(view, (RootWindow) dockingArea);
} else {
synchronized (support) {
support.firePropertyChange(VIEWS, null, addedView);
}
}
} }
return addedView;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment