Class DiagramTabItem

  • All Implemented Interfaces:

    public class DiagramTabItem
    extends Object
    implements IGroupsListener
    Instance of this class represents diagram tab item in tabs folder. Each tab item contains own diagram.
    Supports same SWT styles as CTabItem.
    • Constructor Detail

      • DiagramTabItem

        public DiagramTabItem​(ErdEditor editor,
                              org.eclipse.swt.custom.CTabFolder parent,
                              int style,
                              String tabName,
                              Collection<String> projectNames,
                              int index)
        editor - - erd editor to create tab for. Can't be null.
        parent - - parent CTabFolder of the created tab . Can't be null.
        style - - the style of control to construct. Styles can be taken from SWT.
        tabName - - tab's name. if given value is null, tab's name will be default tab name. Can be null.
        projectNames - - project names of this tab. Can be null.
        index - - the zero-relative index of created tab. The item will be added to the end of the items if given index is negative
    • Method Detail

      • openGroup

        public void openGroup​(ErdEntityGroup group,
                              String separator)
        Opens group.
        group - - group to open. Can't be null.
        separator - - separator which will be placed between tab name and group name to form new tab name. Can't be null.
      • openGroupSync

        public void openGroupSync​(ErdEntityGroup group,
                                  org.eclipse.core.runtime.IProgressMonitor progressMonitor)
        Opens group. Method returns when group is opened and rebuild. Does not change tab title.
        group - - group to open. Can't be null.
        progressMonitor - - progress monitor to report progress. Can be null.
      • goBack

        public void goBack()
        Opens upper group.
      • goForward

        public void goForward()
        Opens most resently closed group.
      • dispose

        public void dispose()
        Disposes of the operating system resources associated with the receiver.
      • setSelected

        public void setSelected()
        Sets this tab as selected.
      • resetTab

        public void resetTab()
        Resets this tab.
      • isEmpty

        public boolean isEmpty()
        Returns true if tab does not contain builded diagram.
        true if tab does not contain builded diagram.
      • setContents

        public void setContents​(org.eclipse.draw2d.Viewport contents)
        Sets contents.
        contents - - contents to set. Can't be null.
      • addProjectName

        public void addProjectName​(String projectName)
        Adds name of project which elements on diagram belongs to.
        projectName - - project name to set. Can't be null.
      • setTabName

        public void setTabName​(String tabName)
        Sets tab name.
        tabName - - tab name to set. Can't be null.
      • setDiagramWidth

        public void setDiagramWidth​(int diagramWidth)
        Sets diagram width.
        diagramWidth - - diagram width to set.
      • setDiagramHeight

        public void setDiagramHeight​(int diagramHeight)
        Sets diagram height.
        diagramHeight - - diagram height to set.
      • getEditor

        public ErdEditor getEditor()
        Returns editor.
        editor. Can't return null.
      • getDiagramWidth

        public int getDiagramWidth()
        Returns diagram width.
        diagram width.
      • getDiagramHeight

        public int getDiagramHeight()
        Returns diagram height.
        diagram height.
      • getTabName

        public String getTabName()
        Returns tabs name.
        tabs name. Can't return null.
      • getTabMainName

        public String getTabMainName()
        Returns tab's name without group names.
        Tab "Diagram" with opened group "Group" has name "Diagram->Group". Method will return only main part "Diagram".
        tab's name without group names.
      • getTabItem

        public org.eclipse.swt.custom.CTabItem getTabItem()
        Returns tab item.
        tab item. Can't return null.
      • getDiagramGuiBuilder

        public DiagramGuiBuilder getDiagramGuiBuilder()
        Returns diagram gui builder.
        diagram gui builder. Can't return null.
      • getDiagramGui

        public com._1c.g5.v8.dt.diagram.framework.ui.IDiagram getDiagramGui()
        Returns tabs diagram gui.
        tabs diagram gui. Can return null.
      • getDiagramController

        public IErdDiagramController getDiagramController()
        Returns tabs diagram controller.
        tabs diagram controller. Can't return null.
      • getProjectNames

        public Collection<String> getProjectNames()
        Returns name of projects which elements on diagram belongs to.
        the projectName. Can't return null.
      • getFigureCanvas

        public org.eclipse.draw2d.FigureCanvas getFigureCanvas()
        Returns tabs figure canvas.
        tabs figure canvas. Can't return null.
      • getPreviousDiagram

        public IErdDiagramController getPreviousDiagram()
        Returns parent of currently opened diagram. Returns null if no parent.
        parent of currently opened diagram if one exists. Can return null.
      • getPreviousDiagrams

        public Deque<IErdDiagramController> getPreviousDiagrams()
        Returns all previously opened diagrams. (current open diagram predessors)
        previously opened diagrams. Can't return null.
      • getMainDiagramController

        public IErdDiagramController getMainDiagramController()
        Returns main diagram of this tab.
        main diagram of this tab. Can't return null.
      • getGroupToDiagramMap

        public Map<ErdEntityGroup,​IErdDiagramController> getGroupToDiagramMap()
        Returns group to diagram map. This map do not contain main diagram.
        group to diagram map. Can't return null.
      • resetDiagramBounds

        public void resetDiagramBounds()
        Resets diagram bounds.
      • relayoutEntities

        public void relayoutEntities​(Collection<IErdEntity> entities,
                                     Collection<com._1c.g5.v8.dt.diagram.framework.IRelation> relations,
                                     org.eclipse.core.runtime.IProgressMonitor progressMonitor)
        Relayouts given entities and relations.
        entities - - entities to relayout. Can't be null.
        relations - - relations to reroute. Can't be null.
        progressMonitor - - monitor. Can be null.
      • rerouteEdges

        public void rerouteEdges​(Collection<IErdEntity> entities,
                                 Collection<com._1c.g5.v8.dt.diagram.framework.IRelation> relations,
                                 org.eclipse.core.runtime.IProgressMonitor progressMonitor)
        Reroutes given relations.
        entities - - entities connected to given relations. Can't be null.
        relations - - relations to reroute. Can't be null.
        progressMonitor - - progress monitor. Can be null.
      • resetViewLocation

        public void resetViewLocation()
        Sets view location to top lefter figure. If there is no figures on tab does nothing.
      • isLinesOrthogonal

        public boolean isLinesOrthogonal()
        Returns true if tab has orthogonal lines style.
        true if tab has orthogonal lines style.
      • setLinesStyle

        public void setLinesStyle​(boolean isLinesOrthogonal)
        Sets lines style.
        isLinesOrthogonal - - true if tab lines style should be orthogonal.
      • deleted

        public void deleted​(Collection<IErdEntity> entities)
        Description copied from interface: IGroupsListener
        Fires this event when delete group action happens. Given items may contain not only groups.
        Specified by:
        deleted in interface IGroupsListener
        entities - - deleted entities. Can't be null.