Extension SDK 10.1.2

oracle.ide.gallery
Class GalleryElement

java.lang.Object
  extended byoracle.ide.gallery.GalleryElement
All Implemented Interfaces:
java.lang.Comparable, Data, Displayable, Element

public final class GalleryElement
extends java.lang.Object
implements Element, java.lang.Comparable

Element for each item in the Object Gallery list.

Note that a GalleryElement is not typically created by client code. To register a new gallery element, use GalleryManager.registerGalleryElement(ElementInfo).


Constructor Summary
GalleryElement()
          Default Constructor used for beans instantiation only.
GalleryElement(Wizard wizard)
          Constructor.
GalleryElement(Wizard wizard, java.lang.String name)
          Constructor.
GalleryElement(Wizard wizard, java.lang.String name, java.lang.String[] wizardParams)
          Constructor.
GalleryElement(Wizard wizard, java.lang.String name, java.lang.String[] wizardParams, javax.swing.Icon icon)
          Constructor.
 
Method Summary
 int compareTo(java.lang.Object o)
           
 Attributes getAttributes()
          This method returns an Attributes object that encodes the attributes of the Element.
 java.util.Iterator getChildren()
          This method is part of the Element interface to provide a convenient way of getting an Iterator over any contained child Elements without having to test the object's type with the instanceof operator or having to downcast to a more specific type.
 java.lang.Object getData()
          Returns the data element associated with this Data.
 java.lang.String getDescription()
           
protected  javax.swing.Icon getDisabledIcon()
          Returns a disabled version of the GalleryElement's Icon, if one can be created; otherwise, returns the normal icon, if one exists, or null if one does not exist.
 javax.swing.Icon getGalleryIcon()
           
 javax.swing.Icon getIcon()
          Returns an Icon that can be shown in association with this Displayable.
 java.lang.String getIconFile()
           
 java.lang.String getLongLabel()
          Returns a long label that can be displayed to the user.
 java.lang.String getName()
           
 java.lang.String getResClass()
           
 java.lang.String getShortLabel()
          Returns a short label that can be displayed to the user.
 java.lang.String[] getTechnologyKeys()
           
 java.lang.String getToolTipText()
          Returns the tool tip text to show when the mouse pointer pauses over a UI component that represents this Displayable.
 boolean getUnsorted()
           
 Wizard getWizard()
           
 java.lang.String getWizardClass()
           
protected  java.lang.String getWizardDescription()
          Deprecated. Replace with getLongLabel().
protected  java.lang.String getWizardName()
           
 java.lang.String[] getWizardParameters()
           
protected  boolean isAvailable(Context context)
          Returns the enabled state of the GalleryElement in the specified Context.
 boolean mayHaveChildren()
          This method is part of the Element interface to provide a convenient way of determining whether an object may have children without having to test the object's type with the instanceof operator or having to downcast to a more specific type.
 void setDescription(java.lang.String description)
           
 void setIconFile(java.lang.String iconFile)
           
 void setName(java.lang.String name)
           
 void setResClass(java.lang.String resClass)
           
 void setTechnologyKeys(java.lang.String[] technologyKeys)
           
 void setUnsorted(boolean unsorted)
           
 void setWizardClass(java.lang.String clazz)
           
 void setWizardParameters(java.lang.String[] wizardParams)
           
 java.lang.String toString()
          Returns the Short Label displayed to a user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GalleryElement

public GalleryElement()
Default Constructor used for beans instantiation only.


GalleryElement

public GalleryElement(Wizard wizard)
Constructor.

Parameters:
wizard - - reference to the wizard

GalleryElement

public GalleryElement(Wizard wizard,
                      java.lang.String name)
Constructor.

Parameters:
wizard - - reference to the wizard
name - - optional name to use isntead of the one provided by the wizard interface

GalleryElement

public GalleryElement(Wizard wizard,
                      java.lang.String name,
                      java.lang.String[] wizardParams)
Constructor.

Parameters:
wizard - - reference to the wizard
name - - optional name to use isntead of the one provided by the wizard interface
wizardParams - - array of parameters to use for the wizard, these will mainly be used by the snippet support.

GalleryElement

public GalleryElement(Wizard wizard,
                      java.lang.String name,
                      java.lang.String[] wizardParams,
                      javax.swing.Icon icon)
Constructor.

Parameters:
wizard - - reference to the wizard
name - - optional name to use isntead of the one provided by the wizard interface
wizardParams - - array of parameters to use for the wizard, these will mainly be used by the snippet support.
icon - - Large icon to use for the Wizard, if this parameter is null, then the icon will be obtained from the Wizard
Method Detail

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String description)

getUnsorted

public boolean getUnsorted()

setUnsorted

public void setUnsorted(boolean unsorted)

setWizardClass

public void setWizardClass(java.lang.String clazz)

getWizardClass

public java.lang.String getWizardClass()

getWizard

public Wizard getWizard()

setName

public void setName(java.lang.String name)

getName

public java.lang.String getName()

getWizardParameters

public java.lang.String[] getWizardParameters()

setWizardParameters

