com.ibm.designer.domino.ide.resources.extensions.util
Class DesignerDELookup

java.lang.Object
  extended by com.ibm.commons.iloader.node.lookups.api.AbstractLookup
      extended by com.ibm.designer.domino.ide.resources.extensions.util.DesignerDELookup
All Implemented Interfaces:
ILookup

public class DesignerDELookup
extends com.ibm.commons.iloader.node.lookups.api.AbstractLookup

A lookup to be used in conjunction with combo boxes. The lookup with provide an array of Design Elements (DesignerDesignElement) in the current application. A number of utility methods are provided to return Lookups for predefined sets of design elements.


Nested Class Summary
static interface DesignerDELookup.DesignerDesignElementFilter
          A filter that may be used to filter the results of a lookup
 
Field Summary
protected  DesignerDesignElement[] designElements
           
protected  DesignerProject designerProject
           
protected  DesignerDELookup.DesignerDesignElementFilter filter
           
protected  int folderCount
           
protected  com.ibm.designer.prj.resources.commons.ICommonDesignerProjectChangeListener projectChangeListener
           
protected  java.lang.String typeId
           
 
Constructor Summary
DesignerDELookup(DesignerProject designerProject, java.lang.String typeId)
          Creates a new instance of this class.
DesignerDELookup(DesignerProject designerProject, java.lang.String typeId, boolean showExtension)
          Creates a new instance of this class.
DesignerDELookup(DesignerProject designerProject, java.lang.String typeId, boolean showExtension, DesignerDELookup.DesignerDesignElementFilter filter)
          Creates a new instance of this class.
 
Method Summary
protected  void addNotify()
           
 java.lang.String getCode(int index)
          Return the code or model value for this index.
 DesignerDesignElement getDesignElement(int index)
          Returns the design element at a particular index.
protected  DesignerDesignElement[] getDesignElements()
          Returns the design elements that correspond to the design element type that was passed in via the constructor.
static DesignerDELookup getFoldersLookup(DesignerProject project)
          Utility method.
static DesignerDELookup getFormsLookup(DesignerProject project)
          Utility method.
static DesignerDELookup getImagesLookup(DesignerProject project)
          Utility method.
 java.lang.String getLabel(int index)
          Return the label displayed to the user for this index.
protected  int getNavigatorFolderCount()
          Returns the number of folders in the path to the design element
static DesignerDELookup getStyleSheetsLookup(DesignerProject project)
          Utility method.
static DesignerDELookup getThemesLookup(DesignerProject project)
          Utility method.
static DesignerDELookup getViewsLookup(DesignerProject project)
          Utility method.
static DesignerDELookup getXPagesLookup(DesignerProject project)
          Utility method.
protected  void notifyLookupChanged()
           
protected  void removeNotify()
           
protected  void setDesignElements(DesignerDesignElement[] elements)
          Sets the design elements which are to be returned by this lookup.
 int size()
          Return the number of items in this lookup.
protected  void updateDesignElements()
          Regreshes the list of design elements
 
Methods inherited from class com.ibm.commons.iloader.node.lookups.api.AbstractLookup
addLookupListener, getImage, getLabelFromCode, getLabelFromCodeIgnoreCase, removeLookupListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

designElements

protected DesignerDesignElement[] designElements

designerProject

protected DesignerProject designerProject

typeId

protected java.lang.String typeId

filter

protected DesignerDELookup.DesignerDesignElementFilter filter

folderCount

protected int folderCount

projectChangeListener

protected com.ibm.designer.prj.resources.commons.ICommonDesignerProjectChangeListener projectChangeListener
Constructor Detail

DesignerDELookup

public DesignerDELookup(DesignerProject designerProject,
                        java.lang.String typeId)
Creates a new instance of this class.

Parameters:
designerProject - the DesignerProject that represents the current Database
typeId - the id of class of design element the lookup is to contain.
See Also:
DesignerProject, IMetaModelConstants

DesignerDELookup

public DesignerDELookup(DesignerProject designerProject,
                        java.lang.String typeId,
                        boolean showExtension)
Creates a new instance of this class.

