Class XViewer

java.lang.Object
org.eclipse.jface.viewers.Viewer
org.eclipse.jface.viewers.ContentViewer
org.eclipse.jface.viewers.StructuredViewer
org.eclipse.jface.viewers.ColumnViewer
org.eclipse.jface.viewers.AbstractTreeViewer
org.eclipse.jface.viewers.TreeViewer
org.eclipse.nebula.widgets.xviewer.XViewer
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 XViewer
extends org.eclipse.jface.viewers.TreeViewer
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.eclipse.jface.viewers.StructuredViewer

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

    Fields 
    Modifier and Type Field Description
    (package private) org.eclipse.swt.widgets.Listener displayFocusListener  
    (package private) org.eclipse.swt.widgets.Listener displayKeysListener  
    static java.lang.String MENU_GROUP_POST  
    static java.lang.String MENU_GROUP_PRE  
    protected IXViewerFactory xViewerFactory  

    Fields inherited from class org.eclipse.jface.viewers.AbstractTreeViewer

    ALL_LEVELS

    Fields inherited from class org.eclipse.jface.viewers.Viewer

    WIDGET_DATA_KEY
  • Constructor Summary

    Constructors 
    Constructor Description
    XViewer​(org.eclipse.swt.widgets.Composite parent, int style, IXViewerFactory xViewerFactory)  
    XViewer​(org.eclipse.swt.widgets.Composite parent, int style, IXViewerFactory xViewerFactory, boolean filterRealTime, boolean searchRealTime)  
    XViewer​(org.eclipse.swt.widgets.Tree tree, IXViewerFactory xViewerFactory)  
    XViewer​(org.eclipse.swt.widgets.Tree tree, IXViewerFactory xViewerFactory, boolean filterRealTime, boolean searchRealTime)  
  • Method Summary

    Modifier and Type Method Description
    void addCustomizeToViewToolbar​(org.eclipse.jface.action.IToolBarManager toolbarManager)  
    void addCustomizeToViewToolbar​(org.eclipse.ui.part.ViewPart viewPart)  
    protected void createSupportWidgets​(org.eclipse.swt.widgets.Composite parent)  
    protected org.eclipse.jface.viewers.ColumnViewerEditor createViewerEditor()  
    void dispose()  
    ColumnFilterDataUI getColumnFilterDataUI()  
    java.lang.Integer getColumnNumberUnderMouseClick​(org.eclipse.swt.graphics.Point point)  
    java.lang.String getColumnText​(java.lang.Object element, int col)  
    org.eclipse.swt.widgets.TreeColumn getColumnUnderMouseClick​(org.eclipse.swt.graphics.Point point)  
    java.util.Collection<XViewerComputedColumn> getComputedColumns()  
    java.util.Collection<XViewerComputedColumn> getComputedColumns​(XViewerColumn xCol)  
    int getCurrentColumnWidth​(XViewerColumn xCol)  
    org.eclipse.jface.action.Action getCustomizeAction()  
    org.eclipse.jface.action.Action getCustomizeActionWithoutDropDown()  
    CustomizeManager getCustomizeMgr()  
    FilterDataUI getFilterDataUI()  
    org.eclipse.swt.widgets.TreeItem getItemUnderMouseClick​(org.eclipse.swt.graphics.Point point)  
    org.eclipse.jface.action.MenuManager getMenuManager()  
    XViewerMouseListener getMouseListener()  
    java.util.Map<java.lang.String,​java.lang.Long> getPreComputeElapsedTime()  
    org.eclipse.swt.widgets.TreeColumn getRightClickSelectedColumn()  
    java.lang.Integer getRightClickSelectedColumnNum()  
    org.eclipse.swt.widgets.TreeItem getRightClickSelectedItem()  
    (package private) org.eclipse.swt.graphics.Color getSearchMatchColor()  
    org.eclipse.swt.custom.StyledText getStatusLabel()  
    java.lang.String getStatusString()
    Override this to add information to the status string. eg. extra filters etc.
    java.lang.String getViewerNamespace()  
    int getVisibleItemCount()  
    int getVisibleItemCount​(org.eclipse.swt.widgets.TreeItem[] items)  
    java.util.List<org.eclipse.swt.widgets.TreeItem> getVisibleItems()  
    XViewerColumn getXTreeColumn​(int columnIndex)  
    IXViewerFactory getXViewerFactory()  
    XViewerGradient getxViewerGradient()  
    XViewerTextFilter getXViewerTextFilter()
    Override to provide extended filter capabilities
    boolean handleAltLeftClick​(org.eclipse.swt.widgets.TreeColumn treeColumn, org.eclipse.swt.widgets.TreeItem treeItem)
    Will be called when Alt-Left-Click is done within table cell
    void handleColumnMultiEdit​(org.eclipse.swt.widgets.TreeColumn treeColumn, java.util.Collection<org.eclipse.swt.widgets.TreeItem> treeItems)  
    void handleDoubleClick()  
    void handleDoubleClick​(org.eclipse.swt.widgets.TreeColumn col, org.eclipse.swt.widgets.TreeItem item)  
    boolean handleLeftClick​(org.eclipse.swt.widgets.TreeColumn treeColumn, org.eclipse.swt.widgets.TreeItem treeItem)
    Will be called when a cell obtains a mouse left-click.
    boolean handleLeftClickInIconArea​(org.eclipse.swt.widgets.TreeColumn treeColumn, org.eclipse.swt.widgets.TreeItem treeItem)
    Will be called when click is within the first 18 pixels of the cell rectangle where the icon would be.
    boolean isAltKeyDown()  
    boolean isColumnMultiEditable​(org.eclipse.swt.widgets.TreeColumn treeColumn, java.util.Collection<org.eclipse.swt.widgets.TreeItem> treeItems)  
    boolean isColumnMultiEditEnabled()  
    boolean isCtrlKeyDown()  
    boolean isDebugLoading()  
    boolean isFiltered()  
    boolean isForcePend()  
    boolean isRemoveItemsMenuOptionEnabled()
    If true, "Remove Selected from View" and "Remove Non-Selected from View" menu options will be shown.
    boolean isSearch()  
    void load​(java.util.Collection<java.lang.Object> objects)
    Deprecated.
    void processRightClickMouseEvent​(org.eclipse.swt.graphics.Point point)
    Mouse clicks can happen in table via XViewerMouseListener or in menu area via XViewerMenuDetectListener.
    void refresh()  
    void refresh​(boolean updateLabels)  
    void refresh​(java.lang.Object element)  
    void refresh​(java.lang.Object element, boolean updateLabels)  
    void refreshColumn​(java.lang.String columnId)
    Refresh only single column using normal label provider mechanism.
    void refreshColumn​(XViewerColumn column)
    Refresh only single column using normal label provider mechanism.
    void refreshColumnsWithPreCompute()  
    void refreshColumnsWithPreCompute​(java.lang.Object input)  
    void remove​(java.util.Collection<java.lang.Object> objects)
    Override this method if need to perform other tasks upon remove
    void resetDefaultSorter()  
    (package private) boolean searchMatch​(java.lang.String text)  
    void setColumnMultiEditEnabled​(boolean columnMultiEditEnabled)  
    void setDebugLoading​(boolean debugLoading)  
    void setEnabled​(boolean arg)  
    void setForcePend​(boolean forcePend)  
    void setInputXViewer​(java.lang.Object input)
    Called to set the input to the XViewer.
    void setLabelProvider​(org.eclipse.jface.viewers.IBaseLabelProvider labelProvider)  
    void setLoading​(boolean loading)  
    void setSorter​(org.eclipse.jface.viewers.ViewerSorter sorter)  
    void setXViewerEditAdapter​(XViewerEditAdapter editAdapter)  
    void setxViewerGradient​(XViewerGradient xViewerGradient)  
    void updateMenuActionsForHeader()  
    void updateMenuActionsForTable()  
    void updateStatusLabel()  

    Methods inherited from class org.eclipse.jface.viewers.TreeViewer

    addTreeListener, assertContentProviderType, disassociate, doGetColumnCount, editElement, getChild, getChildren, getColumnViewerOwner, getControl, getExpanded, getItemAt, getItemCount, getItemCount, getItems, getLabelProvider, getParentElement, getParentItem, getRawChildren, getSelection, getTree, getViewerRowFromItem, handleTreeCollapse, handleTreeExpand, hookControl, internalAdd, internalInitializeTree, internalRefreshStruct, isExpandable, mapElement, newItem, remove, removeAll, replace, setChildCount, setContentProvider, setExpanded, setHasChildren, setSelection, setSelection, showItem, updatePlus

    Methods inherited from class org.eclipse.jface.viewers.AbstractTreeViewer

    add, add, addSelectionListener, addTreeListener, associate, buildLabel, collapseAll, collapseToLevel, createChildren, createTreeItem, doFindInputItem, doFindItem, doUpdateItem, doUpdateItem, expandAll, expandAll, expandToLevel, expandToLevel, expandToLevel, expandToLevel, fireTreeCollapsed, fireTreeExpanded, getAutoExpandLevel, getChildren, getExpandedElements, getExpandedState, getExpandedTreePaths, getNextItem, getPreviousItem, getSelection, getSelectionFromWidget, getSortedChildren, getStructuredSelection, getTreePathFromItem, getVisibleExpandedElements, handleDoubleSelect, indexForElement, inputChanged, insert, internalCollapseToLevel, internalExpand, internalExpandToLevel, internalFindItems, internalGetWidgetToSelect, internalIsInputOrEmptyPath, internalRefresh, internalRefresh, internalRefresh, internalRemove, internalRemove, isSameSelection, labelProviderChanged, remove, remove, remove, removeTreeListener, reveal, scrollDown, scrollUp, setAutoExpandLevel, setExpandedElements, setExpandedState, setExpandedTreePaths, setExpandPreCheckFilters, setSelectionToWidget, setSelectionToWidget, updateChildren

    Methods inherited from class org.eclipse.jface.viewers.ColumnViewer

    applyEditorValue, cancelEditing, checkBusy, getCell, getCellEditors, getCellModifier, getColumnProperties, getColumnViewerEditor, getItem, getLabelProvider, getViewerRow, handleDispose, hookEditingSupport, isBusy, isCellEditorActive, setBusy, setCellEditors, setCellModifier, setColumnProperties, setColumnViewerEditor, triggerEditorActivationEvent, update

    Methods inherited from class org.eclipse.jface.viewers.StructuredViewer

    addDoubleClickListener, addDragSupport, addDropSupport, addFilter, addOpenListener, addPostSelectionChangedListener, assertElementsNotNull, equals, filter, findItem, findItems, fireDoubleClick, fireOpen, firePostSelectionChanged, getColorAndFontCollector, getComparator, getComparer, getFilteredChildren, getFilters, getRoot, getSorter, handleInvalidSelection, handleLabelProviderChanged, handleOpen, handlePostSelect, handleSelect, hasFilters, internalUpdate, needsRefilter, preservingSelection, refreshItem, removeDoubleClickListener, removeFilter, removeOpenListener, removePostSelectionChangedListener, resetFilters, setComparator, setComparer, setFilters, setInput, setUseHashlookup, testFindItem, testFindItems, unmapAllElements, unmapElement, unmapElement, update, updateItem, updateSelection, usingElementMap

    Methods inherited from class org.eclipse.jface.viewers.ContentViewer

    getContentProvider, getInput

    Methods inherited from class org.eclipse.jface.viewers.Viewer

    addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, 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
  • Field Details

  • Constructor Details

    • XViewer

      public XViewer​(org.eclipse.swt.widgets.Composite parent, int style, IXViewerFactory xViewerFactory)
    • XViewer

      public XViewer​(org.eclipse.swt.widgets.Tree tree, IXViewerFactory xViewerFactory)
    • XViewer

      public XViewer​(org.eclipse.swt.widgets.Composite parent, int style, IXViewerFactory xViewerFactory, boolean filterRealTime, boolean searchRealTime)
    • XViewer

      public XViewer​(org.eclipse.swt.widgets.Tree tree, IXViewerFactory xViewerFactory, boolean filterRealTime, boolean searchRealTime)
  • Method Details

    • createViewerEditor

      protected org.eclipse.jface.viewers.ColumnViewerEditor createViewerEditor()
      Overrides:
      createViewerEditor in class org.eclipse.jface.viewers.TreeViewer
    • getComputedColumns

      public java.util.Collection<XViewerComputedColumn> getComputedColumns()
    • getComputedColumns

      public java.util.Collection<XViewerComputedColumn> getComputedColumns​(XViewerColumn xCol)
    • dispose

      public void dispose()
    • setLabelProvider

      public void setLabelProvider​(org.eclipse.jface.viewers.IBaseLabelProvider labelProvider)
      Overrides:
      setLabelProvider in class org.eclipse.jface.viewers.ColumnViewer
    • addCustomizeToViewToolbar

      public void addCustomizeToViewToolbar​(org.eclipse.ui.part.ViewPart viewPart)
    • updateMenuActionsForTable

      public void updateMenuActionsForTable()
    • updateMenuActionsForHeader

      public void updateMenuActionsForHeader()
    • getCustomizeAction

      public org.eclipse.jface.action.Action getCustomizeAction()
    • getCustomizeActionWithoutDropDown

      public org.eclipse.jface.action.Action getCustomizeActionWithoutDropDown()
    • addCustomizeToViewToolbar

      public void addCustomizeToViewToolbar​(org.eclipse.jface.action.IToolBarManager toolbarManager)
    • createSupportWidgets

      protected void createSupportWidgets​(org.eclipse.swt.widgets.Composite parent)
    • handleDoubleClick

      public void handleDoubleClick​(org.eclipse.swt.widgets.TreeColumn col, org.eclipse.swt.widgets.TreeItem item)
    • handleDoubleClick

      public void handleDoubleClick()
    • getCurrentColumnWidth

      public int getCurrentColumnWidth​(XViewerColumn xCol)
    • setInputXViewer

      public final void setInputXViewer​(java.lang.Object input)
      Called to set the input to the XViewer. This method MUST be used to ensure that XViewer loads properly. Especially with the use of IXViewerPreComputedColumn.
    • refreshColumnsWithPreCompute

      public void refreshColumnsWithPreCompute()
    • refreshColumnsWithPreCompute

      public void refreshColumnsWithPreCompute​(java.lang.Object input)
    • handleAltLeftClick

      public boolean handleAltLeftClick​(org.eclipse.swt.widgets.TreeColumn treeColumn, org.eclipse.swt.widgets.TreeItem treeItem)
      Will be called when Alt-Left-Click is done within table cell
      Returns:
      true if handled
    • handleLeftClickInIconArea

      public boolean handleLeftClickInIconArea​(org.eclipse.swt.widgets.TreeColumn treeColumn, org.eclipse.swt.widgets.TreeItem treeItem)
      Will be called when click is within the first 18 pixels of the cell rectangle where the icon would be. This method will be called in addition to handleLeftClick since both are true.
      Returns:
      true if handled
    • handleLeftClick

      public boolean handleLeftClick​(org.eclipse.swt.widgets.TreeColumn treeColumn, org.eclipse.swt.widgets.TreeItem treeItem)
      Will be called when a cell obtains a mouse left-click. This method will be called in addition to handleLeftClickInIconArea if both are true
    • handleColumnMultiEdit

      public void handleColumnMultiEdit​(org.eclipse.swt.widgets.TreeColumn treeColumn, java.util.Collection<org.eclipse.swt.widgets.TreeItem> treeItems)
    • isColumnMultiEditable

      public boolean isColumnMultiEditable​(org.eclipse.swt.widgets.TreeColumn treeColumn, java.util.Collection<org.eclipse.swt.widgets.TreeItem> treeItems)
    • isRemoveItemsMenuOptionEnabled

      public boolean isRemoveItemsMenuOptionEnabled()
      If true, "Remove Selected from View" and "Remove Non-Selected from View" menu options will be shown.
    • getXTreeColumn

      public XViewerColumn getXTreeColumn​(int columnIndex)
    • resetDefaultSorter

      public void resetDefaultSorter()
    • remove

      public void remove​(java.util.Collection<java.lang.Object> objects)
      Override this method if need to perform other tasks upon remove
    • load

      @Deprecated public void load​(java.util.Collection<java.lang.Object> objects)
      Deprecated.
      setInputXViewer(Object input) should be called for setting input to XViewer.
      Parameters:
      objects -
    • setSorter

      public void setSorter​(org.eclipse.jface.viewers.ViewerSorter sorter)
      Overrides:
      setSorter in class org.eclipse.jface.viewers.StructuredViewer
    • getMenuManager

      public org.eclipse.jface.action.MenuManager getMenuManager()
    • getVisibleItemCount

      public int getVisibleItemCount​(org.eclipse.swt.widgets.TreeItem[] items)
    • getVisibleItemCount

      public int getVisibleItemCount()
    • getVisibleItems

      public java.util.List<org.eclipse.swt.widgets.TreeItem> getVisibleItems()
    • refresh

      public void refresh()
      Overrides:
      refresh in class org.eclipse.jface.viewers.StructuredViewer
    • isFiltered

      public boolean isFiltered()
    • refresh

      public void refresh​(boolean updateLabels)
      Overrides:
      refresh in class org.eclipse.jface.viewers.StructuredViewer
    • refresh

      public void refresh​(java.lang.Object element, boolean updateLabels)
      Overrides:
      refresh in class org.eclipse.jface.viewers.ColumnViewer
    • refresh

      public void refresh​(java.lang.Object element)
      Overrides:
      refresh in class org.eclipse.jface.viewers.ColumnViewer
    • getStatusString

      public java.lang.String getStatusString()
      Override this to add information to the status string. eg. extra filters etc.
    • updateStatusLabel

      public void updateStatusLabel()
    • setLoading

      public void setLoading​(boolean loading)
    • getViewerNamespace

      public java.lang.String getViewerNamespace()
    • getXViewerFactory

      public IXViewerFactory getXViewerFactory()
    • getStatusLabel

      public org.eclipse.swt.custom.StyledText getStatusLabel()
    • getFilterDataUI

      public FilterDataUI getFilterDataUI()
    • isColumnMultiEditEnabled

      public boolean isColumnMultiEditEnabled()
    • setColumnMultiEditEnabled

      public void setColumnMultiEditEnabled​(boolean columnMultiEditEnabled)
    • setEnabled

      public void setEnabled​(boolean arg)
    • getRightClickSelectedColumn

      public org.eclipse.swt.widgets.TreeColumn getRightClickSelectedColumn()
    • getRightClickSelectedItem

      public org.eclipse.swt.widgets.TreeItem getRightClickSelectedItem()
    • getRightClickSelectedColumnNum

      public java.lang.Integer getRightClickSelectedColumnNum()
    • getCustomizeMgr

      public CustomizeManager getCustomizeMgr()
    • isCtrlKeyDown

      public boolean isCtrlKeyDown()
    • isAltKeyDown

      public boolean isAltKeyDown()
    • searchMatch

      boolean searchMatch​(java.lang.String text)
    • getSearchMatchColor

      org.eclipse.swt.graphics.Color getSearchMatchColor()
    • isSearch

      public boolean isSearch()
    • getColumnText

      public java.lang.String getColumnText​(java.lang.Object element, int col)
    • processRightClickMouseEvent

      public void processRightClickMouseEvent​(org.eclipse.swt.graphics.Point point)
      Mouse clicks can happen in table via XViewerMouseListener or in menu area via XViewerMenuDetectListener. Both are processed here to use in UI
    • getColumnUnderMouseClick

      public org.eclipse.swt.widgets.TreeColumn getColumnUnderMouseClick​(org.eclipse.swt.graphics.Point point) throws java.lang.ArrayIndexOutOfBoundsException
      Throws:
      java.lang.ArrayIndexOutOfBoundsException
    • getColumnNumberUnderMouseClick

      public java.lang.Integer getColumnNumberUnderMouseClick​(org.eclipse.swt.graphics.Point point)
    • getItemUnderMouseClick

      public org.eclipse.swt.widgets.TreeItem getItemUnderMouseClick​(org.eclipse.swt.graphics.Point point) throws java.lang.ArrayIndexOutOfBoundsException
      Throws:
      java.lang.ArrayIndexOutOfBoundsException
    • refreshColumn

      public void refreshColumn​(XViewerColumn column)
      Refresh only single column using normal label provider mechanism. This can be called after normal loading and after columns compute their input in the background.
    • refreshColumn

      public void refreshColumn​(java.lang.String columnId)
      Refresh only single column using normal label provider mechanism. This can be called after normal loading and after columns compute their input in the background.
    • getXViewerTextFilter

      public XViewerTextFilter getXViewerTextFilter()
      Override to provide extended filter capabilities
    • getxViewerGradient

      public XViewerGradient getxViewerGradient()
    • setxViewerGradient

      public void setxViewerGradient​(XViewerGradient xViewerGradient)
    • setXViewerEditAdapter

      public void setXViewerEditAdapter​(XViewerEditAdapter editAdapter)
    • getColumnFilterDataUI

      public ColumnFilterDataUI getColumnFilterDataUI()
    • getMouseListener

      public XViewerMouseListener getMouseListener()
    • isForcePend

      public boolean isForcePend()
    • setForcePend

      public void setForcePend​(boolean forcePend)
    • isDebugLoading

      public boolean isDebugLoading()
    • setDebugLoading

      public void setDebugLoading​(boolean debugLoading)
    • getPreComputeElapsedTime

      public java.util.Map<java.lang.String,​java.lang.Long> getPreComputeElapsedTime()