Class EmfSpinnerSectionBuilder.Builder<T extends org.eclipse.emf.ecore.EObject,V,R>
java.lang.Object
com.amalgamasimulation.desktop.ui.editor.builders.EmfSpinnerSectionBuilder.Builder<T,V,R>
- Type Parameters:
T- type of the object in the containerV- type of the valueR- step after the label, chosen by the factory
- All Implemented Interfaces:
EmfSpinnerSectionBuilder.ConverterBuilder<T,,V> EmfSpinnerSectionBuilder.DigitsBuilder<T,,V> EmfSpinnerSectionBuilder.DigitsRangeBuilder<T,,V> EmfSpinnerSectionBuilder.FeatureBuilder<T,,V, R> EmfSpinnerSectionBuilder.FinalBuilder<T,,V> EmfSpinnerSectionBuilder.LabelBuilder<T,,R> EmfSpinnerSectionBuilder.ParentBuilder<T,,V, R> EmfSpinnerSectionBuilder.RangeBuilder<T,,V> ICanBeNullBuilder<EmfSpinnerSectionBuilder.FinalBuilder<T,,V>> IContainerHandlerBuilder<T,,V, EmfSpinnerSectionBuilder.FinalBuilder<T, V>> IContainerLabelBuilder<T,,R> IContainerVisibleEnableBuilder<T,,EmfSpinnerSectionBuilder.FinalBuilder<T, V>> IConverterBuilder<V,,EmfSpinnerSectionBuilder.DigitsRangeBuilder<T, V>> ICreateBuilder<ISpinnerSection<V>>,IDigitsBuilder<EmfSpinnerSectionBuilder.FinalBuilder<T,,V>> IEmfButtonBuilder<EmfSpinnerSectionBuilder.FinalBuilder<T,,V>> IEmfObservableBuilder<EmfSpinnerSectionBuilder.FinalBuilder<T,,V>> IFeatureBuilder<EmfSpinnerSectionBuilder.LabelBuilder<T,,R>> ILabelBuilder<R>,ILabelPropertiesBuilder<EmfSpinnerSectionBuilder.FinalBuilder<T,,V>> IParentBuilder<EmfSpinnerSectionBuilder.FeatureBuilder<T,,V, R>> ISpinnerPropertiesBuilder<V,,EmfSpinnerSectionBuilder.FinalBuilder<T, V>> IToolTipBuilder<EmfSpinnerSectionBuilder.FinalBuilder<T,,V>> IValidationBuilder<V,EmfSpinnerSectionBuilder.FinalBuilder<T, V>>
- Enclosing class:
EmfSpinnerSectionBuilder
public static class EmfSpinnerSectionBuilder.Builder<T extends org.eclipse.emf.ecore.EObject,V,R>
extends Object
implements EmfSpinnerSectionBuilder.ParentBuilder<T,V,R>, EmfSpinnerSectionBuilder.FeatureBuilder<T,V,R>, EmfSpinnerSectionBuilder.LabelBuilder<T,R>, EmfSpinnerSectionBuilder.ConverterBuilder<T,V>, EmfSpinnerSectionBuilder.RangeBuilder<T,V>, EmfSpinnerSectionBuilder.DigitsRangeBuilder<T,V>, EmfSpinnerSectionBuilder.DigitsBuilder<T,V>, EmfSpinnerSectionBuilder.FinalBuilder<T,V>
Builder that implements all steps.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BiConsumer<Integer, com.amalgamasimulation.desktop.ui.editor.sections.internal.Section> protected intprotected final LabelPropertiesprotected final EmfSpinnerSection<T, V> -
Method Summary
Modifier and TypeMethodDescriptionaddButton(IButtonProperties buttonProperties) protected voidPasses the created section to the property page.canBeNull(BooleanSupplier canBeNull) converter(ToDoubleFunction<V> toNumber, DoubleFunction<V> fromNumber) Sets how a value is turned into the number of the spinner and back.create()static <T1 extends org.eclipse.emf.ecore.EObject,V1>
EmfSpinnerSectionBuilder.ParentBuilder<T1, V1, EmfSpinnerSectionBuilder.ConverterBuilder<T1, V1>> create(org.eclipse.core.databinding.observable.value.IObservableValue<T1> containerObservable) Creates the builder of a section for a value of any type; the converter step turns it into a number.static <T1 extends org.eclipse.emf.ecore.EObject>
EmfSpinnerSectionBuilder.ParentBuilder<T1, Double, EmfSpinnerSectionBuilder.DigitsRangeBuilder<T1, Double>> createDouble(org.eclipse.core.databinding.observable.value.IObservableValue<T1> containerObservable) Creates the builder of a section for a Double.static <T1 extends org.eclipse.emf.ecore.EObject>
EmfSpinnerSectionBuilder.ParentBuilder<T1, Integer, EmfSpinnerSectionBuilder.RangeBuilder<T1, Integer>> createInteger(org.eclipse.core.databinding.observable.value.IObservableValue<T1> containerObservable) Creates the builder of a section for an Integer.digits(int digits) Sets the number of digits after the point; the spinner shows the value rounded to them.feature(org.eclipse.emf.ecore.EStructuralFeature feature) protected org.eclipse.core.databinding.observable.value.IObservableValue<T> Returns the container of the section.protected EmfSpinnerSectionBuilder.FinalBuilder<T, V> getThis()Returns this builder as its final step.handler(BiConsumer<T, V> handler) labelProperties(LabelProperties labelProperties) observableFeaturePaths(org.eclipse.emf.databinding.FeaturePath... observableFeaturePaths) observableFeatures(org.eclipse.emf.ecore.EStructuralFeature... observableFeatures) parent(org.eclipse.swt.widgets.Composite parent) Sets the smallest and the largest value.protected voidsetEnabled(Predicate<T> enabled) protected voidprotected voidprotected voidsetPage(org.eclipse.swt.widgets.Composite parent, BiConsumer<Integer, com.amalgamasimulation.desktop.ui.editor.sections.internal.Section> actionAfterCreateSectionInProperty, int index) Places the section on a property page: the page gives the parent, the position and the action that adds the section.protected voidsetParent(org.eclipse.swt.widgets.Composite parent) protected voidsetVisible(Predicate<T> visible) spinnerProperties(SpinnerProperties<V> spinnerProperties) Sets the spinner settings.toolTip(ToolTipProperties tooltip) validation(Predicate<V> validation, String message) Sets a check of the value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.amalgamasimulation.desktop.ui.editor.builders.interfaces.IContainerVisibleEnableBuilder
enabled, visibleMethods inherited from interface com.amalgamasimulation.desktop.ui.editor.builders.interfaces.IEmfButtonBuilder
addButtonIfMethods inherited from interface com.amalgamasimulation.desktop.ui.editor.builders.interfaces.ILabelPropertiesBuilder
labelPropertiesMethods inherited from interface com.amalgamasimulation.desktop.ui.editor.builders.interfaces.IToolTipBuilder
toolTip, toolTip
-
Field Details
-
section
-
labelProperties
-
actionAfterCreateSectionInProperty
protected BiConsumer<Integer,com.amalgamasimulation.desktop.ui.editor.sections.internal.Section> actionAfterCreateSectionInProperty -
index
protected int index
-
-
Method Details
-
createInteger
public static <T1 extends org.eclipse.emf.ecore.EObject> EmfSpinnerSectionBuilder.ParentBuilder<T1,Integer, createIntegerEmfSpinnerSectionBuilder.RangeBuilder<T1, Integer>> (org.eclipse.core.databinding.observable.value.IObservableValue<T1> containerObservable) Creates the builder of a section for an Integer.- Type Parameters:
T1- type of the object in the container- Parameters:
containerObservable- container with the edited object- Returns:
- the first step of the builder
-
createDouble
public static <T1 extends org.eclipse.emf.ecore.EObject> EmfSpinnerSectionBuilder.ParentBuilder<T1,Double, createDoubleEmfSpinnerSectionBuilder.DigitsRangeBuilder<T1, Double>> (org.eclipse.core.databinding.observable.value.IObservableValue<T1> containerObservable) Creates the builder of a section for a Double.- Type Parameters:
T1- type of the object in the container- Parameters:
containerObservable- container with the edited object- Returns:
- the first step of the builder
-
create
public static <T1 extends org.eclipse.emf.ecore.EObject,V1> EmfSpinnerSectionBuilder.ParentBuilder<T1,V1, createEmfSpinnerSectionBuilder.ConverterBuilder<T1, V1>> (org.eclipse.core.databinding.observable.value.IObservableValue<T1> containerObservable) Creates the builder of a section for a value of any type; the converter step turns it into a number.- Type Parameters:
T1- type of the object in the containerV1- type of the value- Parameters:
containerObservable- container with the edited object- Returns:
- the first step of the builder
-
getThis
Returns this builder as its final step. -
getContainer
Returns the container of the section. -
setVisible
-
setEnabled
-
parent
public EmfSpinnerSectionBuilder.FeatureBuilder<T,V, parentR> (org.eclipse.swt.widgets.Composite parent) - Specified by:
parentin interfaceIParentBuilder<T extends org.eclipse.emf.ecore.EObject>
-
feature
public EmfSpinnerSectionBuilder.LabelBuilder<T,R> feature(org.eclipse.emf.ecore.EStructuralFeature feature) - Specified by:
featurein interfaceIFeatureBuilder<T extends org.eclipse.emf.ecore.EObject>
-
label
- Specified by:
labelin interfaceILabelBuilder<T extends org.eclipse.emf.ecore.EObject>
-
label
- Specified by:
labelin interfaceIContainerLabelBuilder<T extends org.eclipse.emf.ecore.EObject,V>
-
converter
public EmfSpinnerSectionBuilder.DigitsRangeBuilder<T,V> converter(ToDoubleFunction<V> toNumber, DoubleFunction<V> fromNumber) Description copied from interface:IConverterBuilderSets how a value is turned into the number of the spinner and back.- Specified by:
converterin interfaceIConverterBuilder<T extends org.eclipse.emf.ecore.EObject,V> - Parameters:
toNumber- turns a value into a number; gets a value that is notnullfromNumber- turns a number of the spinner back into a value- Returns:
- the next step of the builder
-
range
Description copied from interface:EmfSpinnerSectionBuilder.RangeBuilderSets the smallest and the largest value. If minimum is greater than maximum,create()throws IllegalArgumentException.- Specified by:
rangein interfaceEmfSpinnerSectionBuilder.DigitsRangeBuilder<T extends org.eclipse.emf.ecore.EObject,V> - Specified by:
rangein interfaceEmfSpinnerSectionBuilder.RangeBuilder<T extends org.eclipse.emf.ecore.EObject,V> - Parameters:
minimum- the smallest valuemaximum- the largest value- Returns:
- the next step of the builder
-
digits
Description copied from interface:IDigitsBuilderSets the number of digits after the point; the spinner shows the value rounded to them. If digits is below 0,create()throws IllegalArgumentException.- Specified by:
digitsin interfaceIDigitsBuilder<T extends org.eclipse.emf.ecore.EObject>- Parameters:
digits- the number of digits after the point- Returns:
- the next step of the builder
-
handler
- Specified by:
handlerin interfaceIContainerHandlerBuilder<T extends org.eclipse.emf.ecore.EObject,V, R>
-
spinnerProperties
public EmfSpinnerSectionBuilder.FinalBuilder<T,V> spinnerProperties(SpinnerProperties<V> spinnerProperties) Description copied from interface:ISpinnerPropertiesBuilderSets the spinner settings. A second call replaces the settings of the first one.- Specified by:
spinnerPropertiesin interfaceISpinnerPropertiesBuilder<T extends org.eclipse.emf.ecore.EObject,V> - Parameters:
spinnerProperties- the spinner settings- Returns:
- the next step of the builder
-
addButton
- Specified by:
addButtonin interfaceIEmfButtonBuilder<T extends org.eclipse.emf.ecore.EObject>
-
validation
public EmfSpinnerSectionBuilder.FinalBuilder<T,V> validation(Predicate<V> validation, String message) Description copied from interface:IValidationBuilderSets a check of the value. A value that fails it is not written, and an error icon with the message as its tooltip is shown next to the spinner.- Specified by:
validationin interfaceIValidationBuilder<T extends org.eclipse.emf.ecore.EObject,V> - Parameters:
validation- the check; gets a value that is notnullmessage- the tooltip of the error icon- Returns:
- the next step of the builder
-
canBeNull
- Specified by:
canBeNullin interfaceICanBeNullBuilder<T extends org.eclipse.emf.ecore.EObject>
-
observableFeatures
public EmfSpinnerSectionBuilder.FinalBuilder<T,V> observableFeatures(org.eclipse.emf.ecore.EStructuralFeature... observableFeatures) - Specified by:
observableFeaturesin interfaceIEmfObservableBuilder<T extends org.eclipse.emf.ecore.EObject>
-
observableFeaturePaths
public EmfSpinnerSectionBuilder.FinalBuilder<T,V> observableFeaturePaths(org.eclipse.emf.databinding.FeaturePath... observableFeaturePaths) - Specified by:
observableFeaturePathsin interfaceIEmfObservableBuilder<T extends org.eclipse.emf.ecore.EObject>
-
create
- Specified by:
createin interfaceICreateBuilder<T extends org.eclipse.emf.ecore.EObject>
-
labelProperties
-
toolTip
-
toolTip
-
visible
-
enabled
-
setParent
protected void setParent(org.eclipse.swt.widgets.Composite parent) -
setPage
protected void setPage(org.eclipse.swt.widgets.Composite parent, BiConsumer<Integer, com.amalgamasimulation.desktop.ui.editor.sections.internal.Section> actionAfterCreateSectionInProperty, int index) Places the section on a property page: the page gives the parent, the position and the action that adds the section. -
setLabel
-
setLabel
-
addToPage
protected void addToPage()Passes the created section to the property page. Does nothing outside a page.
-