Package com._1c.g5.v8.dt.ui.dialog
Class AbstractViewerPanel
- 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.ui.dialog.AbstractViewerPanel
 
 
 
 
 
- 
- All Implemented Interfaces:
- org.eclipse.swt.graphics.Drawable
 - Direct Known Subclasses:
- AbstractSetFilterDialogPanel,- AbstractSubsystemsPanel
 
 public abstract class AbstractViewerPanel extends org.eclipse.swt.widgets.CompositeAbstract viewer panel for dialogs and wizard.
- 
- 
Field SummaryFields Modifier and Type Field Description protected static org.eclipse.swt.graphics.ImageIMG_CHECKEDCheck image.protected SearchFilterWithHistorysearchFilterWithHistoryThe search filter with historyprotected booleansingleSelectThe view "read only" flagprotected org.eclipse.swt.widgets.ToolBartoolBarThe toolbarprotected org.eclipse.swt.widgets.ToolItemtoolBarDeselectAllElementThe tool item for "Deselect all" actionprotected org.eclipse.swt.widgets.ToolItemtoolBarSelectAllElementThe tool item for "Select all" actionprotected CheckboxTreeViewerviewerThe tree viewer
 - 
Constructor SummaryConstructors Constructor Description AbstractViewerPanel(org.eclipse.swt.widgets.Composite parent, boolean singleSelect, boolean hasSearch, String treeName, boolean editable)Creates a newAbstractViewerPanelwith toolbar.AbstractViewerPanel(org.eclipse.swt.widgets.Composite parent, boolean singleSelect, boolean hasSearch, String treeName, boolean needToolbar, boolean useHelper, boolean editable)Constructor.AbstractViewerPanel(org.eclipse.swt.widgets.Composite parent, boolean singleSelect, boolean hasSearch, String treeName, boolean needToolbar, boolean useHelper, SearchFilterWithHistory searchFilterWithHistory, boolean editable)Constructor.AbstractViewerPanel(org.eclipse.swt.widgets.Composite parent, boolean singleSelect, boolean hasSearch, String treeName, SearchFilterWithHistory searchFilterWithHistory, boolean editable)Creates a newAbstractViewerPanelwith toolbar.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddViewerDoubleClickListener(IDoubleClickListener listener)Adds a listener for double-clicks in this viewer.voidaddViewerFilter(ViewerFilter filter)Adds filter to viewer.protected voidchangeActionEnable()Changes actions enable state.protected voidchangeViewerCheckState(CheckStateChangedEvent event)Viewer check state handler.protected voidcheckAll(boolean state)Checks all elements.protected CheckboxTreeViewercreateCheckboxTreeViewer()Creates checkbox tree viewer.protected voidcreateSearch(org.eclipse.swt.widgets.Composite toolbarAndSearch)Creates search by string to panel.protected voidcreateToolbarActions()Creates toolbar actions.protected voiddoDoubleClick()Does double click actions.List<Object>getCheckedElements()Gets checked elements.protected List<Object>getDescendants(Object node)Gets all descendants for the given node.List<Object>getGrayedElements()Gets grayed elements.<T> List<T>getItemsOfType(Object[] selection, Class<T> targetClass)Gets items from selection.List<Object>getOnlyCheckedElements()Gets the checked elements (excluding grayed out elements).Object[]getViewerInput()Gets viewer input.booleanhasCheckedElements()Returnstrueif panel has checked elements (excluding grayed out elements).protected voidinitToolbarActions()Inits toolbar actions.protected abstract voidinitViewer(Object input)Inits viewer properties.voidremoveViewerDoubleClickListener(IDoubleClickListener listener)Removes the given double-click listener from this viewer.voidremoveViewerFilter(ViewerFilter filter)Removes viewer filter.voidsetChecked(Object element)Sets the given element as checked.voidsetCheckedElements(Object... elements)Sets the given elements as elements.voidsetFocusToSearchLine()Sets the focus to the search line.voidsetGrayedElements(Object... elements)Sets the given elements as grayed.voidsetLabelText(String labelText)Sets text to panel label.protected voidsetState(Object node, boolean checked)Sets node check state and updates its subtree and parents.voidsetUncheckedElements(Object... elements)Sets the given elements as unchecked.voidsetViewerInput(Object input)Sets the viewer input.protected voidupdateTree(Object node, boolean checked)Sets the checked state for the given node and its children in this viewer and updates the parent state.- 
Methods inherited from class org.eclipse.swt.widgets.Compositechanged, 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.ScrollablecomputeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
 - 
