com.ibm.designer.domino.xsp.api.panels
Class AbstractPanelsFactory

java.lang.Object
  extended by com.ibm.designer.domino.xsp.api.panels.AbstractPanelsFactory
All Implemented Interfaces:
IPanelsFactory

public abstract class AbstractPanelsFactory
extends java.lang.Object
implements IPanelsFactory

An abstract implementation of com.ibm.designer.domino.xsp.api.panels.IPanelsFactory. It is advised that clients extend this class rather than directly implementing the interface. Clients who extend this factory only need to provide code that returns a Class corresponding to a given id.
This abstract class takes care of creating an XPagesAVPage based on the returned Class (which must be an instance of Composite).


Constructor Summary
AbstractPanelsFactory()
          Creates a new instance of this class
 
Method Summary
 XPagesAVPage createPage(com.ibm.etools.attrview.sdk.AVFolder folder, XPagesPanelDescriptor xfacesPanelDescriptor)
          Creates a new properties page based on the description provided via the com.ibm.designer.domino.xsp.editor.component extension point.
 org.eclipse.swt.widgets.Composite createPanelContents(org.eclipse.swt.widgets.Composite parent, java.lang.Class<? extends org.eclipse.swt.widgets.Composite> controlClass, XPagesPanelDescriptor xfacesPanelDescriptor, IPanelExtraData data)
          Creates the contents of the XPagesAVPage.
protected abstract  java.lang.Class<? extends org.eclipse.swt.widgets.Composite> getPanelControlClass(XPagesPanelDescriptor xfacesPanelDescriptor)
          This method is called during the creation of the XPagesAVPage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPanelsFactory

public AbstractPanelsFactory()
Creates a new instance of this class

Method Detail

createPage

public XPagesAVPage createPage(com.ibm.etools.attrview.sdk.AVFolder folder,
                               XPagesPanelDescriptor xfacesPanelDescriptor)
Description copied from interface: IPanelsFactory
Creates a new properties page based on the description provided via the com.ibm.designer.domino.xsp.editor.component extension point.

Specified by:
createPage in interface IPanelsFactory
Parameters:
folder - the parent attributes view folder
xfacesPanelDescriptor - a description of the page that is to be created
Returns:
returns a new attributes view page based on the parameters

createPanelContents

public org.eclipse.swt.widgets.Composite createPanelContents(org.eclipse.swt.widgets.Composite parent,
                                                             java.lang.Class<? extends org.eclipse.swt.widgets.Composite> controlClass,
                                                             XPagesPanelDescriptor xfacesPanelDescriptor,
                                                             IPanelExtraData data)
                                                      throws java.lang.SecurityException,
                                                             java.lang.NoSuchMethodException,
                                                             java.lang.IllegalArgumentException,
                                                             java.lang.InstantiationException,
                                                             java.lang.IllegalAccessException,
                                                             java.lang.reflect.InvocationTargetException
Description copied from interface: IPanelsFactory
Creates the contents of the XPagesAVPage.

Specified by:
createPanelContents in interface IPanelsFactory
Parameters:
parent - the parent composite
controlClass - the Class that is to display in the XPagesAVPage
xfacesPanelDescriptor - the IPanelExtraData if available (may be null)
Returns:
returns the Composite that is to appear in the XPagesAVPage
Throws:
java.lang.SecurityException
java.lang.NoSuchMethodException
java.lang.IllegalArgumentException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

getPanelControlClass

protected abstract java.lang.Class<? extends org.eclipse.swt.widgets.Composite> getPanelControlClass(XPagesPanelDescriptor xfacesPanelDescriptor)
This method is called during the creation of the XPagesAVPage. The method is passed a description of the desired XPagesAVPage. Typically this method will identify the XPagesAVPage by its id, and return a Class that extends Composite based on the id.

e.g.
          protected Class getPanelControlClass(XPagesPanelDescriptor xpagesPanelDescriptor) {

                        String id = xpagesPanelDescriptor.getId();
                        if ("format.panel.id".equals(id)) {
                                return FormatPanel.class;
                        }
                        else if("...".equals(id)){......
                }
 

Parameters:
xfacesPanelDescriptor - an object that describes the XPagesAVPage
Returns:
returns an object that extends Composite and contains any widgets necessary to perform attribute manipulations