Class FieldFactory<R>

java.lang.Object
com._1c.g5.v8.dt.common.ui.FieldFactory<R>
Direct Known Subclasses:
DevelopmentProcessSettingsFieldFactory

public class FieldFactory<R> extends Object
Factory for creating field for observable master entity for patter Master-Detail. If observable value is empty fields is disabled. Field creates with label and supposed to adds in component with GridLayout with 2 columns.
  • Constructor Details

    • FieldFactory

      public FieldFactory(org.eclipse.core.databinding.observable.value.IObservableValue<R> masterModel)
      Creates new instance.
      Parameters:
      masterModel - the model object, that provides fiel values, not null
  • Method Details

    • getButtonWidthHint

      public static int getButtonWidthHint(org.eclipse.swt.widgets.Button button)
      Compute given button width.
      Parameters:
      button - button to compute width for, cannot be null
      Returns:
      button width
    • addModelFieldChangeListener

      public void addModelFieldChangeListener(ModelFieldChangeListener<R> listener)
      Adds model field change listener.
      Parameters:
      listener - model field change listener, not null
    • removeModelFieldChangeListener

      public void removeModelFieldChangeListener(ModelFieldChangeListener<R> listener)
      Removes model field change listener.
      Parameters:
      listener - model field change listener, not null
    • checkbox

      public org.eclipse.swt.widgets.Button checkbox(org.eclipse.swt.widgets.Composite parent, String label, Function<R,Boolean> valueProvider, BiConsumer<R,Boolean> valueUpdater)
      Creates Label and Button with SWT.CHECK style. Value binds with the model through functions valueProvider and labelProvider.
      Parameters:
      parent - composite with GridLayout and 2 columns, not null
      label - if label != null will be created label with text = label, can be null
      valueProvider - function for computing combo viewer value after model changing, not null
      valueUpdater - function for updating model after widget value changing, not null
      Returns:
      created button, not null
    • combo

      public <T> ComboViewer combo(org.eclipse.swt.widgets.Composite parent, String label, Function<R,T> valueProvider, BiConsumer<R,T> valueUpdater, Collection<T> input, Function<T,String> labelProvider)
      Creates Label and . Viewer value binds with the model through functions valueProvider and labelProvider.
      Parameters:
      parent - composite with GridLayout and 2 columns, not null
      label - if label != null will be created label with text = label, can be null
      valueProvider - function for computing combo viewer value after model changing, not null
      valueUpdater - function for updating model after widget value changing, not null
      input - input for combo viewer, not null
      labelProvider - function for viewing input values, not null
      Returns:
      created combo viewer, not null
    • combo

      public <T> ComboViewer combo(org.eclipse.swt.widgets.Composite parent, String label, Function<R,T> valueProvider, BiConsumer<R,T> valueUpdater, org.eclipse.emf.ecore.EEnum eenum)
      Creates Label and . Viewer value binds with the model through functions valueProvider and labelProvider.
      Parameters:
      parent - composite with GridLayout and 2 columns, not null
      label - if label != null will be created label with text = label, can be null
      valueProvider - function for computing combo viewer value after model changing, not null
      valueUpdater - function for updating model after widget value changing, not null
      eenum - the representation of the model object for creatin viewer input and label provider, not null
      Returns:
      created combo viewer, not null
    • directory

      public org.eclipse.swt.widgets.Text directory(org.eclipse.swt.widgets.Composite parent, String label, Function<R,String> valueProvider, BiConsumer<R,String> valueUpdater)
      Creates Label, Text and Button to select a directory. Text value binds with the model through functions valueProvider and labelProvider.
      Parameters:
      parent - composite with GridLayout and 2 columns, not null
      label - if label != null will be created label with text = label, can be null
      valueProvider - function for computing combo viewer value after model changing, not null
      valueUpdater - function for updating model after combo viewer value changing, if valueUpdater == null widget sets read only, can be null
      Returns:
      created text, not null
    • radioGroup

      public <T> List<org.eclipse.swt.widgets.Button> radioGroup(org.eclipse.swt.widgets.Composite parent, String label, Function<R,T> valueProvider, BiConsumer<R,T> valueUpdater, Map<String,T> values)
      Creates Group and list of with SWT.RADIO style. Selected item binds with the model through functions valueProvider and labelProvider.
      Parameters:
      parent - composite with GridLayout and 2 columns, not null
      label - radio group text, not null
      valueProvider - function for computing combo viewer value after model changing, not null
      valueUpdater - function for updating model after value changing, not null
      values - map of creating items: key - item text, value - item value, not null
      Returns:
      list of created buttons, not null
    • text

      public org.eclipse.swt.widgets.Text text(org.eclipse.swt.widgets.Composite parent, String label, Function<R,String> valueProvider, BiConsumer<R,String> valueUpdater)
      Creates Label and Text. Text value binds with the model through functions valueProvider and labelProvider.
      Parameters:
      parent - composite with GridLayout and 2 columns, not null
      label - if label != null will be created label with text = label, can be null
      valueProvider - function for computing combo viewer value after model changing, not null
      valueUpdater - function for updating model after widget value changing, if valueUpdater == null widget sets read only, can be null
      Returns:
      created text, not null
    • text

      public org.eclipse.swt.widgets.Text text(org.eclipse.swt.widgets.Composite parent, String label, Function<R,String> valueProvider, BiConsumer<R,String> valueUpdater, int style)
      Creates Label and Text. Text value binds with the model through functions valueProvider and labelProvider.
      Parameters:
      parent - composite with GridLayout and 2 columns, not null
      label - if label != null will be created label with text = label, can be null
      valueProvider - function for computing combo viewer value after model changing, not null
      valueUpdater - function for updating model after widget value changing, if valueUpdater == null widget sets read only, can be null
      style - style for control constructor
      Returns:
      created text, not null
    • file

      public org.eclipse.swt.widgets.Composite file(org.eclipse.swt.widgets.Composite parent, String label, Function<R,String> valueProvider, BiConsumer<R,String> valueUpdater, String[] filterExtensions, Function<R,String> directoryProvider, Consumer<org.eclipse.swt.events.ModifyEvent> textModifyConsumer)
      Creates Label, Text and Button to select a directory. Text value binds with the model through functions valueProvider and labelProvider.
      Parameters:
      parent - composite with GridLayout and 2 columns, not null
      label - if label != null will be created label with text = label, can be null
      valueProvider - function for computing combo viewer value after model changing, not null
      valueUpdater - function for updating model after combo viewer value changing, if valueUpdater == null widget sets read only, can be null
      filterExtensions - an array of file filter extensions, can be null
      directoryProvider - function to provide directory, not null
      Returns:
      created text, not null
    • combo

      public <T> ComboViewer combo(org.eclipse.swt.widgets.Composite parent, String label, Function<R,T> valueProvider, BiConsumer<R,T> valueUpdater, ComboViewer combo)
      Creates Label and . Viewer value binds with the model through functions valueProvider and labelProvider.
      Parameters:
      parent - composite with GridLayout and 2 columns, not null
      label - if label != null will be created label with text = label, can be null
      valueProvider - function for computing combo viewer value after model changing, not null
      valueUpdater - function for updating model after widget value changing, not null
      combo - combo to use, not null
      Returns:
      created combo viewer, not null