@OpenApiAll
public class GenericTableManager
extends java.lang.Object
Constructor and Description |
---|
GenericTableManager() |
Modifier and Type | Method and Description |
---|---|
static void |
addColumnsById(Diagram diagram,
java.util.List<java.lang.String> columnIDs)
Adds generic table columns by id
|
static void |
addGenericTableToolbarConfigurator(DTConfigurator configurator)
Adds generic table toolbar configurator.
|
static void |
addRowElement(Diagram diagram,
Element element)
Adds an element into generic table diagram as row
|
static Diagram |
createGenericTable(Project project,
java.lang.String genericTableDiagramName)
Creates generic table diagram in given project with given name
|
static Property |
getCellValue(Diagram diagram,
Element element,
java.lang.String columnId)
Returns cell value by row element and column id.
|
static java.util.Map<Element,java.util.Map<java.lang.String,Property>> |
getCellValues(Diagram diagram)
Returns all cell values by row element and column id.
|
static java.lang.String |
getColumnIDByPropertyName(java.lang.String propertyName)
Creates Column ID for table from property name
|
static java.lang.String |
getColumnIDByTag(java.lang.String tagName,
Stereotype stereotype)
Creates Column ID for table from stereotype tag name
|
static java.util.List<java.lang.String> |
getColumnIds(Diagram diagram)
Returns column ids from a generic table diagram
|
static java.lang.String |
getColumnNameById(Diagram diagram,
java.lang.String columnId)
Returns column name by id from a generic table diagram
|
static java.util.List<java.lang.String> |
getColumnNames(Diagram diagram)
Returns column names from a generic table diagram
|
static java.util.List<java.lang.String> |
getPossibleColumnIDs(Element type)
Returns all possible column ids for a generic table element types
|
static java.util.List<Element> |
getRowElements(Diagram diagram)
Returns row elements of generic table diagram
|
static java.util.List<Element> |
getSelectedElements(Diagram diagram)
Gets currently selected elements from the diagram table.
|
static java.util.List<java.lang.Object> |
getTableElementTypes(Diagram diagram)
Return generic table diagram element types
|
static java.util.List<java.lang.String> |
getVisibleColumnIds(Diagram diagram)
Returns visible column ids from a generic table diagram.
|
static java.util.List<Element> |
getVisibleRowElements(Diagram diagram)
Returns visible row elements of generic table diagram.
|
static void |
refreshTable(Diagram diagram)
Refresh diagram table.
|
static void |
registerToolbarActionsConfigurator(java.lang.String diagramType,
AMConfigurator configurator)
Registers toolbar actions configurator.
|
static void |
removeRowElement(Diagram diagram,
Element element)
Removes row element from a generic table diagram
|
static void |
setSelectedElements(Diagram diagram,
java.util.List<Element> elements)
Selects rows which represent given model elements.
|
static void |
setTableElementTypes(Diagram diagram,
java.util.List<java.lang.Object> tableElementTypes)
Sets generic table diagram element types
Element types specify what elements can be added to table.
|
public static Diagram createGenericTable(Project project, java.lang.String genericTableDiagramName) throws ReadOnlyElementException
project
- project in which to create generic table diagramgenericTableDiagramName
- generic table diagram nameReadOnlyElementException
- if project is read only throws exceptionpublic static void setTableElementTypes(Diagram diagram, java.util.List<java.lang.Object> tableElementTypes)
diagram
- generic table diagram to set element typestableElementTypes
- object list with elements or classes, to use as table element types.
Element types can be classes, metaclasses and stereotypes.getTableElementTypes(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram)
public static java.util.List<java.lang.Object> getTableElementTypes(Diagram diagram)
diagram
- generic table diagram for which to return element typessetTableElementTypes(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram, java.util.List)
public static void addColumnsById(Diagram diagram, java.util.List<java.lang.String> columnIDs)
diagram
- generic table diagram in which to add columnscolumnIDs
- column ids - column id's must be created using getColumnIDByPropertyName
, getColumnIDByTagName
getPossibleColumnIDs(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element)
public static java.util.List<java.lang.String> getPossibleColumnIDs(Element type)
type
- type of the element for which to get property IDsaddColumnsById(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram, java.util.List)
@CheckForNull public static Property getCellValue(Diagram diagram, Element element, java.lang.String columnId)
getCellValues(Diagram)
.diagram
- generic table diagram from which to get cell valueelement
- row element (used to find table row)columnId
- column idProperty
, else nullgetPossibleColumnIDs(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element)
,
addColumnsById(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram, java.util.List)
public static java.util.Map<Element,java.util.Map<java.lang.String,Property>> getCellValues(Diagram diagram)
diagram
- table diagram from which to get cell values.public static java.util.List<java.lang.String> getColumnIds(Diagram diagram)
diagram
- generic table diagram from which to get column idsgetVisibleColumnIds(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram)
,
getPossibleColumnIDs(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element)
,
addColumnsById(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram, java.util.List)
public static java.util.List<java.lang.String> getVisibleColumnIds(Diagram diagram)
diagram
- generic table diagram from which to get visible column ids.getColumnIds(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram)
,
getPossibleColumnIDs(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element)
,
addColumnsById(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram, java.util.List)
public static java.util.List<java.lang.String> getColumnNames(Diagram diagram)
diagram
- generic table diagram from which to get column names@CheckForNull public static java.lang.String getColumnNameById(Diagram diagram, java.lang.String columnId)
diagram
- generic table diagram to look for columncolumnId
- column id to look foraddColumnsById(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram, java.util.List)
,
getPossibleColumnIDs(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element)
public static java.util.List<Element> getRowElements(Diagram diagram)
diagram
- generic table diagram to get rows fromaddRowElement(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element)
,
removeRowElement(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element)
public static java.util.List<Element> getVisibleRowElements(Diagram diagram)
diagram
- generic table diagram to get rows fromaddRowElement(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element)
,
removeRowElement(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element)
public static void addRowElement(Diagram diagram, Element element)
diagram
- generic table diagram to add element toelement
- element to addgetRowElements(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram)
,
removeRowElement(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element)
public static void removeRowElement(Diagram diagram, Element element)
diagram
- generic table diagram from which to remove elementelement
- element to removegetRowElements(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram)
,
addRowElement(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element)
public static void registerToolbarActionsConfigurator(java.lang.String diagramType, AMConfigurator configurator)
diagramType
- diagram type.configurator
- DTConfigurator
.public static java.lang.String getColumnIDByPropertyName(java.lang.String propertyName)
propertyName
- propertyNamePropertyNames
public static java.lang.String getColumnIDByTag(java.lang.String tagName, Stereotype stereotype)
tagName
- tagName of stereotypestereotype
- stereotypepublic static void addGenericTableToolbarConfigurator(DTConfigurator configurator)
configurator
- configurator to add.public static java.util.List<Element> getSelectedElements(Diagram diagram)
diagram
- diagram model element which represents the generic table.public static void setSelectedElements(Diagram diagram, java.util.List<Element> elements)
diagram
- diagram model element which represents the generic table.elements
- model elements to select.public static void refreshTable(Diagram diagram)
diagram
- diagram element which represents the table.