com.vaadin.client.ui.

Class VTwinColSelect

  • java.lang.Object
    • com.google.gwt.user.client.ui.UIObject
      • com.google.gwt.user.client.ui.Widget
        • com.google.gwt.user.client.ui.Composite
          • com.vaadin.client.ui.VTwinColSelect
  • All Implemented Interfaces:

    com.google.gwt.event.dom.client.ClickHandler, com.google.gwt.event.dom.client.DoubleClickHandler, com.google.gwt.event.dom.client.KeyDownHandler, com.google.gwt.event.dom.client.MouseDownHandler, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.EventHandler, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasEnabled, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.IsRenderable, com.google.gwt.user.client.ui.IsWidget, AbstractMultiSelectConnector.MultiSelectWidget, Focusable, Field, SubPartAware

    public class VTwinColSelect
    extends com.google.gwt.user.client.ui.Composite
    implements AbstractMultiSelectConnector.MultiSelectWidget, Field, com.google.gwt.event.dom.client.ClickHandler, Focusable, com.google.gwt.user.client.ui.HasEnabled, com.google.gwt.event.dom.client.KeyDownHandler, com.google.gwt.event.dom.client.MouseDownHandler, com.google.gwt.event.dom.client.DoubleClickHandler, SubPartAware

    A list builder widget that has two selects; one for selectable options, another for selected options, and buttons for selecting and deselecting the items.

    Author:

    Vaadin Ltd

    • Nested Class Summary

      Nested Classes
      Modifier and Type Class Description
      class  VTwinColSelect.DoubleClickListBox

      A multiselect ListBox which catches double clicks.

      • Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject

        com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
    • Field Summary

      Fields
      Modifier and Type Field Description
      static String CLASSNAME

      Primary style name for twin col select.

      • Fields inherited from class com.google.gwt.user.client.ui.UIObject

        DEBUG_ID_PREFIX
    • Constructor Summary

      Constructors
      Constructor Description
      VTwinColSelect()

      Constructs a new VTwinColSelect.

    • Method Summary

      All Methods
      Modifier and Type Method Description
      Registration addSelectionChangeListener​(BiConsumer<Set<String>,​Set<String>> listener)

      Adds a selection change listener the select.

      void clearInternalHeights()

      For internal use only.

      void clearInternalWidths()

      For internal use only.

      void focus()

      Sets focus to this widget.

      com.google.gwt.user.client.ui.Widget getCaptionWrapper()

      For internal use only.

      protected int getNavigationSelectKey()

      Get the key that selects an item in the table.

      protected com.google.gwt.user.client.ui.HTML getOptionsCaption()

      Gets the options caption HTML Widget.

      int getRows()

      Returns the number of visible items for the list boxes.

      protected com.google.gwt.user.client.ui.HTML getSelectionsCaption()

      Gets the selections caption HTML widget.

      com.google.gwt.user.client.Element getSubPartElement​(String subPart)

      Locates an element inside a component using the identifier provided in subPart.

      String getSubPartName​(com.google.gwt.user.client.Element subElement)

      Provides an identifier that identifies the element within the component.

      boolean isEnabled()  
      boolean isReadOnly()

      Returns true if this twin column select is in read only mode, false if not.

      void onClick​(com.google.gwt.event.dom.client.ClickEvent event)  
      void onDoubleClick​(com.google.gwt.event.dom.client.DoubleClickEvent event)  
      void onKeyDown​(com.google.gwt.event.dom.client.KeyDownEvent event)  
      void onMouseDown​(com.google.gwt.event.dom.client.MouseDownEvent event)  
      void setEnabled​(boolean enabled)  
      void setInternalHeights()

      For internal use only.

      void setInternalWidths()

      For internal use only.

      void setItems​(List<elemental.json.JsonObject> items)

      Sets the given items to the select.

      void setReadOnly​(boolean readOnly)

      Sets this twin column select as read only, meaning selection cannot be changed.

      void setRows​(int rows)

      Sets the number of visible items for the list boxes.

      void setTabIndex​(int tabIndex)

      Sets the tab index.

      void updateCaptions​(String leftCaption, String rightCaption)

      Updates the captions above the left (options) and right (selections) columns.

      • Methods inherited from class com.google.gwt.user.client.ui.Composite

        claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
      • Methods inherited from class com.google.gwt.user.client.ui.Widget

        addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
      • Methods inherited from class com.google.gwt.user.client.ui.UIObject

        addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
    • Constructor Detail

      • VTwinColSelect

        public VTwinColSelect()

        Constructs a new VTwinColSelect.

    • Method Detail

      • getOptionsCaption

        protected com.google.gwt.user.client.ui.HTML getOptionsCaption()

        Gets the options caption HTML Widget.

        Returns:

        the options caption widget

      • getSelectionsCaption

        protected com.google.gwt.user.client.ui.HTML getSelectionsCaption()

        Gets the selections caption HTML widget.

        Returns:

        the selections caption widget

      • getCaptionWrapper

        public com.google.gwt.user.client.ui.Widget getCaptionWrapper()

        For internal use only. May be removed or replaced in the future.

        Returns:

        the caption wrapper widget

      • setRows

        public void setRows​(int rows)

        Sets the number of visible items for the list boxes.

        Parameters:

        rows - the number of items to show

        See Also:

        ListBox.setVisibleItemCount(int)

      • getRows

        public int getRows()

        Returns the number of visible items for the list boxes.

        Returns:

        the number of items to show

        See Also:

        ListBox.setVisibleItemCount(int)

      • updateCaptions

        public void updateCaptions​(String leftCaption,
                                   String rightCaption)

        Updates the captions above the left (options) and right (selections) columns. {code null} value clear the caption.

        Parameters:

        leftCaption - the left caption to set, or null to clear

        rightCaption - the right caption to set, or null to clear

      • onClick

        public void onClick​(com.google.gwt.event.dom.client.ClickEvent event)

        Specified by:

        onClick in interface com.google.gwt.event.dom.client.ClickHandler

      • clearInternalHeights

        public void clearInternalHeights()

        For internal use only. May be removed or replaced in the future.

      • setInternalHeights

        public void setInternalHeights()

        For internal use only. May be removed or replaced in the future.

      • clearInternalWidths

        public void clearInternalWidths()

        For internal use only. May be removed or replaced in the future.

      • setInternalWidths

        public void setInternalWidths()

        For internal use only. May be removed or replaced in the future.

      • setTabIndex

        public void setTabIndex​(int tabIndex)

        Sets the tab index.

        Parameters:

        tabIndex - the tab index to set

      • setReadOnly

        public void setReadOnly​(boolean readOnly)

        Sets this twin column select as read only, meaning selection cannot be changed.

        Parameters:

        readOnly - true for read only, false for not read only

      • isReadOnly

        public boolean isReadOnly()

        Returns true if this twin column select is in read only mode, false if not.

        Returns:

        true for read only, false for not read only

      • setEnabled

        public void setEnabled​(boolean enabled)

        Specified by:

        setEnabled in interface com.google.gwt.user.client.ui.HasEnabled

      • isEnabled

        public boolean isEnabled()

        Specified by:

        isEnabled in interface com.google.gwt.user.client.ui.HasEnabled

      • focus

        public void focus()

        Description copied from interface: Focusable

        Sets focus to this widget.

        Specified by:

        focus in interface Focusable

      • getNavigationSelectKey

        protected int getNavigationSelectKey()

        Get the key that selects an item in the table. By default it is the Enter key but by overriding this you can change the key to whatever you want.

        Returns:

        the key that selects an item

      • onKeyDown

        public void onKeyDown​(com.google.gwt.event.dom.client.KeyDownEvent event)

        Specified by:

        onKeyDown in interface com.google.gwt.event.dom.client.KeyDownHandler

      • onMouseDown

        public void onMouseDown​(com.google.gwt.event.dom.client.MouseDownEvent event)

        Specified by:

        onMouseDown in interface com.google.gwt.event.dom.client.MouseDownHandler

      • onDoubleClick

        public void onDoubleClick​(com.google.gwt.event.dom.client.DoubleClickEvent event)

        Specified by:

        onDoubleClick in interface com.google.gwt.event.dom.client.DoubleClickHandler

      • getSubPartElement

        public com.google.gwt.user.client.Element getSubPartElement​(String subPart)

        Description copied from interface: SubPartAware

        Locates an element inside a component using the identifier provided in subPart. The subPart identifier is component specific and may be any string of characters, numbers, space characters and brackets.

        Specified by:

        getSubPartElement in interface SubPartAware

        Parameters:

        subPart - The identifier for the element inside the component

        Returns:

        The element identified by subPart or null if the element could not be found.

      • getSubPartName

        public String getSubPartName​(com.google.gwt.user.client.Element subElement)

        Description copied from interface: SubPartAware

        Provides an identifier that identifies the element within the component. The subElement is a part of the component and must never be null.

        Note! getSubPartElement(getSubPartName(element)) == element is not always true. A component can choose to provide a more generic identifier for any given element if the results of all interactions with subElement are the same as interactions with the element identified by the return value. For example a button can return an identifier for the root element even though a DIV inside the button was passed as subElement because interactions with the DIV and the root button element produce the same result.

        Specified by:

        getSubPartName in interface SubPartAware

        Parameters:

        subElement - The element the identifier string should uniquely identify

        Returns:

        An identifier that uniquely identifies subElement or null if no identifier could be provided.