Class CommonBeanInfo
- java.lang.Object
-
- java.beans.SimpleBeanInfo
-
- com.inductiveautomation.vision.api.designer.beans.DefaultBeanInfo
-
- com.inductiveautomation.vision.api.designer.beans.CommonBeanInfo
-
- All Implemented Interfaces:
java.beans.BeanInfo
- Direct Known Subclasses:
AbstractButtonBeanInfo
,AlarmJournalTableBeanInfo
,AlarmStatusTableBeanInfo
,AlertSummaryTableBeanInfo
,BasicContainerBeanInfo
,ColumnSelectorPanelBeanInfo
,EquipmentScheduleViewBeanInfo
,FileExplorerBeanInfo
,LanguageSelectorBeanInfo
,LinearScaleBeanInfo
,MovingAnalogIndicatorBeanInfo
,PathBasedVisionShapeBeanInfo
,PDFViewerBeanInfo
,PMIBarChartBeanInfo
,PMIBarcodeBeanInfo
,PMIBoxWhiskerChartBeanInfo
,PMIChartBeanInfo
,PMICheckBoxBeanInfo
,PMICircleBeanInfo
,PMIComboBoxBeanInfo
,PMICommentsPanel2BeanInfo
,PMICommentsPanelBeanInfo
,PMICompassBeanInfo
,PMICylindricalTankBeanInfo
,PMIDateRangeBeanInfo
,PMIDateTimeSelectorBeanInfo
,PMIDayViewBeanInfo
,PMIDigitalDisplayBeanInfo
,PMIEasyChartBeanInfo
,PMIEditorPaneBeanInfo
,PMIFillLevelIndicatorBeanInfo
,PMIFormattedTextFieldBeanInfo
,PMIGanttChartBeanInfo
,PMIImageBeanInfo
,PMIIPCamViewerBeanInfo
,PMILabelBeanInfo
,PMILightrailSignalBeanInfo
,PMILineBeanInfo
,PMIListBeanInfo
,PMIMeterBeanInfo
,PMIMomentaryButton2BeanInfo
,PMIMomentaryButtonBeanInfo
,PMIMonthViewBeanInfo
,PMIMultiStateIndicatorBeanInfo
,PMINStateButtonBeanInfo
,PMINumericLabelBeanInfo
,PMINumericTextFieldBeanInfo
,PMIPaintableCanvasBeanInfo
,PMIPasswordFieldBeanInfo
,PMIPieChartBeanInfo
,PMIPipeBeanInfo
,PMIPipeJointBeanInfo
,PMIPolygonBeanInfo
,PMIProgressBarBeanInfo
,PMIRadioButtonBeanInfo
,PMIRectangleBeanInfo
,PMISignalGeneratorBeanInfo
,PMISliderBeanInfo
,PMISoundComponentBeanInfo
,PMISpinnerBeanInfo
,PMIStatusChartBeanInfo
,PMITableBeanInfo
,PMITabStripBeanInfo
,PMITextAreaBeanInfo
,PMITextFieldBeanInfo
,PMIThermometerBeanInfo
,PMITimerBeanInfo
,PMIToggleButtonBeanInfo
,PMITrackSegmentBeanInfo
,PMITreeViewBeanInfo
,PMIWeekViewBeanInfo
,RadarChart2BeanInfo
,RadarChartBeanInfo
,ReportPanelBeanInfo
,ReportViewerBeanInfo
,RosterManagementPanelBeanInfo
,RowSelectorTreeBeanInfo
,ScheduleManagementPanelBeanInfo
,SFCMonitoringPanelBeanInfo
,ShapeGroupBeanInfo
,SparklineChartBeanInfo
,TagBrowseTreeBeanInfo
,TemplateCanvasBeanInfo
,TemplateHolderBeanInfo
,TemplateRepeaterBeanInfo
,UserManagementPanelBeanInfo
,VisionAdvancedTableBeanInfo
,VisionTemplateBeanInfo
public class CommonBeanInfo extends DefaultBeanInfo
CommonBeanInfo is the base class of all BeanInfo classes used by the Vision module. When you make a subclass of CommonBeanInfo, you'll overrideinitProperties()
andDefaultBeanInfo.getIcon(int)
. You may also overrideinitEventSets()
.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CAT_APPEARANCE
static java.lang.String
CAT_BEHAVIOR
static java.lang.String
CAT_COMMON
static java.lang.String
CAT_DATA
static java.lang.String
CAT_DEPRECATED
static java.lang.String
CAT_LAYOUT
static java.lang.String
CAT_POSITION
static java.lang.String
DOUBLE_CLICK_CUSTOMIZER_KEY
Use this as a key on your bean descriptor whose value is your customizer's VALUE_NAME to make double-clicking on your bean open up that customizer.static java.lang.String
DOUBLE_CLICK_HANDLER
Use this as a key on your bean descriptor whose value is an instance of DoubleClickHandler, and that double-click handler will be called on double-clicks of instances of this beanstatic java.lang.String
EDIT_CLICK_HANDLER
Use this as a key on your bean descriptor whose value is an instance of DoubleClickHandler, and that edit-click will be called when your bean is edit-clicked.static java.lang.String
RIGHT_CLICK_HANDLER
Use this key on your bean descriptor if you want to add custom actions to the right-click menu of your component.static java.lang.String
SECURITY_RESTRICTIONS
This key is used on the bean descriptor to hold a List<ComponentRestriction> that are compatible with this bean type.static java.lang.String
TAG_DROP_HANDLER_KEY
static java.lang.String
TERM_FINDER_CLASS
The class that should be instantiated as a custom translation term finder.-
Fields inherited from class com.inductiveautomation.vision.api.designer.beans.DefaultBeanInfo
beanClass, BOUND_MASK, CATEGORY_KEY, CONSTRAINED_MASK, DISPLAY_ORDER_KEY, EXPERT_MASK, HIDDEN_MASK, log, NO_MASK, NOT_BINDABLE_KEY, NOT_BINDABLE_MASK, NOT_TRANSLATABLE_KEY, NOT_TRANSLATABLE_MASK, PREFERRED_MASK, PREFFERED_MASK, TRANSIENT_KEY, TRANSIENT_MASK
-
-
Constructor Summary
Constructors Constructor Description CommonBeanInfo(java.lang.Class c)
Use this constructor for components with no customizersCommonBeanInfo(java.lang.Class c, CustomizerDescriptor... custDesc)
Use this constructor if your component uses customizers.CommonBeanInfo(java.lang.Class c, java.lang.Class customizer)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addCursorCode()
Adds the cursorCode property with correct enum translation, with no special flagsprotected void
addCursorCode(int flags)
protected void
addDataQuality()
Adds the dataQuality property using BOUND_MASK | EXPERT_MASKprotected static void
addFocusEvents(DefaultBeanInfo info)
Call this in toinitEventSets()
add focus events to your component.static void
addInputEventSets(DefaultBeanInfo info)
Adds focus and key eventsstatic void
addJComponentEventSets(DefaultBeanInfo info)
Adds propertyChange, mouse, and mouseMotion events sets.protected static void
addKeyEvents(DefaultBeanInfo info)
Call this in toinitEventSets()
add key events to your component.protected void
addRotation()
Adds the rotation propertyprotected void
addVisualProps()
Adds rotation propertyprotected void
configureTagDropHandler(DefaultTagDropHandler handler)
Subclasses should override this to add custom mappings to the default tag drop handler.protected TagDropHandler
createTagDropHandler()
Creates the tag drop handler to be installed for this component.protected void
initComponentRestrictions(java.util.List<ComponentRestriction> restrictions)
Adds appropriate restrictions based on the bean's attributes.protected void
initEventSets()
Called to add the event sets that this component will fire and should be handled by user scripting.protected void
initProperties()
CommonBeanInfo adds common properties, such as: preferredSize (hidden, for serialization) bounds (hidden, for serialization) name componentEnabled if the component is an EnabledEx visible border toolTipText font foreground background opaqueprotected void
installTagDropHandler()
Called during construction to install a SQLTags drop handler for this component.-
Methods inherited from class com.inductiveautomation.vision.api.designer.beans.DefaultBeanInfo
addBoundProp, addBoundProp, addEnumProp, addEnumProp, addEnumProp, addEnumProp, addEventSet, addEventSet, addEventSet, addEventSet, addMethod, addMethod, addMethod, addProp, addProp, addProp, addProp, addProp, addTransientProp, addTransientProp, addTransientProp, createProp, createProp, createProp, findProperty, getBeanDescriptor, getEventSetDescriptors, getIcon, getIconPath, getIconPrefix, getIconResource, getMethodDescriptors, getPropertyDescriptors, initDesc, initMethods, removeProp, setBackgroundProperty, setBackgroundProperty, setFlags, setFlags, setForegroundProperty, setForegroundProperty, toString
-
-
-
-
Field Detail
-
TAG_DROP_HANDLER_KEY
public static final java.lang.String TAG_DROP_HANDLER_KEY
- See Also:
- Constant Field Values
-
DOUBLE_CLICK_CUSTOMIZER_KEY
public static final java.lang.String DOUBLE_CLICK_CUSTOMIZER_KEY
Use this as a key on your bean descriptor whose value is your customizer's VALUE_NAME to make double-clicking on your bean open up that customizer.- See Also:
- Constant Field Values
-
DOUBLE_CLICK_HANDLER
public static final java.lang.String DOUBLE_CLICK_HANDLER
Use this as a key on your bean descriptor whose value is an instance of DoubleClickHandler, and that double-click handler will be called on double-clicks of instances of this bean- See Also:
- Constant Field Values
-
EDIT_CLICK_HANDLER
public static final java.lang.String EDIT_CLICK_HANDLER
Use this as a key on your bean descriptor whose value is an instance of DoubleClickHandler, and that edit-click will be called when your bean is edit-clicked. An edit-click is a click on an already selected component.- See Also:
- Constant Field Values
-
RIGHT_CLICK_HANDLER
public static final java.lang.String RIGHT_CLICK_HANDLER
Use this key on your bean descriptor if you want to add custom actions to the right-click menu of your component. The value should be an instance of ComponentPopupInitializer.- See Also:
- Constant Field Values
-
SECURITY_RESTRICTIONS
public static final java.lang.String SECURITY_RESTRICTIONS
This key is used on the bean descriptor to hold a List<ComponentRestriction> that are compatible with this bean type. CommonBeanInfo will automatically add the following:- A VisibilityRestriction to any bean that exposes its visible property.
- An EnabledRestriction to any bean that is a --something or other for new enabled stuff--
- An OverlayRestriction to any bean that is a QualityMonitor.
- See Also:
- Constant Field Values
-
TERM_FINDER_CLASS
public static final java.lang.String TERM_FINDER_CLASS
The class that should be instantiated as a custom translation term finder. If not set, a standard component finder will be used.- See Also:
- Constant Field Values
-
CAT_COMMON
public static final java.lang.String CAT_COMMON
- See Also:
- Constant Field Values
-
CAT_APPEARANCE
public static final java.lang.String CAT_APPEARANCE
- See Also:
- Constant Field Values
-
CAT_POSITION
public static final java.lang.String CAT_POSITION
- See Also:
- Constant Field Values
-
CAT_BEHAVIOR
public static final java.lang.String CAT_BEHAVIOR
- See Also:
- Constant Field Values
-
CAT_DATA
public static final java.lang.String CAT_DATA
- See Also:
- Constant Field Values
-
CAT_LAYOUT
public static final java.lang.String CAT_LAYOUT
- See Also:
- Constant Field Values
-
CAT_DEPRECATED
public static final java.lang.String CAT_DEPRECATED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CommonBeanInfo
public CommonBeanInfo(java.lang.Class c)
Use this constructor for components with no customizers
-
CommonBeanInfo
@Deprecated public CommonBeanInfo(java.lang.Class c, java.lang.Class customizer)
Deprecated.
-
CommonBeanInfo
public CommonBeanInfo(java.lang.Class c, CustomizerDescriptor... custDesc)
Use this constructor if your component uses customizers. Common customizers have static descriptors available. For example, your subclass might call this constructor as follows if it has dynamic properties and styles:super(MyComponent.class, new CustomizerDescriptor[] { DynamicPropertyProviderCustomizer.VALUE_DESCRIPTOR, StyleCustomizer.VALUE_DESCRIPTOR });
-
-
Method Detail
-
installTagDropHandler
protected void installTagDropHandler()
Called during construction to install a SQLTags drop handler for this component. A SQLTags drop handler is stored as a property on the BeanDescriptor with the key "tagDropHandler", and must implement TagDropHandler.
The default implementation of this function calls
createTagDropHandler()
. If that function returns a subclass ofDefaultTagDropHandler
, then it will also callconfigureTagDropHandler(DefaultTagDropHandler)
. If you override this function, then both createTagDropHandler() and configureTagDropHandler() will not be used.Typically you won't override this function. Most implementations will override
configureTagDropHandler(DefaultTagDropHandler)
to simply set-up the default tag drop handler for the component.
-
createTagDropHandler
protected TagDropHandler createTagDropHandler()
Creates the tag drop handler to be installed for this component. Default implementation creates aDefaultTagDropHandler
-
configureTagDropHandler
protected void configureTagDropHandler(DefaultTagDropHandler handler)
Subclasses should override this to add custom mappings to the default tag drop handler. By default the only mapping installed is to bind the component's toolTipText property to the tag's Tooltip property.
Example. Suppose your component has an integer property named "myValue " and when a SQLTag was dropped on your component you want to set up a tag binding for "myValue" to the sqltag's value. You'd configure the tag drop handler like this:
handler.addBinding(TagProp.Value, "myValue");
-
initComponentRestrictions
protected void initComponentRestrictions(java.util.List<ComponentRestriction> restrictions)
Adds appropriate restrictions based on the bean's attributes.- See Also:
SECURITY_RESTRICTIONS
-
initProperties
protected void initProperties() throws java.beans.IntrospectionException
CommonBeanInfo adds common properties, such as:
- preferredSize (hidden, for serialization)
- bounds (hidden, for serialization)
- name
- componentEnabled if the component is an EnabledEx
- visible
- border
- toolTipText
- font
- foreground
- background
- opaque
It is typical to override this function and then call super(). If you want to hide some of these functions, call removeProp with their names. After that you can add your own properties.
Remember, only properties you add here will be serialized on your component. All properties must have proper getter/setter functions. If you need a property to be serialized but not shown, use the HIDDEN_MASK. If you want to expose a read-only bound property, use HIDDEN_MASK | BOUND_MASK.
- Overrides:
initProperties
in classDefaultBeanInfo
- Throws:
java.beans.IntrospectionException
- See Also:
addCursorCode()
,addDataQuality()
,addVisualProps()
-
addCursorCode
protected void addCursorCode() throws java.beans.IntrospectionException
Adds the cursorCode property with correct enum translation, with no special flags- Throws:
java.beans.IntrospectionException
-
addCursorCode
protected void addCursorCode(int flags) throws java.beans.IntrospectionException
- Throws:
java.beans.IntrospectionException
-
addDataQuality
protected void addDataQuality() throws java.beans.IntrospectionException
Adds the dataQuality property using BOUND_MASK | EXPERT_MASK- Throws:
java.beans.IntrospectionException
-
addRotation
protected void addRotation() throws java.beans.IntrospectionException, java.lang.SecurityException
Adds the rotation property- Throws:
java.beans.IntrospectionException
java.lang.SecurityException
-
addVisualProps
protected void addVisualProps() throws java.beans.IntrospectionException, java.lang.SecurityException
Adds rotation property- Throws:
java.beans.IntrospectionException
java.lang.SecurityException
-
initEventSets
protected void initEventSets() throws java.beans.IntrospectionException
Called to add the event sets that this component will fire and should be handled by user scripting. By default this implementation adds common JComponent events scuh as propertyChange, mouse, and mouseMotion
To add a new eventSet, call
DefaultBeanInfo.addEventSet(Class, String, Class, String)
or one of its overloads.- Overrides:
initEventSets
in classDefaultBeanInfo
- Throws:
java.beans.IntrospectionException
-
addJComponentEventSets
public static void addJComponentEventSets(DefaultBeanInfo info) throws java.beans.IntrospectionException
Adds propertyChange, mouse, and mouseMotion events sets. This is automatically called by the default implementation ofinitEventSets()
- Throws:
java.beans.IntrospectionException
-
addInputEventSets
public static void addInputEventSets(DefaultBeanInfo info) throws java.beans.IntrospectionException
Adds focus and key events- Throws:
java.beans.IntrospectionException
-
addFocusEvents
protected static void addFocusEvents(DefaultBeanInfo info) throws java.beans.IntrospectionException
Call this in toinitEventSets()
add focus events to your component.- Throws:
java.beans.IntrospectionException
-
addKeyEvents
protected static void addKeyEvents(DefaultBeanInfo info) throws java.beans.IntrospectionException
Call this in toinitEventSets()
add key events to your component.- Throws:
java.beans.IntrospectionException
-
-