Class com.symantec.itools.vcafe.openapi.VisualObject
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.symantec.itools.vcafe.openapi.VisualObject

Object
   |
   +----com.symantec.itools.vcafe.openapi.VisualObject

public abstract class VisualObject
extends Object
implements Cloneable
The API used to represent and access an object that can be visually manipulated in the Visual Cafe environment. Examples of this include java objects (classes, Components), and non-java objects (folders, project templates, etc). Each VisualObject has a set of VisualProperties. A plug-in can obtain a list, or library, of these objects from a VisualProject by using the getObjectLibrary method. A plug-in can use the methods in the VisualObject class to update properties and other attribues. The implementation of all of VisualObject's abstract methods first calls checkValidity(). Any method could therefore throw an InvalidVisualObjectException. This exception extends RuntimeException, so doesn't have to be explicity declared or caught. A VisualObject can become invalid if it is removed from its project, or its project is closed, and the corresponding VisualObjectListener message is ignored, for example.

Version:
1.0
Author:
Symantec Internet Tools Division
Since:
VCafe 3.0
See Also:
getObjectLibrary, getComponentLibrary, VisualRepository, InvalidVisualObjectException

Variable Index

 o COPY_OBJECT_OPERATION
An insert "insertionOperation" value indicating a copy of the object will inserted.
 o INSERT_AT_END
An insert "before" value indicating a copy of the object will be appended at the end of the parent object's list of children.
 o MOVE_OBJECT_OPERATION
An insert "insertionOperation" value indicating the object will be moved from its current location and inserted in the new location.
 o VPO_ADDED
 o VPO_ADDED_TO_TOOLBAR
Flag indicating this object is displayed on the toolbar.
 o VPO_CONTAINER_ONLY
 o VPO_CUSTOMIZER_HIDDENSTATE
 o VPO_CUSTOM_VIEW
 o VPO_DESIGN_TIME_ONLY
 o VPO_ERROR
 o VPO_INVISIBLE
Flag indicating this object is "invisible".
 o VPO_IS_ARRAY
 o VPO_IS_DEFAULT
 o VPO_NOINITDECLCONNTROLS
 o VPO_NO_NAME
 o VPO_PARSER_ONLY
 o VPO_PROJ_TEMPL_FOLDER
Flag indicating this object is a project template or folder.
 o VPO_ROOT_OBJECT
Flag indicating this object is a "root obejct".
 o VPO_SERIALIZABLE
Flag indicating this object is serializable
 o VPO_STARTER
 o VPO_USER_OBJECT

Constructor Index

 o com.symantec.itools.vcafe.openapi.VisualObject()

Method Index

 o addVisualObjectListener(VisualObjectListener, boolean)
Add a VisualObjectListener to this VisualObject.
 o canInsert(VisualObject)
Determines whether an object can be inserted as a component of this object.
 o canPasteClipboardContents()
Determines if the contents of Visual Cafe's clipboard can be pasted onto/into this VisualObject.
 o checkValidity()
Determines if this VisualObject corresponds to a valid object in its VisualProject.
 o clone()
Performs a deep copy of this VisualObject and all its descendents.
 o copyToClipboard()
Copies this VisualObject to Visual Cafe's clipboard.
 o copyToClipboard(String)
Copies this VisualObject to Visual Cafe's clipboard.
 o delete()
Deletes this visual object.
 o enumerateProperties()
Enumerates the top level, visible VisualProperties.
 o findChildByName(String)
Gets the child object with matching name, searching recursively.
 o findProperty(String)
Gets a VisualProperty given its internal name.
 o getClassName()
Gets the full java class name of this object, e.g.
 o getClassObject()
Gets the java.lang.Class object for this VisualObject's type.
 o getCustomizerClassName()
Gets the name of this object's customizer class.
 o getDTClassObject()
Gets the design-time reflection's DTClass object for this VisualObject's type.
 o getDefaultName()
Gets the default name of this object.
 o getDefaultProperty()
Gets this object's default VisualProperty.
 o getDescription()
