- All Superinterfaces:
GuiSwingElement
- All Known Implementing Classes:
GuiSwingViewBooleanCheckBox
,GuiSwingViewCollectionTable
,GuiSwingViewDocumentEditor
,GuiSwingViewEmbeddedComponent
,GuiSwingViewEnumComboBox
,GuiSwingViewFilePathField
,GuiSwingViewImagePane
,GuiSwingViewLabel
,GuiSwingViewNumberSpinner
,GuiSwingViewObjectPane
,GuiSwingViewPropertyPane
,GuiSwingViewStringField
,GuiSwingViewTabbedPane
the interface for regular pane factory, creating a
GuiSwingView.ValuePane
.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
an action for refreshing the value of the context of the pane.static interface
the interface for a client ofSettingsWindow
implemented by aGuiSwingView.ValuePane
.static interface
a factory interface forGuiReprValue.ObjectSpecifier
.static class
a default implementation of specifier-manager: it creates aGuiReprValue.ObjectSpecifier
with the parent specifier and caches it.static class
a general to-string copy action by usingGuiRepresentation.toHumanReadableString(GuiMappingContext, Object)
static interface
the base mixin interface to aJComponent
bound to an object or a property via a context (GuiSwingView.ValuePane.getSwingViewContext()
). -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
checkNonNull
(Component component, Function<GuiSwingView.ValuePane<Object>, T> f) static List
<GuiSwingView.ValuePane<Object>> collectChildren
(Component component, Predicate<GuiSwingView.ValuePane<Object>> predicate) collectComponents
(Component component, Class<T> type, Predicate<T> predicate) static <T> List
<T> collectNonNullByFunction
(Component component, Function<GuiSwingView.ValuePane<Object>, T> f) createView
(GuiMappingContext context, Supplier<GuiReprValue.ObjectSpecifier> parentSpecifier) static GuiSwingView.ValuePane
<Object> findChild
(Component component, Predicate<GuiSwingView.ValuePane<Object>> predicate) static <PaneType extends GuiSwingView.ValuePane<?>>
PaneTypefindChildByType
(Component component, Class<PaneType> paneType) static <T extends Component>
TfindComponent
(Component component, Class<T> type, Predicate<T> predicate) static <T> T
findNonNullByFunction
(Component component, Function<GuiSwingView.ValuePane<Object>, T> f) static <T> void
recursively traverses components and if a component is an instance of the type, call f.getActionDefault
(GuiSwingView.ValuePane<?> p, Predicate<GuiSwingActionDefault.ExecutionAction> predicate) static GuiSwingView.ValuePane
<Object> getChild
(Component component, Predicate<GuiSwingView.ValuePane<Object>> predicate) default boolean
isComponentResizable
(GuiMappingContext context) static void
loadChildren
(GuiPreferences prefs, JComponent comp) static void
loadChildren
(GuiPreferences prefs, JComponent comp, GuiSwingPrefsApplyOptions options) traverses descendant components and callGuiSwingView.ValuePane.loadSwingPreferences(GuiPreferences, GuiSwingPrefsApplyOptions)
static void
loadPreferencesDefault
(JComponent pane, GuiPreferences prefs) static void
loadPreferencesDefault
(JComponent pane, GuiPreferences prefs, GuiSwingPrefsApplyOptions options) load the current value and history values of the prefs to the panestatic void
prepareForRefresh
(GuiSwingView.ValuePane<?> pane) a refresh-action calls the method in order to clear view-clocks of sub-panesstatic void
saveChildren
(GuiPreferences prefs, JComponent comp) traverse descendant components and callGuiSwingView.ValuePane.saveSwingPreferences(GuiPreferences)
for each component.static void
savePreferencesDefault
(JComponent pane, GuiPreferences prefs) save the current value and history values of the pane to given preferencesstatic void
setDescriptionToolTipText
(GuiMappingContext context, JComponent comp) static void
setLastHistoryValue
(GuiPreferences prefs, GuiSwingView.ValuePane<Object> pane) static void
setLastHistoryValue
(GuiPreferences prefs, GuiSwingView.ValuePane<Object> pane, GuiSwingPrefsApplyOptions options) obtainGuiPreferences.getCurrentValue()
or a last value ofGuiPreferences.getHistoryValues()
(only when the contextGuiMappingContext.isHistoryValueStored(Object)
with null), and set the value byGuiSwingView.ValuePane.setSwingViewHistoryValue(Object)
.static void
setupCopyAndPasteActions
(JComponent component) static void
setupKeyBindingsForStaticJMenuSubItems
(JComponent pane, JMenuItem i, Predicate<Action> overwrite) static boolean
setupKeyBindingsForStaticMenuItemAction
(JComponent pane, Action a, Predicate<Action> overwrite) static void
static void
setupKeyBindingsForStaticMenuItems
(GuiSwingView.ValuePane<?> pane, Predicate<Action> overwrite) static void
setupKeyBindingsForStaticMenuItems
(GuiSwingView.ValuePane<?> pane, JComponent targetPane, Predicate<Action> overwrite) static void
setupTransferHandler
(JComponent component, TransferHandler handler) set up the transfer handler for a component.static void
setupTransferHandler
(JComponent component, TransferHandler handler, Integer... modifierKeys) specifierManager
(Supplier<GuiReprValue.ObjectSpecifier> parentSpecifier) the default factorystatic void
updateFromGui
(GuiSwingView.ValuePane<?> pane, Object value, GuiTaskClock viewClock) send the value to the context of the pane byGuiReprValue.updateFromGui(GuiMappingContext, Object, GuiReprValue.ObjectSpecifier, GuiTaskClock)
, with copying the clock and the specifier of the pane in the caller's thread.static void
updateViewClockSync
(GuiTaskClock viewClock, GuiMappingContext context) obtains context clock and set to the viewClock if the viewClock is older: typically used byGuiSwingView.ValuePane.setSwingViewValueWithUpdate(Object)
-
Method Details
-
createView
JComponent createView(GuiMappingContext context, Supplier<GuiReprValue.ObjectSpecifier> parentSpecifier) -
isComponentResizable
-
updateViewClockSync
obtains context clock and set to the viewClock if the viewClock is older: typically used byGuiSwingView.ValuePane.setSwingViewValueWithUpdate(Object)
- Parameters:
viewClock
- the changed view-clockcontext
- this source context
-
updateFromGui
send the value to the context of the pane byGuiReprValue.updateFromGui(GuiMappingContext, Object, GuiReprValue.ObjectSpecifier, GuiTaskClock)
, with copying the clock and the specifier of the pane in the caller's thread.- Parameters:
pane
- the source panevalue
- the new value to be sentviewClock
- the view-clock of the value
-
setDescriptionToolTipText
-
forEach
recursively traverses components and if a component is an instance of the type, call f.- Type Parameters:
T
- any type a component might belong to- Parameters:
type
- type for a componentcomp
- the searched componentf
- a process for each found component
-
setLastHistoryValue
setLastHistoryValue(GuiPreferences, ValuePane, GuiSwingPrefsApplyOptions)
withGuiSwingPrefsApplyOptions.APPLY_OPTIONS_DEFAULT
- Parameters:
prefs
- the source preferencespane
- the target pane
-
setLastHistoryValue
static void setLastHistoryValue(GuiPreferences prefs, GuiSwingView.ValuePane<Object> pane, GuiSwingPrefsApplyOptions options) obtainGuiPreferences.getCurrentValue()
or a last value ofGuiPreferences.getHistoryValues()
(only when the contextGuiMappingContext.isHistoryValueStored(Object)
with null), and set the value byGuiSwingView.ValuePane.setSwingViewHistoryValue(Object)
.loadPreferencesDefault(JComponent, GuiPreferences)
automatically calls the method.- Parameters:
prefs
- the source preferencespane
- the target paneoptions
- the options- Since:
- 1.4
-
saveChildren
traverse descendant components and callGuiSwingView.ValuePane.saveSwingPreferences(GuiPreferences)
for each component. the root pane calls the method.- Parameters:
prefs
- the preferences for the compcomp
- the top component
-
savePreferencesDefault
save the current value and history values of the pane to given preferences- Parameters:
pane
- aGuiSwingView.ValuePane
prefs
- a target preferences
-
loadPreferencesDefault
loadPreferencesDefault(JComponent, GuiPreferences, GuiSwingPrefsApplyOptions)
withGuiSwingPrefsApplyOptions.APPLY_OPTIONS_DEFAULT
- Parameters:
pane
- a targetGuiSwingView.ValuePane
prefs
- a source preferences
-
loadPreferencesDefault
static void loadPreferencesDefault(JComponent pane, GuiPreferences prefs, GuiSwingPrefsApplyOptions options) load the current value and history values of the prefs to the pane- Parameters:
pane
- a targetGuiSwingView.ValuePane
prefs
- a source preferencesoptions
- options for applying- Since:
- 1.4
-
loadChildren
loadChildren(GuiPreferences, JComponent, GuiSwingPrefsApplyOptions)
withGuiSwingPrefsApplyOptions.APPLY_OPTIONS_DEFAULT
- Parameters:
prefs
- a top prefscomp
- a top component
-
loadChildren
traverses descendant components and callGuiSwingView.ValuePane.loadSwingPreferences(GuiPreferences, GuiSwingPrefsApplyOptions)
- Parameters:
prefs
- a top prefscomp
- a top componentoptions
- options for applying- Since:
- 1.4
-
findChildByType
static <PaneType extends GuiSwingView.ValuePane<?>> PaneType findChildByType(Component component, Class<PaneType> paneType) -
findChild
static GuiSwingView.ValuePane<Object> findChild(Component component, Predicate<GuiSwingView.ValuePane<Object>> predicate) -
collectChildren
static List<GuiSwingView.ValuePane<Object>> collectChildren(Component component, Predicate<GuiSwingView.ValuePane<Object>> predicate) -
getChild
static GuiSwingView.ValuePane<Object> getChild(Component component, Predicate<GuiSwingView.ValuePane<Object>> predicate) -
findNonNullByFunction
static <T> T findNonNullByFunction(Component component, Function<GuiSwingView.ValuePane<Object>, T> f) -
collectNonNullByFunction
static <T> List<T> collectNonNullByFunction(Component component, Function<GuiSwingView.ValuePane<Object>, T> f) -
checkNonNull
-
getActionDefault
static GuiSwingActionDefault.ExecutionAction getActionDefault(GuiSwingView.ValuePane<?> p, Predicate<GuiSwingActionDefault.ExecutionAction> predicate) -
prepareForRefresh
a refresh-action calls the method in order to clear view-clocks of sub-panes- Parameters:
pane
- a root component
-
findComponent
-
collectComponents
-
setupKeyBindingsForStaticMenuItems
- Parameters:
pane
- the method obtains static-methods from the pane. so it needs to be called after building valid menu items.
-
setupKeyBindingsForStaticMenuItems
static void setupKeyBindingsForStaticMenuItems(GuiSwingView.ValuePane<?> pane, Predicate<Action> overwrite) -
setupKeyBindingsForStaticMenuItems
static void setupKeyBindingsForStaticMenuItems(GuiSwingView.ValuePane<?> pane, JComponent targetPane, Predicate<Action> overwrite) -
setupKeyBindingsForStaticMenuItemAction
static boolean setupKeyBindingsForStaticMenuItemAction(JComponent pane, Action a, Predicate<Action> overwrite) -
setupKeyBindingsForStaticJMenuSubItems
static void setupKeyBindingsForStaticJMenuSubItems(JComponent pane, JMenuItem i, Predicate<Action> overwrite) -
setupTransferHandler
set up the transfer handler for a component. also set up drag-gesture for the COPY operation. if the component is not aJTextComponent
, then it sets up copy and paste actions to the action-map, and input key-strokes (Cmd+C and Cmd+V) to the input-map (which will be activated when the component is focusable).- Parameters:
component
- the target componenthandler
- the transfer-handler to be set
-
setupTransferHandler
static void setupTransferHandler(JComponent component, TransferHandler handler, Integer... modifierKeys) - Parameters:
component
- the target componenthandler
- the transfer-handler to be setmodifierKeys
-KeyEvent.VK_SHIFT
,KeyEvent.VK_META
,KeyEvent.VK_ALT
orKeyEvent.VK_ALT_GRAPH
- Since:
- 1.5
-
setupCopyAndPasteActions
-
specifierManagerRoot
- Returns:
- the none
- Since:
- 1.7
-
specifierManager
static GuiSwingView.SpecifierManagerDefault specifierManager(Supplier<GuiReprValue.ObjectSpecifier> parentSpecifier) the default factory- Parameters:
parentSpecifier
- the parent specifieler- Returns:
- a new instance
- Since:
- 1.7
-