Class AbstractDiagramHandler

java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.core.commands.AbstractHandler
com._1c.g5.v8.dt.erd.ui.handlers.AbstractDiagramHandler
All Implemented Interfaces:
org.eclipse.core.commands.IHandler, org.eclipse.core.commands.IHandler2
Direct Known Subclasses:
AddEntitiesHandler, AddToGroupHandler, BuildConnectedHandler, BuildDiagramHandler, DeleteEntitiesHandler, DropEntitiesHandler, FindOnDiagramHandler, GroupEntitiesHandler, ShowConnectedHandler, UngroupEntitiesHandler

public abstract class AbstractDiagramHandler extends org.eclipse.core.commands.AbstractHandler
Main class for diagram handlers. Contains basic methods.
  • Field Details

    • convertersService

      @Inject protected com._1c.g5.v8.dt.diagram.framework.core.IConvertersService<MdObject> convertersService
      Converters service that converts md objects. Not null.
    • projectManager

      @Inject protected IV8ProjectManager projectManager
      V8 project manager. Not null.
    • extractor

      @Inject protected DiagramConfigurationExtractor extractor
      Configuration extractor. Not null.
    • resourceLookup

      @Inject protected IResourceLookup resourceLookup
      Resource lookup. Not null.
    • bmModelManager

      @Inject protected IBmModelManager bmModelManager
      Bm model manager. Not null.
  • Constructor Details

    • AbstractDiagramHandler

      public AbstractDiagramHandler()
  • Method Details

    • execute

      public Object execute(org.eclipse.core.commands.ExecutionEvent event) throws org.eclipse.core.commands.ExecutionException
      Throws:
      org.eclipse.core.commands.ExecutionException
    • processMdObjects

      protected abstract void processMdObjects(Collection<MdObject> mdObjects, ErdEditor editor)
      Processes given md objects. Realization varies.
      Parameters:
      mdObjects - - objects to process. Can't be null.
      editor - - context editor. Can't be null.
    • showNoSelectedObjectsMessage

      protected void showNoSelectedObjectsMessage()
      Shows message about no MdObjects selected to user.
    • isProjectSelected

      protected boolean isProjectSelected(IStructuredSelection selection)
      Returns true if selection contains project.
      Parameters:
      selection - - selection. Can't be null.
      Returns:
      true if selection contains project.
    • askForNewTab

      protected void askForNewTab(ErdEditor editor)
      Asks user if new tab should be opened. If user accepts opens new tab.
      Parameters:
      editor - - editor to get tabs. Can't be null.
    • lookForMdObjects

      protected List<MdObject> lookForMdObjects(IStructuredSelection selection)
      Looks for MdObjects in given selection.
      Parameters:
      selection - - selection. Can't be null.
      Returns:
      found MdObjects. Can't return null.
    • getController

      protected ErdDiagramController getController(DiagramTabItem tab, org.eclipse.core.runtime.IProgressMonitor progressMonitor)
      Returns diagram controller from given tab.
      Parameters:
      tab - - tab to get controller from. Can't be null.
      progressMonitor - - monitor to report progress. Can be null.
      Returns:
      diagram controller from given tab. Can't return null.
    • convertToMdObjects

      protected Collection<MdObject> convertToMdObjects(Collection<? extends IErdEntity> entities)
      Converts given entities to mdObjects.
      Parameters:
      entities - - entities to convert. Can't be null.
      Returns:
      converted entities. Can't return null.
    • fillLiterals

      protected void fillLiterals()
      Fills extractor literals.
    • getConfigurationObjects

      protected Collection<MdObject> getConfigurationObjects(Configuration configuration)
      Returns configuration subsystems if there any. Else returns all configuration objects.
      Parameters:
      configuration - - configuration. Can't be null.
      Returns:
      objects from given configuration. Can't return null.
    • getConfigurationSubsystems

      protected Collection<MdObject> getConfigurationSubsystems(Configuration configuration)
      Returns subsystems from given configuration.
      Parameters:
      configuration - - configuration. Can't be null.
      Returns:
      subsystems from given configuration. Can't return null.