Class AttributesComboViewer

  • All Implemented Interfaces:
    org.eclipse.jface.viewers.IInputProvider, org.eclipse.jface.viewers.IInputSelectionProvider, org.eclipse.jface.viewers.IPostSelectionProvider, org.eclipse.jface.viewers.ISelectionProvider

    public class AttributesComboViewer
    extends org.eclipse.jface.viewers.ComboViewer
    A combobox for displaying and selecting attributes. Attributes may be grouped.
    Author:
    Holger Eichelberger
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  AttributesComboViewer.IGroupValueProvider
      A value provider for the group value (to be considered at runtime).
      • Nested classes/interfaces inherited from class org.eclipse.jface.viewers.StructuredViewer

        org.eclipse.jface.viewers.StructuredViewer.ColorAndFontCollector, org.eclipse.jface.viewers.StructuredViewer.ColorAndFontCollectorWithProviders
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getKey​(Attribute attribute)
      Returns an internal key for retrieving duplicates.
      static java.lang.String getQualifiedAppendix​(Attribute attribute)
      Returns the display appendix for the qualified name.
      Attribute getSelectedAttribute()
      Returns the selected attribute.
      boolean populate​(Project project)
      Populates the view with attributes from project.
      void setGroupValueProvider​(AttributesComboViewer.IGroupValueProvider groupValueProvider)
      Changes the group value provider.
      • Methods inherited from class org.eclipse.jface.viewers.ComboViewer

        getCCombo, getCombo, getControl, listAdd, listDeselectAll, listGetItemCount, listGetSelectionIndices, listRemove, listRemoveAll, listSetItem, listSetItems, listSetSelection, listShowSelection, reveal
      • Methods inherited from class org.eclipse.jface.viewers.AbstractListViewer

        add, add, doFindInputItem, doFindItem, doUpdateItem, getElementAt, getLabelProvider, getSelectionFromWidget, indexForElement, inputChanged, insert, internalRefresh, listGetTopIndex, listSetTopIndex, remove, remove, setLabelProvider, setSelectionToWidget
      • Methods inherited from class org.eclipse.jface.viewers.StructuredViewer

        addDoubleClickListener, addDragSupport, addDropSupport, addFilter, addOpenListener, addPostSelectionChangedListener, assertContentProviderType, assertElementsNotNull, associate, buildLabel, disassociate, equals, filter, findItem, findItems, fireDoubleClick, fireOpen, firePostSelectionChanged, getColorAndFontCollector, getComparator, getComparer, getFilteredChildren, getFilters, getItem, getRawChildren, getRoot, getSelection, getSortedChildren, getSorter, getStructuredSelection, handleDispose, handleDoubleSelect, handleInvalidSelection, handleLabelProviderChanged, handleOpen, handlePostSelect, handleSelect, hasFilters, hookControl, internalRefresh, internalUpdate, mapElement, needsRefilter, preservingSelection, refresh, refresh, refresh, refresh, refreshItem, removeDoubleClickListener, removeFilter, removeOpenListener, removePostSelectionChangedListener, resetFilters, setComparator, setComparer, setContentProvider, setFilters, setInput, setSelection, setSelectionToWidget, setSorter, setUseHashlookup, testFindItem, testFindItems, unmapAllElements, unmapElement, unmapElement, update, update, updateItem, updateSelection, usingElementMap
      • Methods inherited from class org.eclipse.jface.viewers.ContentViewer

        getContentProvider, getInput, labelProviderChanged
      • Methods inherited from class org.eclipse.jface.viewers.Viewer

        addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelection
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.eclipse.jface.viewers.ISelectionProvider

        addSelectionChangedListener, removeSelectionChangedListener, setSelection
    • Constructor Detail

      • AttributesComboViewer

        public AttributesComboViewer​(org.eclipse.swt.widgets.Composite parent)
        Creates a viewer without value provider and without "all" entry.
        Parameters:
        parent - the parent composite
      • AttributesComboViewer

        public AttributesComboViewer​(org.eclipse.swt.widgets.Composite parent,
                                     boolean all)
        Creates a viewer without value provider.
        Parameters:
        parent - the parent composite
        all - whether an entry for "all" attributes shall be displayed
      • AttributesComboViewer

        public AttributesComboViewer​(org.eclipse.swt.widgets.Composite parent,
                                     AttributesComboViewer.IGroupValueProvider groupValueProvider,
                                     boolean all)
        Creates a viewer.
        Parameters:
        parent - the parent composite
        groupValueProvider - the group value provider (may be null)
        all - whether an entry for "all" attributes shall be displayed
    • Method Detail

      • setGroupValueProvider

        public void setGroupValueProvider​(AttributesComboViewer.IGroupValueProvider groupValueProvider)
        Changes the group value provider.
        Parameters:
        groupValueProvider - the group value provider (may be null)
      • populate

        public boolean populate​(Project project)
        Populates the view with attributes from project.
        Parameters:
        project - the project to take the attributes from
        Returns:
        true if the view was populated, false if the view is empty
      • getKey

        public static java.lang.String getKey​(Attribute attribute)
        Returns an internal key for retrieving duplicates.
        Parameters:
        attribute - the attribute to return the key for
        Returns:
        the key
      • getQualifiedAppendix

        public static java.lang.String getQualifiedAppendix​(Attribute attribute)
        Returns the display appendix for the qualified name.
        Parameters:
        attribute - the attribute to return the appendix for
        Returns:
        the appendix
      • getSelectedAttribute

        public Attribute getSelectedAttribute()
        Returns the selected attribute.
        Returns:
        the selected attribute, null if none was selected