Package com._1c.g5.v8.dt.erd.ui.widgets
Class DiagramTabItem
java.lang.Object
com._1c.g5.v8.dt.erd.ui.widgets.DiagramTabItem
- All Implemented Interfaces:
IGroupsListener
Instance of this class represents diagram tab item in tabs folder. Each tab item contains own diagram.
Supports same
Supports same
SWT
styles as CTabItem
.-
Constructor Summary
ConstructorsConstructorDescriptionDiagramTabItem
(ErdEditor editor, org.eclipse.swt.custom.CTabFolder parent, int style, String tabName, Collection<String> projectNames, int index) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addProjectName
(String projectName) Adds name of project which elements on diagram belongs to.void
deleted
(Collection<IErdEntity> entities) Fires this event when delete group action happens.void
dispose()
Disposes of the operating system resources associated with the receiver.Returns tabs diagram controller.com._1c.g5.v8.dt.diagram.framework.ui.IDiagram
Returns tabs diagram gui.Returns diagram gui builder.int
Returns diagram height.int
Returns diagram width.Returns editor.org.eclipse.draw2d.FigureCanvas
Returns tabs figure canvas.Returns group to diagram map.Returns main diagram of this tab.Returns parent of currently opened diagram.Returns all previously opened diagrams.Returns name of projects which elements on diagram belongs to.org.eclipse.swt.custom.CTabItem
Returns tab item.Returns tab's name without group names.Returns tabs name.void
goBack()
Opens upper group.void
Opens most resently closed group.void
grouped
(Collection<IErdEntity> entities) Fires this event when group action happens.boolean
isEmpty()
Returnstrue
if tab does not contain builded diagram.boolean
Returnstrue
if tab has orthogonal lines style.void
openGroup
(ErdEntityGroup group, String separator) Opens group.void
openGroupSync
(ErdEntityGroup group, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Opens group.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.void
rerouteEdges
(Collection<IErdEntity> entities, Collection<com._1c.g5.v8.dt.diagram.framework.IRelation> relations, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Reroutes given relations.void
Resets diagram bounds.void
resetTab()
Resets this tab.void
Sets view location to top lefter figure.void
setContents
(org.eclipse.draw2d.Viewport contents) Sets contents.void
setDiagramHeight
(int diagramHeight) Sets diagram height.void
setDiagramWidth
(int diagramWidth) Sets diagram width.void
setLinesStyle
(boolean isLinesOrthogonal) Sets lines style.void
Sets this tab as selected.void
setTabName
(String tabName) Sets tab name.void
ungrouped
(Collection<IErdEntity> entities) Fires this event when ungroup action happens.
-
Constructor Details
-
DiagramTabItem
public DiagramTabItem(ErdEditor editor, org.eclipse.swt.custom.CTabFolder parent, int style, String tabName, Collection<String> projectNames, int index) Constructor.- Parameters:
editor
- - erd editor to create tab for. Can't benull
.parent
- - parent CTabFolder of the created tab . Can't benull
.style
- - the style of control to construct. Styles can be taken fromSWT
.tabName
- - tab's name. if given value isnull
, tab's name will be default tab name. Can benull
.projectNames
- - project names of this tab. Can benull
.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 Details
-
openGroup
Opens group.- Parameters:
group
- - group to open. Can't benull
.separator
- - separator which will be placed between tab name and group name to form new tab name. Can't benull
.
-
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.- Parameters:
group
- - group to open. Can't benull
.progressMonitor
- - progress monitor to report progress. Can benull
.
-
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()Returnstrue
if tab does not contain builded diagram.- Returns:
true
if tab does not contain builded diagram.
-
setContents
public void setContents(org.eclipse.draw2d.Viewport contents) Sets contents.- Parameters:
contents
- - contents to set. Can't benull
.
-
addProjectName
Adds name of project which elements on diagram belongs to.- Parameters:
projectName
- - project name to set. Can't benull
.
-
setTabName
Sets tab name.- Parameters:
tabName
- - tab name to set. Can't benull
.
-
setDiagramWidth
public void setDiagramWidth(int diagramWidth) Sets diagram width.- Parameters:
diagramWidth
- - diagram width to set.
-
setDiagramHeight
public void setDiagramHeight(int diagramHeight) Sets diagram height.- Parameters:
diagramHeight
- - diagram height to set.
-
getEditor
Returns editor.- Returns:
- editor. Can't return
null
.
-
getDiagramWidth
public int getDiagramWidth()Returns diagram width.- Returns:
- diagram width.
-
getDiagramHeight
public int getDiagramHeight()Returns diagram height.- Returns:
- diagram height.
-
getTabName
Returns tabs name.- Returns:
- tabs name. Can't return
null
.
-
getTabMainName
Returns tab's name without group names.
Example:
Tab"Diagram"
with opened group"Group"
has name"Diagram->Group"
. Method will return only main part"Diagram"
.- Returns:
- tab's name without group names.
-
getTabItem
public org.eclipse.swt.custom.CTabItem getTabItem()Returns tab item.- Returns:
- tab item. Can't return
null
.
-
getDiagramGuiBuilder
Returns diagram gui builder.- Returns:
- diagram gui builder. Can't return
null
.
-
getDiagramGui
public com._1c.g5.v8.dt.diagram.framework.ui.IDiagram getDiagramGui()Returns tabs diagram gui.- Returns:
- tabs diagram gui. Can return
null
.
-
getDiagramController
Returns tabs diagram controller.- Returns:
- tabs diagram controller. Can't return
null
.
-
getProjectNames
Returns name of projects which elements on diagram belongs to.- Returns:
- the projectName. Can't return
null
.
-
getFigureCanvas
public org.eclipse.draw2d.FigureCanvas getFigureCanvas()Returns tabs figure canvas.- Returns:
- tabs figure canvas. Can't return
null
.
-
getPreviousDiagram
Returns parent of currently opened diagram. Returnsnull
if no parent.- Returns:
- parent of currently opened diagram if one exists. Can return
null
.
-
getPreviousDiagrams
Returns all previously opened diagrams. (current open diagram predessors)- Returns:
- previously opened diagrams. Can't return
null
.
-
getMainDiagramController
Returns main diagram of this tab.- Returns:
- main diagram of this tab. Can't return
null
.
-
getGroupToDiagramMap
Returns group to diagram map. This map do not contain main diagram.- Returns:
- 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.- Parameters:
entities
- - entities to relayout. Can't benull
.relations
- - relations to reroute. Can't benull
.progressMonitor
- - monitor. Can benull
.
-
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.- Parameters:
entities
- - entities connected to given relations. Can't benull
.relations
- - relations to reroute. Can't benull
.progressMonitor
- - progress monitor. Can benull
.
-
resetViewLocation
public void resetViewLocation()Sets view location to top lefter figure. If there is no figures on tab does nothing. -
isLinesOrthogonal
public boolean isLinesOrthogonal()Returnstrue
if tab has orthogonal lines style.- Returns:
true
if tab has orthogonal lines style.
-
setLinesStyle
public void setLinesStyle(boolean isLinesOrthogonal) Sets lines style.- Parameters:
isLinesOrthogonal
- -true
if tab lines style should be orthogonal.
-
grouped
Description copied from interface:IGroupsListener
Fires this event when group action happens.- Specified by:
grouped
in interfaceIGroupsListener
- Parameters:
entities
- - grouped entities. Can't benull
.
-
ungrouped
Description copied from interface:IGroupsListener
Fires this event when ungroup action happens.- Specified by:
ungrouped
in interfaceIGroupsListener
- Parameters:
entities
- - ungrouped entities. Can't benull
.
-
deleted
Description copied from interface:IGroupsListener
Fires this event when delete group action happens. Given items may contain not only groups.- Specified by:
deleted
in interfaceIGroupsListener
- Parameters:
entities
- - deleted entities. Can't benull
.
-