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

IViewFactory can customize view icons, title, etc...

ViewFactory becomes AbstractViewFactory
parent 35d06f56
No related branches found
No related tags found
No related merge requests found
package fr.soleil.docking.infonode; package fr.soleil.docking.infonode.view;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
......
package fr.soleil.docking.infonode.view;
import java.awt.Component;
import javax.swing.Icon;
import javax.swing.JComponent;
import net.infonode.docking.RootWindow;
import net.infonode.docking.util.DockingUtil;
import fr.soleil.docking.view.AbstractViewFactory;
import fr.soleil.docking.view.IView;
/**
* InfoNode implementation of {@link AbstractViewFactory}
*
* @author girardot
*/
public class InfoNodeViewFactory extends AbstractViewFactory {
public InfoNodeViewFactory() {
super();
}
@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);
}
}
}
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