if (path[path.length - 1] instanceof Entity) {
/** Make selection in a project tree, open correspondent entity tab */
editor.getProjectTreeView().getSelectionModel().setSelectionPath(
buildTreePath(path, editor));
EntityDisplayEvent event = new EntityDisplayEvent(
editor.getProjectTreeView(),
(Entity) path[path.length - 1],
(DataMap) path[path.length - 2],
(DataDomain) path[path.length - 3]);
event.setMainTabFocus(true);
if (path[path.length - 1] instanceof ObjEntity)
editor.getObjDetailView().currentObjEntityChanged(event);
if (path[path.length - 1] instanceof DbEntity)
editor.getDbDetailView().currentDbEntityChanged(event);
}
if (path[path.length - 1] instanceof Query) {
/** Make selection in a project tree, open correspondent entity tab */
editor.getProjectTreeView().getSelectionModel().setSelectionPath(
buildTreePath(path, editor));
QueryDisplayEvent event = new QueryDisplayEvent(
editor.getProjectTreeView(),
(Query) path[path.length - 1],
(DataMap) path[path.length - 2],
(DataDomain) path[path.length - 3]);
editor.currentQueryChanged(event);
}
if (path[path.length - 1] instanceof Embeddable) {
/** Make selection in a project tree, open correspondent entity tab */
editor.getProjectTreeView().getSelectionModel().setSelectionPath(
buildTreePath(path, editor));
EmbeddableDisplayEvent event = new EmbeddableDisplayEvent(
editor.getProjectTreeView(),
(Embeddable) path[path.length - 1],
(DataMap) path[path.length - 2],
(DataDomain) path[path.length - 3]);
event.setMainTabFocus(true);
editor.currentEmbeddableChanged(event);
}
if (path[path.length - 1] instanceof EmbeddableAttribute) {
/** Make selection in a project tree, open correspondent embeddable tab */
Object[] o = new Object[path.length - 1];
for (int i = 0; i < path.length - 1; i++)
o[i] = path[i];
editor.getProjectTreeView().getSelectionModel().setSelectionPath(
buildTreePath(o, editor));
EmbeddableAttributeDisplayEvent event = new EmbeddableAttributeDisplayEvent(
editor.getProjectTreeView(),
(Embeddable) path[path.length - 2],
(EmbeddableAttribute) path[path.length - 1],
(DataMap) path[path.length - 3],
(DataDomain) path[path.length - 4]);
event.setMainTabFocus(true);
editor.getEmbeddableView().currentEmbeddableAttributeChanged(event);
}
if (path[path.length - 1] instanceof Attribute
|| path[path.length - 1] instanceof Relationship) {
/** Make selection in a project tree, open correspondent attributes tab */
Object[] o = new Object[path.length - 1];
for (int i = 0; i < path.length - 1; i++)
o[i] = path[i];
editor.getProjectTreeView().getSelectionModel().setSelectionPath(
buildTreePath(o, editor));
if (path[path.length - 1] instanceof DbAttribute) {
AttributeDisplayEvent event = new AttributeDisplayEvent(
editor.getProjectTreeView(),
(Attribute) path[path.length - 1],
(Entity) path[path.length - 2],
(DataMap) path[path.length - 3],
(DataDomain) path[path.length - 4]);
event.setMainTabFocus(true);
editor.getDbDetailView().currentDbAttributeChanged(event);
}
if (path[path.length - 1] instanceof ObjAttribute) {
AttributeDisplayEvent event = new AttributeDisplayEvent(
editor.getProjectTreeView(),
(Attribute) path[path.length - 1],
(Entity) path[path.length - 2],
(DataMap) path[path.length - 3],
(DataDomain) path[path.length - 4]);
event.setMainTabFocus(true);
editor.getObjDetailView().currentObjAttributeChanged(event);
}
if (path[path.length - 1] instanceof DbRelationship) {
RelationshipDisplayEvent event = new RelationshipDisplayEvent(
editor.getProjectTreeView(),
(Relationship) path[path.length - 1],
(Entity) path[path.length - 2],
(DataMap) path[path.length - 3],
(DataDomain) path[path.length - 4]);
event.setMainTabFocus(true);
editor.getDbDetailView().currentDbRelationshipChanged(event);
}
}
if (path[path.length - 1] instanceof ObjRelationship) {
RelationshipDisplayEvent event = new RelationshipDisplayEvent(
editor.getProjectTreeView(),
(Relationship) path[path.length - 1],
(Entity) path[path.length - 2],
(DataMap) path[path.length - 3],
(DataDomain) path[path.length - 4]);
event.setMainTabFocus(true);
editor.getObjDetailView().currentObjRelationshipChanged(event);
}
}