Gets the description of this object.
 o getFirstChild()
Gets the first child (component) of the object.
 o getFirstProperty()
Gets this object's the first visible VisualProperty.
 o getFlags()
Obtains the flags of this object.
 o getIcon(int)
Gets an Image for an icon that represents this VisualObject.
 o getJarFile()
Gets the JAR file containing the code for this bean.
 o getJarName()
Gets the name of the JAR file containing the code for this bean.
 o getName()
Gets the instance name of this object, e.g., "checkbox1".
 o getNumProperties()
Determines the number of VisualProperties this VisualObject has.
 o getObjectID()
Gets this VisualObject's unique numeric ID within its VisualRepository.
 o getPackageName()
Gets the package name of this object, e.g., "java.awt".
 o getParent()
Gets the parent (container) of the object.
 o getProjectFile()
Gets the ProjectFile that contains this VisualObject.
 o getProjectFileID()
Gets the id of the ProjectFile that contains this VisualObject.
 o getProperties()
Gets all of the VisualProperties of this object.
 o getProperty(int)
Gets the VisualProperty with the specified zero-based index.
 o getRootObject()
Gets this object's root object.
 o getShortClassName()
Gets the short java class name of this object, e.g.
 o getSibling()
Gets this object's next sibling.
 o getSuperClassName()
Gets the java class name of this object's superclass.
 o getVisualProject()
Gets the VisualProject that this VisualObject belongs to.
 o getVisualRepository()
Gets the VisualRepository that contains this object.
 o insert(VisualObject, VisualObject, int)
Inserts the object as a child of this visual object and before the specified visual object.
 o instantiate(PropertyInstanceGetter)
Creates a new Object that represents this VisualObject, with all of the properties set appropriately.
 o invokeEditor()
Opens an appropriate editor for this VisualObject.
 o invokeSourceEditor()
Opens a source editor for this VisualObject's source file.
 o isInstanceOf(String)
Determineswhether this object is an instance of the given class.
 o isInvisible()
Determines whether this object is "invisible", i.e., should be ignored.
 o isJavaObject()
Determines whether this object represents a java object (as opposed to a folder, project template, etc).
 o isRootObject()
Determines whether this object is a "root object".
 o isSameOrChild(VisualObject)
Detemines whether this object is the same as or a parent of the given object.
 o isValid()
Determines if this VisualObject corresponds to a valid object in its VisualProject.
 o removeVisualObjectListener(VisualObjectListener)
Remove a listener from this visual object.
 o setActiveObject()
Sets this VisualObject as active in the Property List of Visual Cafe.
 o setActiveObject(boolean)
Sets this VisualObject as active in the Property List of Visual Cafe.
 o toString()
Gets a String that represents this object.
 o updateInstanceProperty(int, Object, PropertyInstanceGetter)
Updates the value of the Java object's property at the specified index to match the value of the corresponding VisualProperty in this VisualObject.

Variables

 o COPY_OBJECT_OPERATION
public static final int COPY_OBJECT_OPERATION
An insert "insertionOperation" value indicating a copy of the object will inserted.

See Also:
insert
 o INSERT_AT_END
public static final com.symantec.itools.vcafe.openapi.VisualObject INSERT_AT_END
An insert "before" value indicating a copy of the object will be appended at the end of the parent object's list of children.

See Also:
insert
 o MOVE_OBJECT_OPERATION
public static final int MOVE_OBJECT_OPERATION
An insert "insertionOperation" value indicating the object will be moved from its current location and inserted in the new location.

See Also:
insert
 o VPO_ADDED
public static final int VPO_ADDED
 o VPO_ADDED_TO_TOOLBAR
public static final int VPO_ADDED_TO_TOOLBAR
Flag indicating this object is displayed on the toolbar.

 o VPO_CONTAINER_ONLY
public static final int VPO_CONTAINER_ONLY
 o VPO_CUSTOMIZER_HIDDENSTATE
public static final int VPO_CUSTOMIZER_HIDDENSTATE
 o VPO_CUSTOM_VIEW
