public interface ISettingsGui
ISettingsUtils
Modifier and Type | Method and Description |
---|---|
void |
addBindExecuteScl(ISettingChangeListener scl,
ISettingsBean settings,
java.util.Set<? extends ISetting<?>> settingSet,
javax.swing.JComponent comp)
Adds the specified
ISettingChangeListener to the specified ISettingsBean for the specified settings, and binds it to the specified
component. |
void |
bindScl(ISettingChangeListener scl,
ISettingsBean settings,
java.util.Set<? extends ISetting<?>> settingSet,
javax.swing.JComponent comp)
Binds the specified
ISettingChangeListener to the specified component. |
void |
bindSelectionToSetting(javax.swing.AbstractButton button,
IBoolSetting setting,
ISettingsBean settings)
Binds the selection state of the specified abstract button (which can be e.g.
|
void |
bindVisibilityToSetting(javax.swing.JComponent comp,
IBoolSetting setting,
ISettingsBean settings)
Binds the visibility of the specified component to the specified
IBoolSetting from the specified ISettingsBean . |
void |
bindVisibilityToSkillLevel(javax.swing.JComponent comp,
ISkillLevel minSkillLevel)
Binds the visibility of the specified component to the user's computer skill level.
|
void |
bindVisibilityToSkillLevel(javax.swing.JComponent comp,
ISkillLevel minSkillLevel,
java.lang.Boolean hiddenSelected)
Binds the visibility of the specified component to the user's computer skill level.
|
void |
checkRegistration(ISetting<?> setting,
javax.swing.JComponent settingComponent)
Checks if editing the specified setting requires registration and if so and registration is not OK, disables the specified setting component and sets a
tool tip to it stating that editing it requires registration.
|
ICheckBox |
createBoundedSettingCheckBox(IBoolSetting setting,
ISettingsBean settings,
java.awt.event.ActionListener customListener)
Creates an
ICheckBox whose initial value is initialized from the specified IBoolSetting and settings bean. |
<T> IComboBox<T> |
createBoundedSettingComboBox(IFixedValuesSetting<T> setting,
ISettingsBean settings,
java.awt.event.ActionListener customListener)
Creates an
IComboBox whose values and initial selected value is initialized from the specified IFixedValuesSetting and settings bean. |
ICheckBox |
createSettingCheckBox(IBoolSetting setting,
ISettingsBean settings,
java.awt.event.ActionListener customListener)
Creates an
ICheckBox whose initial value is initialized from the specified IBoolSetting and settings bean. |
<T> IComboBox<T> |
createSettingComboBox(IFixedValuesSetting<T> setting,
ISettingsBean settings,
java.awt.event.ActionListener customListener)
Creates an
IComboBox whose values and initial selected value is initialized from the specified IFixedValuesSetting and settings bean. |
IIndicatorTextArea |
createSettingIndicatorTextArea(IValidatedMultilineStringSetting setting,
ISettingsBean settings,
java.awt.event.ActionListener customListener)
Creates an
IIndicatorTextArea whose initial value is initialized from the specified IValidatedStringSetting and settings bean. |
IIndicatorTextField |
createSettingIndicatorTextField(IValidatedStringSetting setting,
ISettingsBean settings,
java.awt.event.ActionListener customListener)
Creates an
IIndicatorTextField whose initial value is initialized from the specified IValidatedStringSetting and settings bean. |
ILink |
createSettingLink(INodeSetting nodeSetting)
Creates a link which when clicked opens the settings dialog having the specified node setting selected.
|
ILink |
createSettingLink(INodeSetting nodeSetting,
java.lang.String text)
Creates a link which when clicked opens the settings dialog having the specified node setting selected.
|
IPathField |
createSettingPathField(IPathSetting setting,
ISettingsBean settings,
java.awt.event.ActionListener customListener)
Creates an
IPathField whose initial value is initialized from the specified IPathSetting and settings bean. |
ISpinner |
createSettingSpinner(IIntSetting setting,
ISettingsBean settings,
java.awt.event.ActionListener customListener)
Creates an
ISpinner whose initial value is initialized from the specified IIntSetting and settings bean. |
ITemplateField |
createSettingTemplateField(ITemplateSetting setting,
ISettingsBean settings,
java.awt.event.ActionListener customListener)
Creates an
ITemplateField whose initial value is initialized from the specified ITemplateSetting and settings bean. |
ITextArea |
createSettingTextArea(IMultilineStringSetting setting,
ISettingsBean settings,
java.awt.event.ActionListener customListener)
Creates an
ITextArea whose initial value is initialized from the specified IMultilineStringSetting and settings bean. |
ITextField |
createSettingTextField(IStringSetting setting,
ISettingsBean settings,
java.awt.event.ActionListener customListener)
Creates an
ITextField whose initial value is initialized from the specified IStringSetting and settings bean. |
IComboBox<? extends ISkillLevel> |
createSkillLevelComboBox(java.awt.event.ActionListener customListener)
Creates a setting combo box, bounded to the skill level setting.
|
void |
removeAllBoundedScl(javax.swing.JComponent container)
Removes previously bounded
ISettingChangeListener s from the specified component, and also from all of its child components recursively. |
ILink createSettingLink(INodeSetting nodeSetting)
nodeSetting
- node setting to select by defaultILink createSettingLink(INodeSetting nodeSetting, java.lang.String text)
nodeSetting
- node setting to select by defaulttext
- text of the linkvoid checkRegistration(ISetting<?> setting, javax.swing.JComponent settingComponent)
setting
- setting to be checkedsettingComponent
- setting component to be disabled if registration requirement is not met<T> IComboBox<T> createSettingComboBox(IFixedValuesSetting<T> setting, ISettingsBean settings, java.awt.event.ActionListener customListener)
IComboBox
whose values and initial selected value is initialized from the specified IFixedValuesSetting
and settings bean.
Changing the selected value of the combo box will update the setting value at the specified settings bean.
Warning! Updating the setting is done via a registered ActionListener
. In Swing the execution order of registered listeners is not
specified. Custom listeners added to the returned combo box might be called before the setting is updated! If it is required that the new setting be
updated when a custom listener is called, pass the custom listener as the customListener
argument here.
T
- type of the setting valuessetting
- setting to create the combo box forsettings
- settings bean storing the setting valuecustomListener
- action listener which is guaranteed to be called after the specified setting has been updatedICheckBox createSettingCheckBox(IBoolSetting setting, ISettingsBean settings, java.awt.event.ActionListener customListener)
ICheckBox
whose initial value is initialized from the specified IBoolSetting
and settings bean.
Changing the value of the check box will update the setting value at the specified settings bean.
Warning! Updating the setting is done via a registered ActionListener
. In Swing the execution order of registered listeners is not
specified. Custom listeners added to the returned check box might be called before the setting is updated! If it is required that the new setting be
updated when a custom listener is called, pass the custom listener as the customListener
argument here.
setting
- setting to create the check box forsettings
- settings bean storing the setting valuecustomListener
- action listener which is guaranteed to be called after the specified setting has been updatedISpinner createSettingSpinner(IIntSetting setting, ISettingsBean settings, java.awt.event.ActionListener customListener)
ISpinner
whose initial value is initialized from the specified IIntSetting
and settings bean.
Changing the value of the spinner will update the setting value at the specified settings bean.
Warning! Updating the setting is done via a registered ActionListener
. In Swing the execution order of registered listeners is not
specified. Custom listeners added to the returned spinner might be called before the setting is updated! If it is required that the new setting be
updated when a custom listener is called, pass the custom listener as the customListener
argument here.
setting
- setting to create the spinner forsettings
- settings bean storing the setting valuecustomListener
- action listener which is guaranteed to be called after the specified setting has been updatedITextField createSettingTextField(IStringSetting setting, ISettingsBean settings, java.awt.event.ActionListener customListener)
ITextField
whose initial value is initialized from the specified IStringSetting
and settings bean.
Changing the value of the text field will update the setting value at the specified settings bean.
Warning! Updating the setting is done via a registered DocumentListener
. In Swing the execution order of registered listeners is not
specified. Custom listeners added to the returned text field might be called before the setting is updated! If it is required that the new setting be
updated when a custom listener is called, pass the custom listener as the customListener
argument here.
setting
- setting to create the text field forsettings
- settings bean storing the setting valuecustomListener
- action listener which is guaranteed to be called after the specified setting has been updatedITextArea createSettingTextArea(IMultilineStringSetting setting, ISettingsBean settings, java.awt.event.ActionListener customListener)
ITextArea
whose initial value is initialized from the specified IMultilineStringSetting
and settings bean.
Changing the value of the text field will update the setting value at the specified settings bean.
Warning! Updating the setting is done via a registered DocumentListener
. In Swing the execution order of registered listeners is not
specified. Custom listeners added to the returned text field might be called before the setting is updated! If it is required that the new setting be
updated when a custom listener is called, pass the custom listener as the customListener
argument here.
setting
- setting to create the text field forsettings
- settings bean storing the setting valuecustomListener
- action listener which is guaranteed to be called after the specified setting has been updatedIPathField createSettingPathField(IPathSetting setting, ISettingsBean settings, java.awt.event.ActionListener customListener)
IPathField
whose initial value is initialized from the specified IPathSetting
and settings bean.
Changing the value of the path field will update the setting value at the specified settings bean.
Warning! Updating the setting is done via a registered DocumentListener
. In Swing the execution order of registered listeners is not
specified. Custom listeners added to the returned path field might be called before the setting is updated! If it is required that the new setting be
updated when a custom listener is called, pass the custom listener as the customListener
argument here.
setting
- setting to create the path field forsettings
- settings bean storing the setting valuecustomListener
- action listener which is guaranteed to be called after the specified setting has been updatedIIndicatorTextField createSettingIndicatorTextField(IValidatedStringSetting setting, ISettingsBean settings, java.awt.event.ActionListener customListener)
IIndicatorTextField
whose initial value is initialized from the specified IValidatedStringSetting
and settings bean.
Changing the value of the indicator text field will update the setting value at the specified settings bean.
Warning! Updating the setting is done via a registered DocumentListener
. In Swing the execution order of registered listeners is not
specified. Custom listeners added to the returned text field might be called before the setting is updated! If it is required that the new setting be
updated when a custom listener is called, pass the custom listener as the customListener
argument here.
setting
- setting to create the indicator text field forsettings
- settings bean storing the setting valuecustomListener
- action listener which is guaranteed to be called after the specified setting has been updatedITemplateField createSettingTemplateField(ITemplateSetting setting, ISettingsBean settings, java.awt.event.ActionListener customListener)
ITemplateField
whose initial value is initialized from the specified ITemplateSetting
and settings bean.
Changing the value of the template field will update the setting value at the specified settings bean.
Warning! Updating the setting is done via a registered DocumentListener
. In Swing the execution order of registered listeners is not
specified. Custom listeners added to the returned template field might be called before the setting is updated! If it is required that the new setting be
updated when a custom listener is called, pass the custom listener as the customListener
argument here.
setting
- setting to create the template field forsettings
- settings bean storing the setting valuecustomListener
- action listener which is guaranteed to be called after the specified setting has been updatedIIndicatorTextArea createSettingIndicatorTextArea(IValidatedMultilineStringSetting setting, ISettingsBean settings, java.awt.event.ActionListener customListener)
IIndicatorTextArea
whose initial value is initialized from the specified IValidatedStringSetting
and settings bean.
Changing the value of the indicator text area will update the setting value at the specified settings bean.
Warning! Updating the setting is done via a registered DocumentListener
. In Swing the execution order of registered listeners is not
specified. Custom listeners added to the returned text area might be called before the setting is updated! If it is required that the new setting be
updated when a custom listener is called, pass the custom listener as the customListener
argument here.
setting
- setting to create the indicator text area forsettings
- settings bean storing the setting valuecustomListener
- action listener which is guaranteed to be called after the specified setting has been updated<T> IComboBox<T> createBoundedSettingComboBox(IFixedValuesSetting<T> setting, ISettingsBean settings, java.awt.event.ActionListener customListener)
IComboBox
whose values and initial selected value is initialized from the specified IFixedValuesSetting
and settings bean.
Also executes the listener!
Changing the selected value of the combo box will update the setting value at the specified settings bean.
The created and returned combo box will also be bound to the setting value: if the setting value is modified outside at the specified settings bean, the
selected value of the combo box will be changed accordingly.
This bounding is implemented with a ISettingChangeListener
stored as a client property. To remove the bound, call
removeAllBoundedScl(JComponent)
.
Warning! Updating the setting is done via a registered ActionListener
. In Swing the execution order of registered listeners is not
specified. Custom listeners added to the returned combo box might be called before the setting is updated! If it is required that the new setting be
updated when a custom listener is called, pass the custom listener as the customListener
argument here.
T
- type of the setting valuessetting
- setting to create the combo box for and to bound tosettings
- settings bean storing the setting valuecustomListener
- action listener which is guaranteed to be called after the specified setting has been updatedremoveAllBoundedScl(JComponent)
ICheckBox createBoundedSettingCheckBox(IBoolSetting setting, ISettingsBean settings, java.awt.event.ActionListener customListener)
ICheckBox
whose initial value is initialized from the specified IBoolSetting
and settings bean.
Changing the value of the check box will update the setting value at the specified settings bean.
The created and returned check box will also be bound to the setting value: if the setting value is modified outside at the specified settings bean, the
selected value of the check box will be changed accordingly.
This bounding is implemented with a ISettingChangeListener
stored as a client property. To remove the bound, call
removeAllBoundedScl(JComponent)
.
Warning! Updating the setting is done via a registered ActionListener
. In Swing the execution order of registered listeners is not
specified. Custom listeners added to the returned check box might be called before the setting is updated! If it is required that the new setting be
updated when a custom listener is called, pass the custom listener as the customListener
argument here.
setting
- setting to create the check box forsettings
- settings bean storing the setting valuecustomListener
- action listener which is guaranteed to be called after the specified setting has been updatedremoveAllBoundedScl(JComponent)
IComboBox<? extends ISkillLevel> createSkillLevelComboBox(java.awt.event.ActionListener customListener)
The ISkillLevel.DEVELOPER
will optionally be enabled (if the user passed the required test).
customListener
- action listener which is guaranteed to be called after the skill level setting has been updatedvoid bindVisibilityToSkillLevel(javax.swing.JComponent comp, ISkillLevel minSkillLevel)
comp
- component whose visibility to be controlledminSkillLevel
- minimal skill level required for the component to be visiblebindVisibilityToSkillLevel(JComponent, ISkillLevel, Boolean)
void bindVisibilityToSkillLevel(javax.swing.JComponent comp, ISkillLevel minSkillLevel, java.lang.Boolean hiddenSelected)
comp
- component whose visibility to be controlledminSkillLevel
- minimal skill level required for the component to be visiblehiddenSelected
- if not null
, and if the component (which must be an AbstractButton
in this case) has a different selection
state than this value case upon being hidden), the component selection will be inverted with a AbstractButton.doClick()
call (which
also fires an event)java.lang.IllegalArgumentException
- if hiddenSelected
is not null
and comp is not an AbstractButton
bindVisibilityToSkillLevel(JComponent, ISkillLevel)
void bindVisibilityToSetting(javax.swing.JComponent comp, IBoolSetting setting, ISettingsBean settings)
IBoolSetting
from the specified ISettingsBean
.comp
- component whose visibility to be boundedsetting
- setting to control the visibility of the componentsettings
- settings bean storing the settingvoid bindSelectionToSetting(javax.swing.AbstractButton button, IBoolSetting setting, ISettingsBean settings)
ICheckBox
or a JCheckBoxMenuItem
) to the specified
IBoolSetting
from the specified ISettingsBean
.button
- button whose state to be boundedsetting
- setting to control the visibility of the componentsettings
- settings bean storing the settingvoid addBindExecuteScl(ISettingChangeListener scl, ISettingsBean settings, java.util.Set<? extends ISetting<?>> settingSet, javax.swing.JComponent comp)
ISettingChangeListener
to the specified ISettingsBean
for the specified settings, and binds it to the specified
component. Also executes the listener!
Please also see bindScl(ISettingChangeListener, ISettingsBean, Set, JComponent)
.
scl
- setting change listener to be added and boundedsettings
- settings to add the listener tosettingSet
- set of settings to add the listener forcomp
- component to bind tobindScl(ISettingChangeListener, ISettingsBean, Set, JComponent)
,
removeAllBoundedScl(JComponent)
void bindScl(ISettingChangeListener scl, ISettingsBean settings, java.util.Set<? extends ISetting<?>> settingSet, javax.swing.JComponent comp)
ISettingChangeListener
to the specified component.
Binding means storing the reference of the setting change listener as a client property to retain a reference to it (because it is only stored as
a WeakReference
in the settings bean), and adding a PropertyChangeListener
to the component to remove the setting change listener if the
client property to which it was stored for changes.
scl
- setting change listener to be added and boundedsettings
- settings the listener was added tosettingSet
- set of settings the listener was added forcomp
- component to bind toaddBindExecuteScl(ISettingChangeListener, ISettingsBean, Set, JComponent)
,
removeAllBoundedScl(JComponent)
void removeAllBoundedScl(javax.swing.JComponent container)
ISettingChangeListener
s from the specified component, and also from all of its child components recursively.
Implementation simply clears the client property to which the bounded setting change listener was stored for to trigger the previously registered property change listener to take care of the rest.
container
- container of components whose bounded setting change listener to removeaddBindExecuteScl(ISettingChangeListener, ISettingsBean, Set, JComponent)
This API documentation is public and is intended for / allowed to be used by anyone.
Scelight home page: https://sites.google.com/site/scelight/
Scelight is a trademark of András Belicza. Copyright © András Belicza, 2013-2015. All rights reserved.