/*
* Copyright 2001-2006 C:1 Financial Services GmbH
*
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License Version 2.1, as published by the Free Software Foundation.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
*/
package de.finix.contelligent.client.gui;
import java.util.List;
import java.util.Map;
import javax.swing.ImageIcon;
import de.finix.contelligent.client.base.ContelligentComponent;
import de.finix.contelligent.client.base.category.ContelligentCategory;
import de.finix.contelligent.client.base.resource.ContelligentResource;
/**
* Implement this interface if you want to provide a GUI for a special component
* type. Use this GUI to get associated editor, renderer and view
*/
public interface GUI {
final static int CONTENT = 0;
final static int TEMPLATE = 1;
/**
* The <code>DEFAULT</code> GUI should provide a GUI that fits into a
* large editor pane.
*
*/
final static int DEFAULT = 0;
/**
* The <code>TABLE</code> GUI should provide a GUI that can live inside a
* table.
*
*/
final static int TABLE = 1;
/**
* init can be used to do initializations as it is called when a new GUI is
* constructed
*/
public void init();
/**
* This method can be called to determine if this gui hides the
* subcomponents of the component that will be the edit root. A gui for
* large containers for example hides the subcomponents by providing a
* search form.
*
* @return a <code>boolean</code> value that indicates wether
* subcomponents should be hidden.
*/
public boolean hidesSubcomponents();
/**
* Return an editor for this type of editing if supported, otherwise throw
* an exception.
*
* @param type
* specifies what kind of context the editor is for:
* {@link #DEFAULT} or {@link #TABLE}
*/
public ComponentEditor getEditor(int type) throws UnsupportedGUIException;
/**
* Return a renderer for this type of rendering if supported, otherwise
* throw an exception.
*
* @param type
* specifies what kind of context the renderer is for:
* {@link #DEFAULT} or {@link #TABLE}
*/
public ComponentRenderer getRenderer(int type) throws UnsupportedGUIException;
/**
* Check whether this type of renderering and editing is supported
*
* @param type
* specifies what kind of context the renderer is for:
* {@link #DEFAULT} or {@link #TABLE}
*/
public boolean isSupported(int type);
public void setView(View view);
public View getView();
public void setConfiguration(String configuration);
public String getConfiguration();
public GUIConfigurationEditor getGUIConfigurationEditor();
public void setComponent(ContelligentComponent component);
public ContelligentComponent getComponent();
/**
* Returns the name of this gui.
*/
public String getName();
/**
* Returns the icon of this gui.
*/
public ImageIcon getIcon();
// FIXME: All category sensitive stuff should be removed or moved to a
// category sensitive gui / rule-gui ?!?
public boolean isCategorySensitive();
public void setResourceCategoryMap(Map categoryMap);
public Map getResourceCategoryMap();
public void setResourceMode(int resourceMode); // TEMPLATE or CONTENT
public int getResourceMode();
public boolean isResourceDefined();
public boolean isResourceInherited();
public void setResource(ContelligentResource resource);
public ContelligentResource getResource();
public Map getResourceMap();
public String getResourceIdentifier();
public List getDefaultedCategoryNames();
public String getFallbackResourceIdentifier();
public boolean isResourceSupported();
public String getUnsupportedCategory();
public String getUnsupportedCategoryValue();
public List<ContelligentCategory> getSensitiveCategories();
public void setCategories(List<ContelligentCategory> categories);
}
|