public static final int VPO_CUSTOM_VIEW
 o VPO_DESIGN_TIME_ONLY
public static final int VPO_DESIGN_TIME_ONLY
 o VPO_ERROR
public static final int VPO_ERROR
 o VPO_INVISIBLE
public static final int VPO_INVISIBLE
Flag indicating this object is "invisible". An invisble object is one that doesn't paint to the screen at runtime.

See Also:
isInvisible
 o VPO_IS_ARRAY
public static final int VPO_IS_ARRAY
 o VPO_IS_DEFAULT
public static final int VPO_IS_DEFAULT
 o VPO_NOINITDECLCONNTROLS
public static final int VPO_NOINITDECLCONNTROLS
 o VPO_NO_NAME
public static final int VPO_NO_NAME
 o VPO_PARSER_ONLY
public static final int VPO_PARSER_ONLY
 o VPO_PROJ_TEMPL_FOLDER
public static final int VPO_PROJ_TEMPL_FOLDER
Flag indicating this object is a project template or folder.

See Also:
getProjectTemplates
 o VPO_ROOT_OBJECT
public static final int VPO_ROOT_OBJECT
Flag indicating this object is a "root obejct". A root object appears at the top level in project windows and has associated java source code.

See Also:
isRootObject
 o VPO_SERIALIZABLE
public static final int VPO_SERIALIZABLE
Flag indicating this object is serializable

 o VPO_STARTER
public static final int VPO_STARTER
 o VPO_USER_OBJECT
public static final int VPO_USER_OBJECT

Constructors

 o VisualObject
public VisualObject()

Methods

 o addVisualObjectListener
public abstract void addVisualObjectListener(VisualObjectListener listener,
                                             boolean children)
Add a VisualObjectListener to this VisualObject. All changes to this VisualObject (and optionally to its children) are broadcast to the listeners registered with it.

Parameters:
listener - the object that receives notifications of changes to the VisualObject.
children - true if the listener wishes to receive notifications of changes to this VisualObject's children as well.
See Also:
VisualObjectListener, removeVisualObjectListener, removeVisualObjectListener
 o canInsert
public abstract boolean canInsert(VisualObject object)
Determines whether an object can be inserted as a component of this object.

Parameters:
object - object to be tested.
Returns:
true if this object can contain argument object, false otherwise.
See Also:
insert
 o canPasteClipboardContents
public abstract boolean canPasteClipboardContents()
Determines if the contents of Visual Cafe's clipboard can be pasted onto/into this VisualObject.

Returns:
false if the clipboard doesn't contain VisualObjects, or this VisualObject cannot accept the VisualObjects on the clipboard.
See Also:
VisualCafeClipboard, TransferableVisualObjects
 o checkValidity
public void checkValidity() throws InvalidVisualObjectException
Determines if this VisualObject corresponds to a valid object in its VisualProject. isValid() is similar, but returns a boolean value indicating validity instead of throwing an InvalidVisualObjectException if the validity check fails. Note that the implementation of all of VisualObject's abstract methods first call checkValidity(). Any method could therefore throw an InvalidVisualObjectException.

Throws: InvalidVisualObjectException
when using a VisualObject has been removed from its project, or its project has been closed, for example.
See Also:
isValid
 o clone
public abstract java.lang.Object clone()
Performs a deep copy of this VisualObject and all its descendents. The new Object is not added to the project.

Returns:
a new copy of this VisualObject.
Overrides:
clone in class Object
 o copyToClipboard
public abstract void copyToClipboard()
Copies this VisualObject to Visual Cafe's clipboard. The VisualObject's toString() representation is used as the StringSelection text.

See Also:
VisualCafeClipboard, TransferableVisualObjects
 o copyToClipboard
public abstract void copyToClipboard(String textValue)
Copies this VisualObject to Visual Cafe's clipboard.

Parameters:
textValue - the String to be used as the StringSelection text
See Also:
VisualCafeClipboard, TransferableVisualObjects
 o delete
