- 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 classan action for refreshing the value of the context of the pane.static interfacethe interface for a client ofSettingsWindowimplemented by aGuiSwingView.ValuePane.static interfacea factory interface forGuiReprValue.ObjectSpecifier.static classa default implementation of specifier-manager: it creates aGuiReprValue.ObjectSpecifierwith the parent specifier and caches it.static classa general to-string copy action by usingGuiRepresentation.toHumanReadableString(GuiMappingContext, Object)static interfacethe base mixin interface to aJComponentbound to an object or a property via a context (GuiSwingView.ValuePane.getSwingViewContext()). -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TcheckNonNull(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> TfindNonNullByFunction(Component component, Function<GuiSwingView.ValuePane<Object>, T> f) static <T> voidrecursively 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 booleanisComponentResizable(GuiMappingContext context) static voidloadChildren(GuiPreferences prefs, JComponent comp) static voidloadChildren(GuiPreferences prefs, JComponent comp, GuiSwingPrefsApplyOptions options) traverses descendant components and callGuiSwingView.ValuePane.loadSwingPreferences(GuiPreferences, GuiSwingPrefsApplyOptions)static voidloadPreferencesDefault(JComponent pane, GuiPreferences prefs) static voidloadPreferencesDefault(JComponent pane, GuiPreferences prefs, GuiSwingPrefsApplyOptions options) load the current value and history values of the prefs to the panestatic voidprepareForRefresh(GuiSwingView.ValuePane<?> pane) a refresh-action calls the method in order to clear view-clocks of sub-panesstatic voidsaveChildren(GuiPreferences prefs, JComponent comp) traverse descendant components and callGuiSwingView.ValuePane.saveSwingPreferences(GuiPreferences)for each component.static voidsavePreferencesDefault(JComponent pane, GuiPreferences prefs) save the current value and history values of the pane to given preferencesstatic voidsetDescriptionToolTipText(GuiMappingContext context, JComponent comp) static voidsetLastHistoryValue(GuiPreferences prefs, GuiSwingView.ValuePane<Object> pane) static voidsetLastHistoryValue(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 voidsetupCopyAndPasteActions(JComponent component) static voidsetupKeyBindingsForStaticJMenuSubItems(JComponent pane, JMenuItem i, Predicate<Action> overwrite) static booleansetupKeyBindingsForStaticMenuItemAction(JComponent pane, Action a, Predicate<Action> overwrite) static voidstatic voidsetupKeyBindingsForStaticMenuItems(GuiSwingView.ValuePane<?> pane, Predicate<Action> overwrite) static voidsetupKeyBindingsForStaticMenuItems(GuiSwingView.ValuePane<?> pane, JComponent targetPane, Predicate<Action> overwrite) static voidsetupTransferHandler(JComponent component, TransferHandler handler) set up the transfer handler for a component.static voidsetupTransferHandler(JComponent component, TransferHandler handler, Integer... modifierKeys) specifierManager(Supplier<GuiReprValue.ObjectSpecifier> parentSpecifier) the default factorystatic voidupdateFromGui(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 voidupdateViewClockSync(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.ValuePaneprefs- a target preferences
-
loadPreferencesDefault
loadPreferencesDefault(JComponent, GuiPreferences, GuiSwingPrefsApplyOptions)withGuiSwingPrefsApplyOptions.APPLY_OPTIONS_DEFAULT- Parameters:
pane- a targetGuiSwingView.ValuePaneprefs- 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.ValuePaneprefs- 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_ALTorKeyEvent.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
-