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 {
}
@Override
public IView addView(String title, Icon icon, Component component, Object id, JComponent dockingArea) {
IView addedView = null;
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);
}
}
if ((addedView != null) && added) {
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);
}
}
protected IView createView(String title, Icon icon, Component component, Object id) {
return new InfoNodeView(title, icon, component, id);
}
@Override
protected void updateViewForDockingArea(IView view, JComponent dockingArea) {
if ((view instanceof InfoNodeView) && (dockingArea instanceof RootWindow)) {
InfoNodeView infoNodeView = (InfoNodeView) view;
RootWindow rootWindow = (RootWindow) dockingArea;
infoNodeView.getWindowProperties().getTabProperties().getNormalButtonProperties()
.getCloseButtonProperties().setVisible(false);
infoNodeView.getWindowProperties().getTabProperties().getHighlightedButtonProperties()
.getCloseButtonProperties().setVisible(false);
DockingUtil.addWindow(infoNodeView, rootWindow);
}
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