public abstract void delete()
Deletes this visual object.

This visual object is delinked from the parent/child/sibling hierarchy, removed from its project and discarded.

 o enumerateProperties
public abstract java.util.Enumeration enumerateProperties()
Enumerates the top level, visible VisualProperties. The Enumeration elements are VisualProperty objects. An Enumeration is returned even if this VisualObject has no properties.

Returns:
an Enumeration of VisualProperty objects.
 o findChildByName
public abstract com.symantec.itools.vcafe.openapi.VisualObject findChildByName(String name)
Gets the child object with matching name, searching recursively.

Parameters:
name - the name of the child to find.
Returns:
the child, or null if none.
 o findProperty
public abstract com.symantec.itools.vcafe.openapi.VisualProperty findProperty(String internalPropertyName)
Gets a VisualProperty given its internal name. Internal names typically begin with "ipn". For example, the internal property name for JMenuItem.text is "ipntext".

Parameters:
internalPropertyName - the locale-independent property name.
Returns:
the VisualProperty or null if there is no property with that name.
 o getClassName
public abstract java.lang.String getClassName()
Gets the full java class name of this object, e.g. returns "java.awt.Checkbox".

Returns:
this object's full java class name.
 o getClassObject
public abstract java.lang.Class getClassObject() throws ClassNotFoundException
Gets the java.lang.Class object for this VisualObject's type.

Returns:
the Class of this object.
 o getCustomizerClassName
public abstract java.lang.String getCustomizerClassName()
Gets the name of this object's customizer class. A customizer provides the GUI used to customize this VisualObject. It is a type of Component.

Returns:
the name of this object's customizer class.
 o getDTClassObject
public abstract com.symantec.itools.vcafe.openapi.dtreflect.DTClass getDTClassObject()
Gets the design-time reflection's DTClass object for this VisualObject's type. The Design-Time Reflection package (com.symantec.itools.vcafe.openapi.dtreflect) provides services analogous to the Java reflection API, but is based upon parse information gathered by Visual Cafe. Thus, classes reflected upon need not be compiled or in a compilable state.

Returns:
the DTClass of this object.
See Also:
DTClass
 o getDefaultName
public abstract java.lang.String getDefaultName()
Gets the default name of this object. Usually the same as getShortClassName(), but some components describe two types of objects. For example, java.awt.Checkbox can return either "Checkbox" or "RadioButton".

Returns:
this object's default name.
 o getDefaultProperty
public abstract com.symantec.itools.vcafe.openapi.VisualProperty getDefaultProperty()
Gets this object's default VisualProperty. This is the property that will be selected in the property list by default.

Returns:
the VisualProperty, or null if none.
 o getDescription
public abstract java.lang.String getDescription()
Gets the description of this object.

Returns:
the description of the visual object.
 o getFirstChild
public abstract com.symantec.itools.vcafe.openapi.VisualObject getFirstChild()
Gets the first child (component) of the object.

To traverse a visual object hierarchy downwards, use getFirstChild() followed by getSibling(), recursively.

Returns:
the first child object or null if no children.
See Also:
getSibling
 o getFirstProperty
public abstract com.symantec.itools.vcafe.openapi.VisualProperty getFirstProperty()
Gets this object's the first visible VisualProperty.

Returns:
the first visible VisualProperty, or null if none.
See Also:
getSibling, getFirstChild
 o getFlags
public abstract int getFlags()
Obtains the flags of this object.

Returns:
an integer which combines all this object's flags.
 o getIcon
public abstract java.awt.Image getIcon(int iconKind)
Gets an Image for an icon that represents this VisualObject.

Parameters:
iconKind - the kind of icon to return. Can be one of the four kinds in java.beans.BeanInfo: ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, or ICON_MONO_32x32.
Returns:
an Image for this VisualObject.
 o getJarFile
public abstract java.io.File getJarFile()
Gets the JAR file containing the code for this bean.

Returns:
the JAR file.
 o getJarName
