Class DtComparisonView

java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
com._1c.g5.v8.dt.compare.ui.editor.DtComparisonView
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

public class DtComparisonView extends org.eclipse.swt.widgets.Composite
View for DT projects' comparison process. Contains comparison tree and filter control.
  • Field Summary

    Fields inherited from class org.eclipse.swt.widgets.Control

    handle
  • Constructor Summary

    Constructors
    Constructor
    Description
    DtComparisonView(org.eclipse.swt.widgets.Composite parent, DtComparisonViewContext context)
    Creates a new view instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds the viewer filter.
    void
     
    void
    expandToLevel(int level)
    Expands the comparison tree up to the specified level.
    org.eclipse.swt.graphics.Color
    Gets the color for 'node has diffs' case.
    org.eclipse.swt.graphics.Color
    Gets the color for 'node has only main object' case.
    org.eclipse.swt.graphics.Color
    Gets the color for 'node has only other object' case.
    Returns the current named viewer filter.
    Returns the comparison tree control.
    Gets search adapter.
    boolean
    Determines whether the read-only mode is enabled.
    void
    openChildComparisonDialog(org.eclipse.jface.dialogs.Dialog childComparisonDialog)
    Opens the child DT comparison dialog.
    void
    Refreshes this view completely.
    void
    Refreshes given node in this view.
    void
    refresh(Collection<IPartialModelNode> nodesToRefreshWithoutCheckingChildren, Collection<IPartialModelNode> nodesToRefresh)
    Refreshes the given collection of nodes in this view.
    void
    Sets label on ComparisonTreeControl reporting error during comparison.
    void
    Resets all tree viewer filters.
    void
    setComparisonTreeReadyForSearch(boolean isComparisonTreeReady)
    Sets readiness of the tree to be searched through.
    void
    Sets new search mediator for tree view.
    void
    Sets the specified filters to the tree view.
    void
    Sets the tree viewer input.
    void
    setReadOnly(boolean value)
    Sets the read-only mode of the view to the specified value.

    Methods inherited from class org.eclipse.swt.widgets.Composite

    changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toString

    Methods inherited from class org.eclipse.swt.widgets.Scrollable

    computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar

    Methods inherited from class org.eclipse.swt.widgets.Control

    addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update

    Methods inherited from class org.eclipse.swt.widgets.Widget

    addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.eclipse.swt.graphics.Drawable

    isAutoScalable
  • Constructor Details

    • DtComparisonView

      public DtComparisonView(org.eclipse.swt.widgets.Composite parent, DtComparisonViewContext context)
      Creates a new view instance.
      Parameters:
      parent - the parent composite, can not be null
      context - the view context, can not be null
  • Method Details

    • dispose

      public void dispose()
      Overrides:
      dispose in class org.eclipse.swt.widgets.Widget
    • expandToLevel

      public void expandToLevel(int level)
      Expands the comparison tree up to the specified level.
      Parameters:
      level - the non-negative level
    • getColorHasDiffs

      public org.eclipse.swt.graphics.Color getColorHasDiffs()
      Gets the color for 'node has diffs' case.
      Returns:
      the color.
    • getColorOnlyMain

      public org.eclipse.swt.graphics.Color getColorOnlyMain()
      Gets the color for 'node has only main object' case.
      Returns:
      the color.
    • getColorOnlyOther

      public org.eclipse.swt.graphics.Color getColorOnlyOther()
      Gets the color for 'node has only other object' case.
      Returns:
      the color.
    • refresh

      public void refresh(Collection<IPartialModelNode> nodesToRefreshWithoutCheckingChildren, Collection<IPartialModelNode> nodesToRefresh)
      Refreshes the given collection of nodes in this view. Must be called in the UI thread.
      Parameters:
      nodesToRefreshWithoutCheckingChildren - the collection of nodes to update their presentation; the structural changes (e.g. addition or removal of children) are not handled; cannot be null
      nodesToRefresh - the collection of nodes to refresh with handling structural changes (e.g. addition or removal of children), cannot be null
    • refresh

      public void refresh(IPartialModelNode node)
      Refreshes given node in this view. This handles structural changes of the given node (e.g. addition or removal of children). Must be called in the UI thread.
      Parameters:
      node - the partial model node to be refreshed, can not be null
    • refresh

      public void refresh()
      Refreshes this view completely. This handles structural changes of the given node (e.g. addition or removal of children). Must be called in the UI thread.
    • reportFailedComparison

      public void reportFailedComparison()
      Sets label on ComparisonTreeControl reporting error during comparison.
    • isReadOnly

      public boolean isReadOnly()
      Determines whether the read-only mode is enabled.
      Returns:
      true if the read-only mode is enabled and false otherwise
    • setReadOnly

      public void setReadOnly(boolean value)
      Sets the read-only mode of the view to the specified value.
      Parameters:
      value - true to turn the read-only mode on, and false to turn it off
    • setInput

      public void setInput(Object input)
      Sets the tree viewer input.
      Parameters:
      input - the tree viewer input, cannot be null
    • resetFilters

      public void resetFilters()
      Resets all tree viewer filters.
    • setFilters

      public void setFilters(ViewerFilter... filters)
      Sets the specified filters to the tree view.
      Parameters:
      filtes - the filters to set, cannot be null
    • setComparisonTreeSearchEngineMediator

      public void setComparisonTreeSearchEngineMediator(ComparisonTreeSearchEngineMediator searchMediator)
      Sets new search mediator for tree view.
      Parameters:
      searchMediator - the mediator to be set, cannot be null
    • getTreeControl

      public ComparisonTreeControl getTreeControl()
      Returns the comparison tree control.
      Returns:
      the comparison tree control, never null
    • openChildComparisonDialog

      public void openChildComparisonDialog(org.eclipse.jface.dialogs.Dialog childComparisonDialog)
      Opens the child DT comparison dialog. If the child comparison dialog is instanceof IDtComparisonViewRefresher, then this view refreshes it when the partial model is changing.
      Parameters:
      childComparisonDialog - the child comparison dialog, cannot be null
    • getCurrentNamedViewerFilter

      public INamedViewerFilter getCurrentNamedViewerFilter()
      Returns the current named viewer filter.
      Returns:
      the current named viewer filter, never null
    • addFilter

      public void addFilter(INamedViewerFilter viewerFilter)
      Adds the viewer filter.
      Parameters:
      viewerFilter - the viewer filter to add, cannot be null
    • setComparisonTreeReadyForSearch

      public void setComparisonTreeReadyForSearch(boolean isComparisonTreeReady)
      Sets readiness of the tree to be searched through.
      Parameters:
      isComparisonTreeReady - the readiness of tree to be used for searching
    • getTreeSearchEngineMediator

      public ComparisonTreeSearchEngineMediator getTreeSearchEngineMediator()
      Gets search adapter.
      Parameters:
      allowEmptySearch - flag indicating whether search over empty container is allowed for this view
      Returns:
      the search mediator, may be null if search not supported for this view or allowEmptySearch == false and no md nodes are present in tree