Methods inherited from class org.eclipse.swt.widgets.ControladdControlListener, 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.WidgetaddDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData
 
- 
 
- 
- 
- 
Field Detail- 
IMG_CHECKEDprotected static final org.eclipse.swt.graphics.Image IMG_CHECKED Check image.
 - 
viewerprotected CheckboxTreeViewer viewer The tree viewer
 - 
singleSelectprotected boolean singleSelect The view "read only" flag
 - 
searchFilterWithHistoryprotected SearchFilterWithHistory searchFilterWithHistory The search filter with history
 - 
toolBarprotected org.eclipse.swt.widgets.ToolBar toolBar The toolbar
 - 
toolBarDeselectAllElementprotected org.eclipse.swt.widgets.ToolItem toolBarDeselectAllElement The tool item for "Deselect all" action
 - 
toolBarSelectAllElementprotected org.eclipse.swt.widgets.ToolItem toolBarSelectAllElement The tool item for "Select all" action
 
- 
 - 
Constructor Detail- 
AbstractViewerPanelpublic AbstractViewerPanel(org.eclipse.swt.widgets.Composite parent, boolean singleSelect, boolean hasSearch, String treeName, boolean editable)Creates a newAbstractViewerPanelwith toolbar.- Parameters:
- parent- the parent composite, can not be- null
- singleSelect- whether the view is read only
- hasSearch- whether the view has searchbox
- treeName- the viewer tree name, can be- null
- editable- whether the panel editable
 
 - 
AbstractViewerPanelpublic AbstractViewerPanel(org.eclipse.swt.widgets.Composite parent, boolean singleSelect, boolean hasSearch, String treeName, SearchFilterWithHistory searchFilterWithHistory, boolean editable)Creates a newAbstractViewerPanelwith toolbar.- Parameters:
- parent- the parent composite, can not be- null
- singleSelect- whether the view is read only
- hasSearch- whether the view has searchbox
- treeName- the viewer tree name, can be- null
- searchFilterWithHistory- the search filter with history, can not be- null
- editable- whether the panel editable
 
 - 
AbstractViewerPanelpublic AbstractViewerPanel(org.eclipse.swt.widgets.Composite parent, boolean singleSelect, boolean hasSearch, String treeName, boolean needToolbar, boolean useHelper, boolean editable)Constructor.- Parameters:
- parent- the parent composite, can not be- null
- singleSelect- whether the view is read only
- hasSearch- whether the view has searchbox
- treeName- the viewer tree name, can be- null
- needToolbar- whether the view needs toolbar
- useHelper- whether the view needs checked tree helper
- editable- whether the panel editable
 
 - 
AbstractViewerPanelpublic AbstractViewerPanel(org.eclipse.swt.widgets.Composite parent, boolean singleSelect, boolean hasSearch, String treeName, boolean needToolbar, boolean useHelper, SearchFilterWithHistory searchFilterWithHistory, boolean editable)Constructor.- Parameters:
- parent- the parent composite, can not be- null
- singleSelect- whether the view is read only
- hasSearch- whether the view has searchbox
- treeName- the viewer tree name, can be- null
- needToolbar- whether the view needs toolbar
- useHelper- whether the view needs checked tree helper
- searchFilterWithHistory- the search filter with history, can not be- null
- editable- whether the panel editable
 
 
- 
 - 
Method Detail- 
addViewerFilterpublic void addViewerFilter(ViewerFilter filter) Adds filter to viewer.- Parameters:
- filter- the viewer filter, can not be- null
 
 - 
addViewerDoubleClickListenerpublic void addViewerDoubleClickListener(IDoubleClickListener listener) Adds a listener for double-clicks in this viewer. Has no effect if an identical listener is already registered.- Parameters:
- listener- a double-click listener, cannot be- null
 
 - 
removeViewerDoubleClickListenerpublic void removeViewerDoubleClickListener(IDoubleClickListener listener) Removes the given double-click listener from this viewer. Has no effect if an identical listener is not registered.- Parameters:
- listener- a double-click listener, cannot be- null
 
 - 