Parameters:
designerProject - the DesignerProject that represents the current Database
typeId - the id of class of design element the lookup is to contain.
showExtension - a flag which determines whether the lookup should display the design element's file extension
See Also:
DesignerProject, IMetaModelConstants

DesignerDELookup

public DesignerDELookup(DesignerProject designerProject,
                        java.lang.String typeId,
                        boolean showExtension,
                        DesignerDELookup.DesignerDesignElementFilter filter)
Creates a new instance of this class.

Parameters:
designerProject - the DesignerProject that represents the current Database
typeId - the id of class of design element the lookup is to contain.
showExtension - a flag which determines whether the lookup should display the design element's file extension
filter - a filter that is used by the lookup to filter the contents of the lookup
See Also:
DesignerProject, IMetaModelConstants
Method Detail

addNotify

protected void addNotify()
Overrides:
addNotify in class com.ibm.commons.iloader.node.lookups.api.AbstractLookup

removeNotify

protected void removeNotify()
Overrides:
removeNotify in class com.ibm.commons.iloader.node.lookups.api.AbstractLookup

getDesignElements

protected DesignerDesignElement[] getDesignElements()
Returns the design elements that correspond to the design element type that was passed in via the constructor.

Returns:
an array of design elements

setDesignElements

protected void setDesignElements(DesignerDesignElement[] elements)
Sets the design elements which are to be returned by this lookup.

Parameters:
elements - an array of design elements

updateDesignElements

protected void updateDesignElements()
Regreshes the list of design elements


size

public int size()
Description copied from interface: ILookup
Return the number of items in this lookup.


getCode

public java.lang.String getCode(int index)
Description copied from interface: ILookup
Return the code or model value for this index.


getDesignElement

public DesignerDesignElement getDesignElement(int index)
Returns the design element at a particular index. May return null if the index is out of bounds.

Parameters:
index - the index of the design element to be returned
Returns:
a design element corresponding to the given index

getLabel

public java.lang.String getLabel(int index)
Description copied from interface: ILookup
Return the label displayed to the user for this index.


getNavigatorFolderCount

protected int getNavigatorFolderCount()
Returns the number of folders in the path to the design element

Returns:
a positive integer representing the number of folders that must be traversed in order to get the to name of the design element

notifyLookupChanged

protected void notifyLookupChanged()
Overrides:
notifyLookupChanged in class com.ibm.commons.iloader.node.lookups.api.AbstractLookup

getXPagesLookup

public static DesignerDELookup getXPagesLookup(DesignerProject project)
Utility method. Returns all of the XPage design elements in the database.

Parameters:
project - the DesignerProject representing the current database
Returns:
a lookup containing all of the XPages in the project

getFormsLookup

public static DesignerDELookup getFormsLookup(DesignerProject project)
Utility method. Returns all of the Form design elements in the database.

Parameters:
project - the DesignerProject representing the current database
Returns:
a lookup containing all of the Forms in the project

getViewsLookup

public static DesignerDELookup getViewsLookup(DesignerProject project)
Utility method. Returns all of the View design elements in the database.

Parameters:
project - the DesignerProject representing the current database
Returns:
a lookup containing all of the Views in the project

getStyleSheetsLookup

public static DesignerDELookup getStyleSheetsLookup(DesignerProject project)
Utility method. Returns all of the Style Sheet design elements in the database.

Parameters:
project - the DesignerProject representing the current database
Returns:
a lookup containing all of the Style Sheets in the project

getThemesLookup

public static DesignerDELookup getThemesLookup(DesignerProject project)
Utility method. Returns all of the Theme design elements in the database.

Parameters:
project - the DesignerProject representing the current database
Returns:
a lookup containing all of the Themes in the project

getImagesLookup

public static DesignerDELookup getImagesLookup(DesignerProject project)
Utility method. Returns all of the Image design elements in the database.

Parameters:
project - the DesignerProject representing the current database
Returns:
a lookup containing all of the Images in the project

getFoldersLookup

public static DesignerDELookup getFoldersLookup(DesignerProject project)
Utility method. Returns all of the Folder design elements in the database.

Parameters:
project - the DesignerProject representing the current database
Returns:
a lookup containing all of the Folder in the project