public abstract java.lang.String getJarName()
Gets the name of the JAR file containing the code for this bean.

Returns:
the JAR filename.
 o getName
public abstract java.lang.String getName()
Gets the instance name of this object, e.g., "checkbox1".

Returns:
the instance name.
 o getNumProperties
public abstract int getNumProperties()
Determines the number of VisualProperties this VisualObject has.

Returns:
the number of VisualProperties, or 0 if this VisualObject has no properties.
See Also:
getProperty, getProperties
 o getObjectID
public abstract int getObjectID()
Gets this VisualObject's unique numeric ID within its VisualRepository. The ID can be zero if the the object is not in a VisualRepository. This can be the case if a new VisualObject has just been created an not yet inserted.

Returns:
a unique numeric ID within its VisualRepository, or zero.
 o getPackageName
public abstract java.lang.String getPackageName()
Gets the package name of this object, e.g., "java.awt".

Returns:
the package name.
 o getParent
public abstract com.symantec.itools.vcafe.openapi.VisualObject getParent()
Gets the parent (container) of the object.

To traverse a visual object heirarchy upwards, use getParent() recursively until isRootObject() is true.

The parent of a root object has no visual significance.

Returns:
parent of this visual object or null if no parent.
 o getProjectFile
public abstract com.symantec.itools.vcafe.openapi.ProjectFile getProjectFile()
Gets the ProjectFile that contains this VisualObject.

Returns:
the ProjectFile that contains this object, or null if this object is in the Component Library.
 o getProjectFileID
public abstract int getProjectFileID()
Gets the id of the ProjectFile that contains this VisualObject.

Returns:
the id of ProjectFile that contains this object, or -1 if this object is in the Component Library.
 o getProperties
public abstract com.symantec.itools.vcafe.openapi.VisualProperty[] getProperties()
Gets all of the VisualProperties of this object. If none exist then a zero-length array is returned.

Returns:
an array of VisualProperty objects.
See Also:
getProperty, getNumProperties
 o getProperty
public abstract com.symantec.itools.vcafe.openapi.VisualProperty getProperty(int index)
Gets the VisualProperty with the specified zero-based index.

Parameters:
index - the specified zero-based index.
Returns:
the specified VisualProperty object.
Throws: ArrayIndexOutOfBoundsException
if the index is out of range.
See Also:
getProperties, getNumProperties
 o getRootObject
public abstract com.symantec.itools.vcafe.openapi.VisualObject getRootObject()
Gets this object's root object. The returned object is either this object itself or the first of its parents for which isRootObject() returns true.

Returns:
the root object, or null if none is found.
 o getShortClassName
public abstract java.lang.String getShortClassName()
Gets the short java class name of this object, e.g. returns "Checkbox".

Returns:
this object's short java class name.
 o getSibling
public abstract com.symantec.itools.vcafe.openapi.VisualObject getSibling()
Gets this object's next sibling. Siblings have the same parent object.

Returns:
the next sibling of this visual object or null if none.
 o getSuperClassName
public abstract java.lang.String getSuperClassName()
Gets the java class name of this object's superclass.

Returns:
this object's superclass's name.
 o getVisualProject
public abstract com.symantec.itools.vcafe.openapi.VisualProject getVisualProject()
Gets the VisualProject that this VisualObject belongs to.

Returns:
the VisualProject that contains this object, or null if this object is in the Component Library.
 o getVisualRepository
public abstract com.symantec.itools.vcafe.openapi.VisualRepository getVisualRepository()
Gets the VisualRepository that contains this object. This can be a project's Object Library, the Component Library, or null if the object hasn't been inserted.

Returns:
a VisualRepository identifying the Component Library, a VisualProject's Object Library, or null.
 o insert
public abstract boolean insert(VisualObject object,
                               VisualObject before,
                               int insertOperation)
Inserts the object as a child of this visual object and before the specified visual object.

