Class ScopeSelectionManager

java.lang.Object
com._1c.g5.v8.dt.internal.ui.validation.ScopeSelectionManager

public class ScopeSelectionManager extends Object
Class for creating and comparing ScopeSelection. Also provides methods for getting top objects.
  • Constructor Details

    • ScopeSelectionManager

      public ScopeSelectionManager()
  • Method Details

    • getCurrentProject

      public Optional<org.eclipse.core.resources.IProject> getCurrentProject(ScopeSelection scopeSelection)
      Returns the currently selected project based on the given selection information.
      Parameters:
      scopeSelection - selection info, may be null.
      Returns:
      the currently selected project based on the given selection information. Never null, but the optional may be empty.
    • selectionsEquals

      public boolean selectionsEquals(ScopeSelection selection1, ScopeSelection selection2, ProblemFilters.Scope scope)
      Tests equality selections for given scope.
      Parameters:
      selection1 - - fist scope selection, cannot be null
      selection2 - - second scope selction, cannot be null
      scope - - scope type for comparing selections, cannot be null
      Returns:
      true if equals
    • getScopeFromNavigatorSelection

      public ScopeSelection getScopeFromNavigatorSelection(org.eclipse.ui.IWorkbenchSite site)
      Create new ScopeSelection for selection in AbstractDtNavigator.
      Returns:
      ScopeSelection for current navigator selection, never null
    • getScopeFromSelection

      public ScopeSelection getScopeFromSelection(ISelection selection)
      Parameters:
      selection - - can be null for empty selection
      Returns:
      ScopeSelection, not null
    • getScopeFromWorkbenchPart

      public ScopeSelection getScopeFromWorkbenchPart(org.eclipse.ui.IWorkbenchPart part, ISelection selection)
      Tries to create a suitable ScopeSelection from IWorkbenchPart and IStructuredSelection.
      Parameters:
      part - workbench part, can be null.
      selection - - can be null for empty selection.
      Returns:
      ScopeSelection, can be null.
    • getScope

      public ScopeSelection getScope(org.eclipse.emf.ecore.EObject source)
      Parameters:
      source - - can be null for empty object
      Returns:
      ScopeSelection, not null
    • getTopObjects

      public Set<org.eclipse.emf.ecore.EObject> getTopObjects(ScopeSelection selection, org.eclipse.core.resources.IProject project)
      Returns top objects for current scope selection.
      Parameters:
      selection - - not null
      project - - not null
      Returns:
      set of top objects. never null
    • getTopMdObject

      public MdObject getTopMdObject(org.eclipse.emf.ecore.EObject eObject)
      Returns top md object for current eObject.
      Parameters:
      eObject - - not null
      Returns:
      top md object, can be null