|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The DesignInfo interface is another type of BeanInfo interface to provide more live design- time functionality for a JavaBean. BeanInfo represents static meta-data about a JavaBean, while DesignInfo provides dynamic design-time behavior.
To provide a DesignInfo for a JavaBean, a component author must provide an implementation of the DesignInfo interface available at design-time that matches the name of the JavaBean class with "DesignInfo" appended to it.
For example, a component author may supply a JavaBean class named 'com.company.Donkey', and may also supply a corresponding 'com.company.DonkeyBeanInfo' (implements BeanInfo) as well as 'com.company.DonkeyDesignInfo' (implements DesignInfo). Note that these cannot be the same class, as there is no gaurantee that the supplied BeanInfo class will be the same instance that is used in the designer - typically, a BeanInfo class is 'deep-copied' into another instance inside of an IDE.
IMPLEMENTED BY THE COMPONENT AUTHOR - This interface is designed to be implemented by the component (bean) author. BasicDesignInfo is supplied for convenience for subclassing.
BasicDesignInfo
Method Summary | |
Result |
beanCreatedSetup(DesignBean designBean)
Provides an opportunity for a DesignInfo to setup the initial state of a newly created bean. |
Result |
beanDeletedCleanup(DesignBean designBean)
Provides an opportunity for a DesignInfo to cleanup just before a bean gets deleted. |
Result |
beanPastedSetup(DesignBean designBean)
Provides an opportunity for a DesignInfo to fix-up the state of a pasted bean. |
boolean |
canLinkBeans(DesignBean targetBean,
DesignBean sourceBean,
java.lang.Class sourceClass)
This method is called when an object from a design surface or palette is being dragged 'over' a JavaBean type handled by this DesignInfo. |
java.lang.Class |
getBeanClass()
Returns the class type of the JavaBean that this DesignInfo was designed to work with |
DisplayAction[] |
getContextItems(DesignBean designBean)
Returns the list (or hierarchy) of items to be included in a right-click context menu for this bean at design-time. |
Result |
linkBeans(DesignBean targetBean,
DesignBean sourceBean)
This method is called when an object from a design surface or palette has been dropped 'on' a JavaBean type handled by this DesignInfo (to establish a link). |
Methods inherited from interface com.sun.rave.designtime.DesignBeanListener |
beanChanged, beanContextActivated, beanContextDeactivated, eventChanged, propertyChanged |
Method Detail |
public Result beanCreatedSetup(DesignBean designBean)
designBean
- The bean that was just created
public Result beanDeletedCleanup(DesignBean designBean)
designBean
- The bean that is about to be deleted
public Result beanPastedSetup(DesignBean designBean)
designBean
- The bean that was just pasted from the clipboard
public boolean canLinkBeans(DesignBean targetBean, DesignBean sourceBean, java.lang.Class sourceClass)
targetBean
- The DesignBean instance that the user is 'hovering' the mouse oversourceBean
- The DesignBean instance that the user may potentially 'drop' to link - may
be null if this drag operation originated from the palette, because the instance will
not have been created yetsourceClass
- The class type of the object that the user may potentially 'drop' to link
linkBeans(DesignBean, DesignBean)
public java.lang.Class getBeanClass()
public DisplayAction[] getContextItems(DesignBean designBean)
designBean
- The DesignBean that a user has right-clicked on
public Result linkBeans(DesignBean targetBean, DesignBean sourceBean)
This method is called when an object from a design surface or palette has been dropped 'on' a JavaBean type handled by this DesignInfo (to establish a link). This method will not be called unless the corresponding 'canLinkBeans' method call returned true. Typically, this results in property settings on potentially both of the DesignBean objects.
targetBean
- The target DesignBean instance that the user has 'dropped' an object onto to
establish a linksourceBean
- The DesignBean instance that has been 'dropped'
canLinkBeans(DesignBean, DesignBean, Class)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |