use of org.eclipse.sirius.diagram.AbstractDNode in project InformationSystem by ObeoNetwork.
the class DatabaseServices method allSelectableExternalTables.
/**
* Retrieve all non referenced external tables excluding those already displayed on the diagram
* @param context the Table Container
* @param diagram DSemanticDiagram diagram used to check for already displayed tables
* @return List of tables
*/
public List<Table> allSelectableExternalTables(TableContainer context, DSemanticDiagram diagram) {
// Retrieve all non Referenced External Tables
List<Table> allNonReferencedExternalTables = allNonReferencedExternalTables(context);
List<Table> tablesInDiagram = new ArrayList<Table>();
// Retrieve all AbstracteDNode contained in diagram.
List<EObject> allDNodes = EcoreServices.eAllContents(diagram, AbstractDNode.class);
for (EObject node : allDNodes) {
// Retrieve all tables contained in AbstractDNode
if (((AbstractDNode) node).getTarget() instanceof Table) {
tablesInDiagram.add((Table) ((AbstractDNode) node).getTarget());
}
}
// Remove all tables contained in AbstractDNode present in allNonReferencedExternalTables
allNonReferencedExternalTables.removeAll(tablesInDiagram);
return allNonReferencedExternalTables;
}
Aggregations