getCheckedElementspublic List<Object> getCheckedElements() Gets checked elements.- Returns:
- checked elements, never null
 
 - 
hasCheckedElementspublic boolean hasCheckedElements() Returnstrueif panel has checked elements (excluding grayed out elements).- Returns:
- trueif panel has checked elements (excluding grayed out elements).
 
 - 
getGrayedElementspublic List<Object> getGrayedElements() Gets grayed elements.- Returns:
- grayed elements, never null
 
 - 
getItemsOfTypepublic <T> List<T> getItemsOfType(Object[] selection, Class<T> targetClass) Gets items from selection.- Parameters:
- selection- the selection, can not be- null
- targetClass- the target class, can not be- null
- Returns:
- the target class items, never null
 
 - 
getOnlyCheckedElementspublic List<Object> getOnlyCheckedElements() Gets the checked elements (excluding grayed out elements).- Returns:
- the checked elements, never null
 
 - 
getViewerInputpublic Object[] getViewerInput() Gets viewer input.- Returns:
- the viewer input, may be null
 
 - 
removeViewerFilterpublic void removeViewerFilter(ViewerFilter filter) Removes viewer filter.- Parameters:
- filter- the filter, can not be- null
 
 - 
setCheckedpublic void setChecked(Object element) Sets the given element as checked. Does not update its subtree and parents.- Parameters:
- element- the given element, can not be- null
- See Also:
- setState(Object, boolean)
 
 - 
setCheckedElementspublic void setCheckedElements(Object... elements) Sets the given elements as elements.- Parameters:
- elements- the given elements, can not be- null
 
 - 
setGrayedElementspublic void setGrayedElements(Object... elements) Sets the given elements as grayed.- Parameters:
- elements- the given elements, can not be- null
 
 - 
setUncheckedElementspublic void setUncheckedElements(Object... elements) Sets the given elements as unchecked.- Parameters:
- elements- the given elements, can not be- null
 
 - 
setViewerInputpublic void setViewerInput(Object input) Sets the viewer input.- Parameters:
- input- the input, may be- null
 
 - 
setFocusToSearchLinepublic void setFocusToSearchLine() Sets the focus to the search line.
 - 
setLabelTextpublic void setLabelText(String labelText) Sets text to panel label.- Parameters:
- labelText- the text to set, cannot be- null
 
 - 
changeActionEnableprotected void changeActionEnable() Changes actions enable state.
 - 
changeViewerCheckStateprotected void changeViewerCheckState(CheckStateChangedEvent event) Viewer check state handler.- Parameters:
- event- the check state change event, may be- null
 
 - 
checkAllprotected void checkAll(boolean state) Checks all elements.- Parameters:
- state- the check state
 
 - 
createSearchprotected void createSearch(org.eclipse.swt.widgets.Composite toolbarAndSearch) Creates search by string to panel.- Parameters:
- toolbarAndSearch- toolbar and search composite, can not be- null
 
 - 
createToolbarActionsprotected void createToolbarActions() Creates toolbar actions.
 - 
doDoubleClickprotected void doDoubleClick() Does double click actions.
 - 
initToolbarActionsprotected void initToolbarActions() Inits toolbar actions.
 - 
initViewerprotected abstract void initViewer(Object input) Inits viewer properties.- Parameters:
- input- the viewer input, may be- null
 
 - 
setStateprotected void setState(Object node, boolean checked) Sets node check state and updates its subtree and parents.- Parameters:
- node- the target node, can not be- null
- checked- the check value
 
 - 
updateTreeprotected void updateTree(Object node, boolean checked) Sets the checked state for the given node and its children in this viewer and updates the parent state.- Parameters:
- node- the given node, can not be- null
- checked-- trueif the node should be checked and- falseif it should be unchecked
 
 - 
getDescendantsprotected List<Object> getDescendants(Object node) Gets all descendants for the given node.- Parameters:
- node- the tree node, can not be- null
- Returns:
- the list of all descendants, never null
 
 - 
createCheckboxTreeViewerprotected CheckboxTreeViewer createCheckboxTreeViewer() Creates checkbox tree viewer.- Returns:
- the new checkbox tree viewer, cannot be null
 
 
- 
 
-