Parameters:
object - object to be inserted.
before - object that will follow inserted object in sibling list. if INSERT_AD_END, the object is inserted at the end.
insertOperation - MOVE_OBJECT_OPERATION - to move the object from its current location and insert it at the new location, or COPY_OBJECT_OPERATION - to insert a copy of the object at the new location.
Returns:
true if the object was successfully moved/copied, false if the operation failed.
See Also:
canInsert
 o instantiate
public abstract java.lang.Object instantiate(PropertyInstanceGetter thePropertyInstanceGetter) throws ClassNotFoundException, InstantiationException, IllegalAccessException
Creates a new Object that represents this VisualObject, with all of the properties set appropriately. For example, if this VisualObject describes a java.awt.Checkbox, a new checkbox is created and returned.

Parameters:
thePropertyInstanceGetter - an object that is used to determine Object Reference Properties
Returns:
a newly created Object defined by this VisualObject
 o invokeEditor
public abstract void invokeEditor()
Opens an appropriate editor for this VisualObject.

 o invokeSourceEditor
public abstract void invokeSourceEditor()
Opens a source editor for this VisualObject's source file.

 o isInstanceOf
public abstract boolean isInstanceOf(String className)
Determineswhether this object is an instance of the given class.

Parameters:
className - a full class name
Returns:
true if this object is an instance of className, false otherwise.
 o isInvisible
public boolean isInvisible()
Determines whether this object is "invisible", i.e., should be ignored. An invisible object is one that doesn't paint to the screen at runtime. Invisible objects sometimes appear in the component library.

Returns:
true if so, false otherwise.
 o isJavaObject
public abstract boolean isJavaObject()
Determines whether this object represents a java object (as opposed to a folder, project template, etc).

Returns:
true if so, false otherwise.
 o isRootObject
public boolean isRootObject()
Determines whether this object is a "root object". A root object appears at the top level in project windows and has associated java source code.

Returns:
true if so, false otherwise.
 o isSameOrChild
public abstract boolean isSameOrChild(VisualObject object)
Detemines whether this object is the same as or a parent of the given object.

Parameters:
object - the given object.
Returns:
true if the object is the same as the argument object or one of its parents, false otherwise.
 o isValid
public abstract boolean isValid()
Determines if this VisualObject corresponds to a valid object in its VisualProject.

Returns:
true if so, false otherwise.
See Also:
checkValidity
 o removeVisualObjectListener
public abstract void removeVisualObjectListener(VisualObjectListener listener)
Remove a listener from this visual object. Stop receiving notifications of changes to this object

Parameters:
listener - the object that was receiving notifications
See Also:
VisualObjectListener, addVisualObjectListener, removeVisualObjectListener
 o setActiveObject
public abstract void setActiveObject()
Sets this VisualObject as active in the Property List of Visual Cafe.

See Also:
setActiveObjects
 o setActiveObject
public abstract void setActiveObject(boolean forceDefaultProperty)
Sets this VisualObject as active in the Property List of Visual Cafe.

Parameters:
forceDefaultProperty - force the default property for the object to be selected. if false, the previously selected property remains selected (if it exists for this object).
See Also:
setActiveObjects(boolean)
 o toString
public java.lang.String toString()
Gets a String that represents this object.

Returns:
the String.
Overrides:
toString in class Object
 o updateInstanceProperty
public abstract java.lang.Object updateInstanceProperty(int propertyIndex,
                                                        Object instance,
                                                        PropertyInstanceGetter thePropertyInstanceGetter) throws ClassNotFoundException, InstantiationException, IllegalAccessException
Updates the value of the Java object's property at the specified index to match the value of the corresponding VisualProperty in this VisualObject.

Parameters:
propertyIndex - the index of the property to update.
instance - the corresponding Java object to update.
theInstanceGetter - an object that is used to determine Object Reference Properties.
Returns:
the instance object if the Java object's property was updated successfully (this may be the same object as the instance parameter, but may be a re-created object if necessary. null is returned if the property was not updated successfully.
Throws: ArrayIndexOutOfBoundsException
if the propertyIndex is out of range.

All Packages  Class Hierarchy  This Package  Previous  Next  Index