public void setWizardParameters(java.lang.String[] wizardParams)

setIconFile

public void setIconFile(java.lang.String iconFile)

getIconFile

public java.lang.String getIconFile()

getTechnologyKeys

public java.lang.String[] getTechnologyKeys()

setTechnologyKeys

public void setTechnologyKeys(java.lang.String[] technologyKeys)

getResClass

public java.lang.String getResClass()

setResClass

public void setResClass(java.lang.String resClass)

getData

public java.lang.Object getData()
Description copied from interface: Data
Returns the data element associated with this Data. The getData() method provides a standard means for getting the data element whether or not it is same object as its Element object.

Specified by:
getData in interface Data
Returns:
the data object associated with this Data instance.

getGalleryIcon

public javax.swing.Icon getGalleryIcon()

mayHaveChildren

public boolean mayHaveChildren()
Description copied from interface: Element
This method is part of the Element interface to provide a convenient way of determining whether an object may have children without having to test the object's type with the instanceof operator or having to downcast to a more specific type.

An implementation of Element that represents a leaf in a tree structure should return false from this method. An implementation of Element that could represent a non-leaf in a tree structure should return true from this method, even if it does not currently contain any children.

Specified by:
mayHaveChildren in interface Element
Returns:
true if this Element may contain child Elements.

getChildren

public java.util.Iterator getChildren()
Description copied from interface: Element
This method is part of the Element interface to provide a convenient way of getting an Iterator over any contained child Elements without having to test the object's type with the instanceof operator or having to downcast to a more specific type.

An implementation of Element that represents a leaf in a tree structure should return null from this method. An implementation of Element that could represent a non-leaf in a tree structure should return either an Iterator over the child Elements or null if there are no children.

Specified by:
getChildren in interface Element
Returns:
an Iterator over any child Elements contained by this Element. If there are no children, null is returned.

getAttributes

public Attributes getAttributes()
Description copied from interface: Element
This method returns an Attributes object that encodes the attributes of the Element. Changing the attribute settings on the return object changes the element attributes. Subclasses should use their super class attributes object to define their own attributes. This allows subclasses to inherit their super class attributes. If a subclass does not wish to inherit attributes, they should first call getAttributes().clear() and define new attributes.

Specified by:
getAttributes in interface Element

getShortLabel

public java.lang.String getShortLabel()
Description copied from interface: Displayable
Returns a short label that can be displayed to the user. Generally, the value of the returned String is considered translatable and should therefore be placed in an appropriate resource file. When possible, the returned label should be reasonably short enough to show in the navigator or explorer windows but long enough to clearly identify and distinguish the Displayable.

Specified by:
getShortLabel in interface Displayable
Returns:
a short descriptive label of the Displayable that can be shown to the user.

getLongLabel

public java.lang.String getLongLabel()
Description copied from interface: Displayable
Returns a long label that can be displayed to the user. Generally, the value of the returned String is considered translatable and should therefore be placed in an appropriate resource file. The long label differs from the short label essentially on length. Usually the long label will only be shown on-demand and in places where horizontal space is more available. Examples are the status bar and tooltips.

Specified by:
getLongLabel in interface Displayable
Returns:
a long descriptive label of the Displayable that can be shown to the user.

getToolTipText

public java.lang.String getToolTipText()
Description copied from interface: Displayable
Returns the tool tip text to show when the mouse pointer pauses over a UI component that represents this Displayable. In many cases it may be appropriate for this method to return the same value as Displayable.getLongLabel().

Specified by:
getToolTipText in interface Displayable
Returns:
the tooltip to show when the mouse pointer pauses over a UI component that represents this Displayable.

getIcon

public javax.swing.Icon getIcon()
Description copied from interface: Displayable
Returns an Icon that can be shown in association with this Displayable. Typically the icon will be used in a tree control or list control. Therefore the icon must fit naturally within the space normally given to items within those controls. Such icons are usually 16x16 in size or, if there is a one-pixel transparent padding around the edge, 18x18 in size. It is strongly recommended that icons returned by this method be either 16x16 or 18x18 in size. If null is returned, the control may show a default icon, or it may show no icon, whichever is appropriate.

Specified by:
getIcon in interface Displayable
Returns:
the Icon that is displayed in the Object Gallery.

toString

public java.lang.String toString()
Description copied from interface: Displayable
Returns the Short Label displayed to a user. This overrides the toString method in java.lang.Object.

Implementors of the Displayable interface should override this as appropriate. The default implementation is the same as getShortLabel

Specified by:
toString in interface Displayable

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

getWizardDescription

protected java.lang.String getWizardDescription()
Deprecated. Replace with getLongLabel().


getWizardName

protected java.lang.String getWizardName()

isAvailable

protected boolean isAvailable(Context context)
Returns the enabled state of the GalleryElement in the specified Context.


getDisabledIcon

protected javax.swing.Icon getDisabledIcon()
Returns a disabled version of the GalleryElement's Icon, if one can be created; otherwise, returns the normal icon, if one exists, or null if one does not exist.

See Also:
getIcon()

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.