public class DialogUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
DialogUtils.BranchVariableGetter
Annotates variable getter methods in interfaces that are used in
mergeBranchVariables(java.lang.Class<VARIABLES>, org.eclipse.wst.jsdt.chromium.debug.ui.DialogUtils.Switcher<?>, VARIABLES...) methods. |
static class |
DialogUtils.ComboWrapper<E>
A wrapper around Combo that provides logic-level data-oriented access to the control.
|
static class |
DialogUtils.ExpressionProcessor<T>
A base class for the source-consumer pair that accepts several values as a consumer,
performs a calculation over them and gives it away the result via source interface.
|
static interface |
DialogUtils.Gettable<RES>
A basic interface for anything that can give a value.
|
static class |
DialogUtils.Message
A user interface message for dialog window.
|
static class |
DialogUtils.MessagePriority
Priority of a user interface message.
|
static interface |
DialogUtils.NormalExpression<T>
An expression that gets calculated only when its dependencies are all non-error.
|
static class |
DialogUtils.OkButtonControl<T>
A general-purpose implementation of OK button vertex.
|
static interface |
DialogUtils.OkButtonElements
An access to OK button and related elements of the dialog window from dialog logic part.
|
static interface |
DialogUtils.Optional<V>
A primitive approach to "optional" algebraic type.
|
static interface |
DialogUtils.OptionalSwitcher<T>
A switcher that is operated by optional expression.
|
static interface |
DialogUtils.Scope
A scope for update graph vertices.
|
static interface |
DialogUtils.ScopeEnabler
A callback that lets UI to reflect that some scope became enabled/disabled.
|
static interface |
DialogUtils.SwitchBase<T>
Base interface for 2 types of switchers.
|
static interface |
DialogUtils.Switcher<T>
A switcher that is operated by non-optional expression.
|
static class |
DialogUtils.Updater
Helps to conduct update for vertices in a value graph.
|
static interface |
DialogUtils.ValueConsumer
Represents consumer vertex for Updater.
|
static class |
DialogUtils.ValueProcessor<T>
A basic implementation of object that is both consumer and source.
|
static interface |
DialogUtils.ValueSource<T>
Represents source vertex for Updater.
|
Modifier and Type | Field and Description |
---|---|
static DialogUtils.Message |
NULL_MESSAGE |
Constructor and Description |
---|
DialogUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addModifyListener(Button button,
DialogUtils.ValueSource<?> valueSource,
DialogUtils.Updater updater)
Adds a standard modify listener to a button that binds it to updater.
|
static void |
addModifyListener(Text textElement,
DialogUtils.ValueSource<?> valueSource,
DialogUtils.Updater updater)
Adds a standard modify listener to a text element that binds it to updater.
|
static DialogUtils.Message |
chooseImportantMessage(java.util.Collection<? extends DialogUtils.Message> messages) |
static <T> DialogUtils.ValueSource<T> |
createConstant(T constnant,
DialogUtils.Updater updater) |
static <V> DialogUtils.Optional<V> |
createErrorOptional(DialogUtils.Message message) |
static <V> DialogUtils.Optional<V> |
createErrorOptional(java.util.Set<? extends DialogUtils.Message> messages) |
static <V> DialogUtils.Optional<V> |
createOptional(V value) |
static <T> DialogUtils.ValueProcessor<T> |
createProcessor(DialogUtils.Gettable<T> expression) |
static DialogUtils.ValueSource<? extends DialogUtils.Optional<?>>[] |
dependencies(DialogUtils.ValueSource<? extends DialogUtils.Optional<?>>... sources) |
static <RES> DialogUtils.Gettable<DialogUtils.Optional<? extends RES>> |
handleErrors(DialogUtils.NormalExpression<RES> expression)
Converts
DialogUtils.NormalExpression into DialogUtils.Gettable and takes responsibility of checking
that all dependencies have only normal values. |
static <VARIABLES> |
mergeBranchVariables(java.lang.Class<VARIABLES> variablesType,
DialogUtils.OptionalSwitcher<?> switcher,
VARIABLES... branches)
For output variables from several branches of switch creates merged variables that
could be used outside of the switch.
|
static <VARIABLES> |
mergeBranchVariables(java.lang.Class<VARIABLES> variablesType,
DialogUtils.Switcher<?> switcher,
VARIABLES... branches)
For output variables from several branches of switch creates merged variables that
could be used outside of the switch.
|
public static final DialogUtils.Message NULL_MESSAGE
public static <T> DialogUtils.ValueSource<T> createConstant(T constnant, DialogUtils.Updater updater)
public static <V> DialogUtils.Optional<V> createOptional(V value)
public static <V> DialogUtils.Optional<V> createErrorOptional(DialogUtils.Message message)
public static <V> DialogUtils.Optional<V> createErrorOptional(java.util.Set<? extends DialogUtils.Message> messages)
public static <RES> DialogUtils.Gettable<DialogUtils.Optional<? extends RES>> handleErrors(DialogUtils.NormalExpression<RES> expression)
DialogUtils.NormalExpression
into DialogUtils.Gettable
and takes responsibility of checking
that all dependencies have only normal values. Despite DialogUtils.NormalExpression
being
reflection-based interface, this method should be completely type-safe for a programmer and
accurately check (statically) that its signatures are consistent (including generic types).public static DialogUtils.ValueSource<? extends DialogUtils.Optional<?>>[] dependencies(DialogUtils.ValueSource<? extends DialogUtils.Optional<?>>... sources)
public static <VARIABLES> VARIABLES mergeBranchVariables(java.lang.Class<VARIABLES> variablesType, DialogUtils.Switcher<?> switcher, VARIABLES... branches)
VARIABLES
- an interface that should consist only of no-param getters with
DialogUtils.BranchVariableGetter
annotation that return ValueSource<...> types;
must not be a generic typeswitcher
- the variables get merged frombranches
- output variables of all switch branches; should be in the same
order branches (aka scopes) are added to the switchpublic static <VARIABLES> VARIABLES mergeBranchVariables(java.lang.Class<VARIABLES> variablesType, DialogUtils.OptionalSwitcher<?> switcher, VARIABLES... branches)
VARIABLES
- an interface that should consist only of no-param getters with
DialogUtils.BranchVariableGetter
annotation that return
ValueSource< [? extends] Optional < ... > > types; must not be a generic typeswitcher
- the variables get merged frombranches
- output variables of all switch branches; should be in the same
order branches (aka scopes) are added to the switchpublic static DialogUtils.Message chooseImportantMessage(java.util.Collection<? extends DialogUtils.Message> messages)
public static <T> DialogUtils.ValueProcessor<T> createProcessor(DialogUtils.Gettable<T> expression)
public static void addModifyListener(Text textElement, DialogUtils.ValueSource<?> valueSource, DialogUtils.Updater updater)
public static void addModifyListener(Button button, DialogUtils.ValueSource<?> valueSource, DialogUtils.Updater updater)
Copyright (c) IBM Corp. and others 2000, 2016. All Rights Reserved.