Skip to content
Snippets Groups Projects
Commit 5aa1064b 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 308cb80c
No related branches found
No related tags found
No related merge requests found
......@@ -22,12 +22,12 @@ import fr.soleil.docking.action.ViewAction;
*
* @author girardot
*/
public class ViewFactory implements IViewFactory {
public abstract class AbstractViewFactory implements IViewFactory {
protected final Map<Object, IView> views;
protected final PropertyChangeSupport support;
public ViewFactory() {
public AbstractViewFactory() {
super();
views = new ConcurrentHashMap<Object, IView>();
support = new PropertyChangeSupport(this);
......
package fr.soleil.docking.view;
import java.awt.Component;
import java.beans.PropertyChangeListener;
import java.io.IOException;
import java.io.ObjectInputStream;
......@@ -9,6 +10,8 @@ import java.util.List;
import java.util.prefs.Preferences;
import javax.swing.Action;
import javax.swing.Icon;
import javax.swing.JComponent;
/**
* A factory that takes care of initializing dockable components and transmitting models.
......@@ -75,6 +78,19 @@ public interface IViewFactory {
public IView addView(IView view);
/**
* Creates an {@link IView} for a given {@link Component}, adds it in the list of views, and
* tries to put it in a docking area
*
* @param title The {@link IView} title
* @param icon The {@link IView} {@link Icon}
* @param component The concerned {@link Component}
* @param id The {@link IView} id
* @param dockingArea The docking area
* @return The {@link IView} if it was successfully created and added, <code>null</code> otherwise
*/
public IView addView(String title, Icon icon, Component component, Object id, JComponent dockingArea);
public boolean removeView(IView view);
/**
......
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