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.
-
-
Constructor Summary
Constructors Constructor Description DtComparisonView(org.eclipse.swt.widgets.Composite parent, DtComparisonViewContext context)
Creates a new view instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFilter(ViewerFilter viewerFilter)
Adds the viewer filter.void
dispose()
void
expandToLevel(int level)
Expands the comparison tree up to the specified level.org.eclipse.swt.graphics.Color
getColorHasDiffs()
Gets the color for 'node has diffs' case.org.eclipse.swt.graphics.Color
getColorOnlyMain()
Gets the color for 'node has only main object' case.org.eclipse.swt.graphics.Color
getColorOnlyOther()
Gets the color for 'node has only other object' case.INamedViewerFilter
getCurrentNamedViewerFilter()
Returns the current named viewer filter.ComparisonTreeControl
getTreeControl()
Returns the comparison tree control.boolean
isReadOnly()
Determines whether the read-only mode is enabled.void
openChildComparisonDialog(org.eclipse.jface.dialogs.Dialog childComparisonDialog)
Opens the child DT comparison dialog.void
refresh()
Refreshes this view completely.void
refresh(IPartialModelNode node)
Refreshes given node in this view.void
refresh(Collection<IPartialModelNode> nodesToRefreshWithoutCheckingChildren, Collection<IPartialModelNode> nodesToRefresh)
Refreshes the given collection of nodes in this view.void
resetFilters()
Resets all tree viewer filters.void
setFilters(ViewerFilter... filters)
Sets the specified filters to the tree view.void
setInput(Object input)
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
-
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, toString
-
-
-
-
Constructor Detail
-
DtComparisonView
public DtComparisonView(org.eclipse.swt.widgets.Composite parent, DtComparisonViewContext context)
Creates a new view instance.- Parameters:
parent
- the parent composite, can not benull
context
- the view context, can not benull
-
-
Method Detail
-
dispose
public void dispose()
- Overrides:
dispose
in classorg.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 benull
nodesToRefresh
- the collection of nodes to refresh with handling structural changes (e.g. addition or removal of children), cannot benull
-
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 benull
-
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.
-
isReadOnly
public boolean isReadOnly()
Determines whether the read-only mode is enabled.- Returns:
true
if the read-only mode is enabled andfalse
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, andfalse
to turn it off
-
setInput
public void setInput(Object input)
Sets the tree viewer input.- Parameters:
input
- the tree viewer input, cannot benull
-
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 benull
-
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 instanceofIDtComparisonViewRefresher
, then this view refreshes it when the partial model is changing.- Parameters:
childComparisonDialog
- the child comparison dialog, cannot benull
-
getCurrentNamedViewerFilter
public INamedViewerFilter getCurrentNamedViewerFilter()
Returns the current named viewer filter.- Returns:
- the current named viewer filter, never
null
-
addFilter
public void addFilter(ViewerFilter viewerFilter)
Adds the viewer filter.- Parameters:
viewerFilter
- the viewer filter to add, cannot benull
-
-