Class AbstractDtSelectComponent<M extends IModel,P extends IParameterization,VM extends SelectViewModel>

Type Parameters:
M - the successor of IModel
All Implemented Interfaces:
IComponent<M>, IEventChannel
Direct Known Subclasses:
AbstractDtActionBarComponent, AbstractDtComboSelectComponent, AbstractDtEditableComboComponent, ChartLineComponent, CodeComponent, DtDateComponent, EventSubscriptionEventsComboSelectComponent, GraphicalSchemeLineComponent, IntervalBoundComponent, ValueComponent

public abstract class AbstractDtSelectComponent<M extends IModel,P extends IParameterization,VM extends SelectViewModel> extends AbstractControlComponent<M,P,VM>
Base component for components that allow to select new value with feasible buttons in action bar. Is used for successor components that gives an opportunity to select value from dialog and clear value.
See Also:
  • Field Details

    • DEFAULT_CONTEXT

      public static final String DEFAULT_CONTEXT
      The context of the control.
      See Also:
    • SELECT_BUTTON_COMMAND_ID

      public static final String SELECT_BUTTON_COMMAND_ID
      The command of the select button. By default the command corresponds to "F4" hotkey.
      See Also:
    • CLEAR_BUTTON_COMMAND_ID

      public static final String CLEAR_BUTTON_COMMAND_ID
      The command of the clear button. By default the command corresponds to "Shift + F4" hotkey.
      See Also:
    • OPEN_BUTTON_COMMAND_ID

      public static final String OPEN_BUTTON_COMMAND_ID
      The command of the open button. By default the command corresponds to "Ctrl/Cmd + Shift + F4" hotkey.
      See Also:
  • Constructor Details

    • AbstractDtSelectComponent

      protected AbstractDtSelectComponent(P parameterization)
      Instantiates a new component with the given parameterization.
      Parameters:
      parameterization - the parameterization.
  • Method Details

    • dispose

      public void dispose()
      Description copied from interface: IComponent
      Disposes this component, its view models and its child components.
      Specified by:
      dispose in interface IComponent<M extends IModel>
      Overrides:
      dispose in class Component<M extends IModel,P extends IParameterization>
    • handleButtonClicked

      protected void handleButtonClicked(IViewModel viewModel)
      Handles the button clicked event.
      Parameters:
      viewModel - the view model of the event sender.
    • createViewModels

      protected void createViewModels()
      Description copied from class: Component
      Creates the view models of this component. Override it to provide a view models of this component.
      Overrides:
      createViewModels in class AbstractControlComponent<M extends IModel,P extends IParameterization,VM extends SelectViewModel>
    • createButtons

      protected Collection<ButtonItemViewModel> createButtons()
      Creates a collection of the ButtonItemViewModel that will be added to the component view model.
      Returns:
      the collection of the ButtonItemViewModel.
    • createSelectButtonItem

      protected static ButtonItemViewModel createSelectButtonItem()
      Returns:
      the newly created ButtonItemViewModel with the fields filled in accordance with the select button.
    • createClearButtonItem

      protected static ButtonItemViewModel createClearButtonItem()
      Returns:
      the newly created ButtonItemViewModel with the fields filled in accordance with the clear button.
    • createOpenButtonItem

      protected static ButtonItemViewModel createOpenButtonItem()
      Returns:
      the newly created ButtonItemViewModel with the fields filled in accordance with the open button (the magnifier icon).
    • createButtonItem

      protected static ButtonItemViewModel createButtonItem(String commandId, String tooltip, org.eclipse.swt.graphics.Image image)
      Create a new button view model with the provided parameters.
      Parameters:
      commandId - the command context id, cannot be null
      tooltip - the command tooltip message, cannot be null
      image - the command action image, cannot be null
      Returns:
      a new button view model with the provided parameters, never null