Class CommonBeanInfo
- All Implemented Interfaces:
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
initProperties()
and DefaultBeanInfo.getIcon(int)
. You may also override initEventSets()
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
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 final String
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 final String
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 final String
Use this key on your bean descriptor if you want to add custom actions to the right-click menu of your component.static final String
This key is used on the bean descriptor to hold a List<ComponentRestriction> that are compatible with this bean type.static final String
static final String
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
Fields inherited from interface java.beans.BeanInfo
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32
-
Constructor Summary
ConstructorsConstructorDescriptionUse this constructor for components with no customizersCommonBeanInfo
(Class c, CustomizerDescriptor... custDesc) Use this constructor if your component uses customizers.CommonBeanInfo
(Class c, Class customizer) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Adds the cursorCode property with correct enum translation, with no special flagsprotected void
addCursorCode
(int flags) protected void
Adds the dataQuality property using BOUND_MASK | EXPERT_MASKprotected static void
Call this in toinitEventSets()
add focus events to your component.static void
Adds focus and key eventsstatic void
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
Adds the rotation propertyprotected void
Adds rotation propertyprotected void
Subclasses should override this to add custom mappings to the default tag drop handler.protected TagDropHandler
Creates the tag drop handler to be installed for this component.protected void
initComponentRestrictions
(List<ComponentRestriction> restrictions) Adds appropriate restrictions based on the bean's attributes.protected void
Called to add the event sets that this component will fire and should be handled by user scripting.protected void
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
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
Methods inherited from class java.beans.SimpleBeanInfo
getAdditionalBeanInfo, getDefaultEventIndex, getDefaultPropertyIndex, loadImage
-
Field Details
-
TAG_DROP_HANDLER_KEY
- See Also:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
CAT_COMMON
- See Also:
-
CAT_APPEARANCE
- See Also:
-
CAT_POSITION
- See Also:
-
CAT_BEHAVIOR
- See Also:
-
CAT_DATA
- See Also:
-
CAT_LAYOUT
- See Also:
-
CAT_DEPRECATED
- See Also:
-
-
Constructor Details
-
CommonBeanInfo
Use this constructor for components with no customizers -
CommonBeanInfo
Deprecated. -
CommonBeanInfo
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 Details
-
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
Creates the tag drop handler to be installed for this component. Default implementation creates aDefaultTagDropHandler
-
configureTagDropHandler
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
Adds appropriate restrictions based on the bean's attributes.- See Also:
-
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
- 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:
IntrospectionException
- See Also:
-
addCursorCode
Adds the cursorCode property with correct enum translation, with no special flags- Throws:
IntrospectionException
-
addCursorCode
- Throws:
IntrospectionException
-
addDataQuality
Adds the dataQuality property using BOUND_MASK | EXPERT_MASK- Throws:
IntrospectionException
-
addRotation
Adds the rotation property -
addVisualProps
Adds rotation property -
initEventSets
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:
IntrospectionException
-
addJComponentEventSets
Adds propertyChange, mouse, and mouseMotion events sets. This is automatically called by the default implementation ofinitEventSets()
- Throws:
IntrospectionException
-
addInputEventSets
Adds focus and key events- Throws:
IntrospectionException
-
addFocusEvents
Call this in toinitEventSets()
add focus events to your component.- Throws:
IntrospectionException
-
addKeyEvents
Call this in toinitEventSets()
add key events to your component.- Throws:
IntrospectionException
-