Class ObjectsSection
- java.lang.Object
-
- org.eclipse.swt.widgets.Widget
-
- org.eclipse.swt.widgets.Control
-
- org.eclipse.swt.widgets.Scrollable
-
- org.eclipse.swt.widgets.Composite
-
- org.eclipse.swt.widgets.Canvas
-
- org.eclipse.ui.forms.widgets.ExpandableComposite
-
- org.eclipse.ui.forms.widgets.Section
-
- com._1c.g5.v8.dt.rights.ui.sections.ObjectsSection
-
- All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable
public class ObjectsSection extends org.eclipse.ui.forms.widgets.Section
Rights edit section.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.eclipse.jface.action.MenuManager
contextMenuManager
The context menu managerprotected IModelEditingSupport
modelEditingSupport
The model editing supportstatic String
OBJECT_SECTION_CONTEXT_MENU_LOCATION
The object section context menu locationstatic String
OBJECT_SECTION_TOOLBAR_LOCATION
The object section toolbar locationprotected org.eclipse.ui.IWorkbenchPartSite
site
The workbench part siteprotected org.eclipse.jface.action.ToolBarManager
toolbarManager
The object section toolbar managerprotected TreeViewer
viewer
The viewer to show rights-
Fields inherited from class org.eclipse.ui.forms.widgets.ExpandableComposite
CLIENT_INDENT, clientVerticalSpacing, COMPACT, descriptionVerticalSpacing, EXPANDED, FOCUS_TITLE, GAP, LEFT_TEXT_CLIENT_ALIGNMENT, marginHeight, marginWidth, NO_TITLE, NO_TITLE_FOCUS_BOX, SHORT_TITLE_BAR, textLabel, TITLE_BAR, titleBarTextMarginWidth, toggle, TREE_NODE, TWISTIE, VGAP
-
-
Constructor Summary
Constructors Constructor Description ObjectsSection(org.eclipse.ui.forms.IManagedForm managedForm, org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.IWorkbenchPartSite site, IRightsEditorController controller, IResourceLookup resourceLookup, IBmEmfIndexManager bmEmfIndexManager, org.eclipse.xtext.naming.IQualifiedNameProvider qualifiedNameProvider, IModelEditingSupport modelEditingSupport)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSelectionChangedListener(ISelectionChangedListener listener)
Adds selection changed listener.void
addViewerTopItemsAsync(Collection<TreeViewerItem> items)
Addes the viewer top items asynchronously.protected void
afterViewerInizialized()
Called after the viewer content was created and the viewer initialization was finished.protected void
beforeViewerInizialized()
Called before the viewer content was created and the viewer initialization was finished.void
collapse(List<TreeViewerItem> items)
Collapses the given node subtrees.void
collapseAll()
Collapses all nodes.void
createClient()
Creates section client.protected void
createToolbar()
Creates toolbar.protected org.eclipse.swt.widgets.Menu
createViewerContextMenu()
Creates the viewer context menu.protected void
createViewerRightColumns()
Creates viewer right columns.protected void
createViewerRightColumns(List<TreeViewerItem> items)
Creates viewer right columns.protected void
deleteViewerRightColumns()
Deletes viewer right columns.void
dispose()
void
expand(List<TreeViewerItem> items)
Expands the given node subtrees.void
expandAll()
Expands all nodes.TreeViewerItem
getFirstSelectedTopViewerItem()
Gets the first selected topTreeViewerItem
.Collection<Right>
getRightsToFilterBy()
Retursn the collection of rights to filter by.List<TreeViewerItem>
getSelectedEditableViewerItems()
Returns the selected editableTreeViewerItem
's.List<TreeViewerItem>
getSelectedTopViewerItems()
Gets the selected topTreeViewerItem
's.List<TreeViewerItem>
getSelectedViewerItems()
Gets the selectedTreeViewerItem
's.boolean
isFilterActionChecked()
Checks if filter action checked.boolean
isFilterByCurrentValueActionChecked()
Checks if filter by current value action checked.protected boolean
isThreeStateRightsCheckboxCellEditor()
Determines whether the checkbook of the rights cell editor can make two or three states.void
refreshViewerAsyncAndUpdatesColumns()
Refreshes viewer async and updates right columns.void
refreshViewerItemAsync(TreeViewerItem item)
Refreshes the viewer item asynchronously.void
refreshViewerItemsAsync(Collection<TreeViewerItem> items)
Refreshes the viewer items asynchronously.void
removeViewerTopItemsAsync(Collection<TreeViewerItem> items)
Removes the viewer top items asynchronously.void
resetRightsToFilterBy()
Resets the rights to filter by.protected void
setEnabledActions()
Sets actions enablement after selection was changed.void
setfilterByCurrentValueActionChecked(boolean checked)
Sets the checked status of the 'FilterByCurrentValue' action.boolean
setFocus()
void
setRightsDenotationOption(RightsDenotationOption rightsDenotationOption)
Sets the rights denotation option and updates right columns.void
setRightsToFilterBy(Collection<Right> rightsToFilterBy)
Sets the collection of rights to filter by.void
setSetFilterActionChecked(boolean checked)
Sets the checked status of the 'SetFilter' action.void
setSetFilterByRightsActionChecked(boolean checked)
Sets the checked status of the 'SetFilterByRights' action.-
Methods inherited from class org.eclipse.ui.forms.widgets.Section
getDescription, getDescriptionControl, getSeparatorControl, getTitleBarBackground, getTitleBarBorderColor, getTitleBarGradientBackground, internalSetExpanded, onPaint, reflow, setBackground, setBackgroundImage, setDescription, setDescriptionControl, setForeground, setSeparatorControl, setTitleBarBackground, setTitleBarBorderColor, setTitleBarGradientBackground
-
Methods inherited from class org.eclipse.ui.forms.widgets.ExpandableComposite
addExpansionListener, computeSize, forceFocus, getClient, getExpansionStyle, getText, getTextClient, getTextClientHeightDifference, getTitleBarForeground, hasTitleBar, isExpanded, isFixedStyle, removeExpansionListener, setActiveToggleColor, setClient, setEnabled, setExpanded, setFont, setLayout, setMenu, setText, setTextClient, setTitleBarForeground, setToggleColor, setToolTipText
-
Methods inherited from class org.eclipse.swt.widgets.Canvas
drawBackground, getCaret, getIME, scroll, setCaret, setIME
-
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, 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, dragDetect, dragDetect, 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, setBounds, setBounds, setCapture, setCursor, setDragDetect, setLayoutData, setLocation, setLocation, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, 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
-
-
-
-
Field Detail
-
OBJECT_SECTION_TOOLBAR_LOCATION
public static final String OBJECT_SECTION_TOOLBAR_LOCATION
The object section toolbar location- See Also:
- Constant Field Values
-
OBJECT_SECTION_CONTEXT_MENU_LOCATION
public static final String OBJECT_SECTION_CONTEXT_MENU_LOCATION
The object section context menu location- See Also:
- Constant Field Values
-
toolbarManager
protected org.eclipse.jface.action.ToolBarManager toolbarManager
The object section toolbar manager
-
contextMenuManager
protected org.eclipse.jface.action.MenuManager contextMenuManager
The context menu manager
-
site
protected org.eclipse.ui.IWorkbenchPartSite site
The workbench part site
-
viewer
protected TreeViewer viewer
The viewer to show rights
-
modelEditingSupport
protected IModelEditingSupport modelEditingSupport
The model editing support
-
-
Constructor Detail
-
ObjectsSection
public ObjectsSection(org.eclipse.ui.forms.IManagedForm managedForm, org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.IWorkbenchPartSite site, IRightsEditorController controller, IResourceLookup resourceLookup, IBmEmfIndexManager bmEmfIndexManager, org.eclipse.xtext.naming.IQualifiedNameProvider qualifiedNameProvider, IModelEditingSupport modelEditingSupport)
Constructor.- Parameters:
managedForm
- the managed form, can not benull
parent
- the parent, can not benull
site
- the site, can not benull
controller
- the controller, can not benull
resourceLookup
- the resource lookup, can not benull
bmEmfIndexManager
- the BM emf index manager, can not benull
qualifiedNameProvider
- the qualified name provider, can not benull
modelEditingSupport
- the model editing support, can not benull
-
-
Method Detail
-
addSelectionChangedListener
public void addSelectionChangedListener(ISelectionChangedListener listener)
Adds selection changed listener.- Parameters:
listener
- the listener
-
collapseAll
public void collapseAll()
Collapses all nodes.
-
collapse
public void collapse(List<TreeViewerItem> items)
Collapses the given node subtrees.
-
createClient
public void createClient()
Creates section client.
-
dispose
public void dispose()
- Overrides:
dispose
in classorg.eclipse.swt.widgets.Widget
-
expandAll
public void expandAll()
Expands all nodes.
-
expand
public void expand(List<TreeViewerItem> items)
Expands the given node subtrees.
-
getFirstSelectedTopViewerItem
public TreeViewerItem getFirstSelectedTopViewerItem()
Gets the first selected topTreeViewerItem
.- Returns:
- the first selected top
TreeViewerItem
ornull
if no topTreeViewerItem
was selected
-
getSelectedTopViewerItems
public List<TreeViewerItem> getSelectedTopViewerItems()
Gets the selected topTreeViewerItem
's.- Returns:
- the selected top viewer items, never
null
-
getSelectedEditableViewerItems
public List<TreeViewerItem> getSelectedEditableViewerItems()
Returns the selected editableTreeViewerItem
's.- Returns:
- the selected editable viewer items, never
null
-
getSelectedViewerItems
public List<TreeViewerItem> getSelectedViewerItems()
Gets the selectedTreeViewerItem
's.- Returns:
- the selected viewer items, never
null
-
isFilterActionChecked
public boolean isFilterActionChecked()
Checks if filter action checked.- Returns:
- true if is
-
isFilterByCurrentValueActionChecked
public boolean isFilterByCurrentValueActionChecked()
Checks if filter by current value action checked.- Returns:
- true if is
-
refreshViewerAsyncAndUpdatesColumns
public void refreshViewerAsyncAndUpdatesColumns()
Refreshes viewer async and updates right columns.
-
refreshViewerItemAsync
public void refreshViewerItemAsync(TreeViewerItem item)
Refreshes the viewer item asynchronously. Do not recreates right columns.- Parameters:
item
- the viewer item to refresh, cannot benull
-
refreshViewerItemsAsync
public void refreshViewerItemsAsync(Collection<TreeViewerItem> items)
Refreshes the viewer items asynchronously. Do not recreates right columns.- Parameters:
items
- the viewer items to refresh, cannot benull
-
setRightsDenotationOption
public void setRightsDenotationOption(RightsDenotationOption rightsDenotationOption)
Sets the rights denotation option and updates right columns.- Parameters:
rightsDenotationOption
- the rights denotation option, cannot benull
-
setFocus
public boolean setFocus()
- Overrides:
setFocus
in classorg.eclipse.swt.widgets.Composite
-
setSetFilterActionChecked
public void setSetFilterActionChecked(boolean checked)
Sets the checked status of the 'SetFilter' action.- Parameters:
checked
- the new checked status
-
setfilterByCurrentValueActionChecked
public void setfilterByCurrentValueActionChecked(boolean checked)
Sets the checked status of the 'FilterByCurrentValue' action.- Parameters:
checked
- the new checked status
-
setRightsToFilterBy
public void setRightsToFilterBy(Collection<Right> rightsToFilterBy)
Sets the collection of rights to filter by.- Parameters:
rightsToFilterBy
- the collection of rights to filter by, cannot benull
-
getRightsToFilterBy
public Collection<Right> getRightsToFilterBy()
Retursn the collection of rights to filter by.- Returns:
- the collection of rights to filter by or
null
if no filter was specified
-
resetRightsToFilterBy
public void resetRightsToFilterBy()
Resets the rights to filter by.
-
setSetFilterByRightsActionChecked
public void setSetFilterByRightsActionChecked(boolean checked)
Sets the checked status of the 'SetFilterByRights' action.- Parameters:
checked
- the new checked status
-
addViewerTopItemsAsync
public void addViewerTopItemsAsync(Collection<TreeViewerItem> items)
Addes the viewer top items asynchronously. Recreates right columns if necessary.- Parameters:
items
- the viewer top items to add, cannot benull
-
removeViewerTopItemsAsync
public void removeViewerTopItemsAsync(Collection<TreeViewerItem> items)
Removes the viewer top items asynchronously. Recreates right columns if necessary.- Parameters:
items
- the viewer top items to remove, cannot benull
-
createToolbar
protected void createToolbar()
Creates toolbar.
-
createViewerContextMenu
protected org.eclipse.swt.widgets.Menu createViewerContextMenu()
Creates the viewer context menu.- Returns:
- the context menu, can not be
null
-
isThreeStateRightsCheckboxCellEditor
protected boolean isThreeStateRightsCheckboxCellEditor()
Determines whether the checkbook of the rights cell editor can make two or three states.- Returns:
true
if the checkbook of the rights cell editor can make three states andfalse
otherwise
-
beforeViewerInizialized
protected void beforeViewerInizialized()
Called before the viewer content was created and the viewer initialization was finished.
-
afterViewerInizialized
protected void afterViewerInizialized()
Called after the viewer content was created and the viewer initialization was finished.
-
setEnabledActions
protected void setEnabledActions()
Sets actions enablement after selection was changed.
-
createViewerRightColumns
protected void createViewerRightColumns()
Creates viewer right columns.
-
createViewerRightColumns
protected void createViewerRightColumns(List<TreeViewerItem> items)
Creates viewer right columns.- Parameters:
items
- the tree viewer items right columns are created for, can not benull
-
deleteViewerRightColumns
protected void deleteViewerRightColumns()
Deletes viewer right columns.
-
-