Interface EnabledEx
- All Known Implementing Classes:
AbstractAlarmTable
,AbstractVisionButton
,AlarmJournalTable
,AlarmStatusTable
,AlertSummaryTable
,BaseFormattedTextField
,BoxEvent
,EquipmentScheduleView
,FileExplorer
,PMI2StateButton
,PMIButton
,PMICheckBox
,PMIComboBox
,PMICommentsPanel
,PMICommentsPanel2
,PMIControlButton
,PMIDateRange
,PMIDateTimePopupSelector
,PMIDateTimeSelector
,PMIEditorPane
,PMIFormattedTextField
,PMIImage
,PMILabel
,PMIList
,PMIMomentaryButton
,PMIMomentaryButton2
,PMIMultiStateIndicator
,PMINStateButton
,PMINumericLabel
,PMINumericTextField
,PMIPasswordField
,PMIProgressBar
,PMIRadioButton
,PMISlider
,PMISpinner
,PMITable
,PMITabStrip
,PMITextArea
,PMITextField
,PMIToggleButton
,PMITreeView
,RosterManagementPanel
,ScheduleManagementPanel
,UserManagementPanel
,VisionAdvancedTable
This interface represents a component that understands how to properly implement enabled within the Vision component system. This means that the true Swing enabled property will not be exposed as a bean property. Instead, a property named componentEnabled will be present. The true Swing enabled property will be derived as a boolean AND between componentEnabled and the expression: !Boolean.TRUE.equals(getClientProperty(EnabledEx.DISABLED_BY_PERMISSIONS))
The functions in this interface are typically implemented as follows:
private boolean componentEnabled = true; public boolean isComponentEnabled() { return componentEnabled; } public void setComponentEnabled(boolean componentEnabled) { this.componentEnabled = componentEnabled; evaluateEnabled(); } public void evaluateEnabled() { setEnabled(isComponentEnabled() && !Boolean.TRUE.equals(getClientProperty(EnabledEx.DISABLED_BY_PERMISSIONS))); }
If your component is complex and has interior components, you may want to implement evaluateEnabled to disable them instead or as well.
If your bean info extends from CommonBeanInfo, you don't need to add your componentEnabled property, it will be added for you.
Classes implementing this interface MUST extend from JComponent
-
Field Summary
Fields -
Method Summary
-
Field Details
-
DISABLED_BY_PERMISSIONS
- See Also:
-
-
Method Details
-
isComponentEnabled
boolean isComponentEnabled() -
setComponentEnabled
void setComponentEnabled(boolean enabled) -
evaluateEnabled
void evaluateEnabled()
-