use of com.cubrid.common.ui.spi.model.DefaultCubridNode in project cubrid-manager by CUBRID.
the class ConnectionUrlExportAction method run.
public void run() {
Object[] objs = this.getSelectedObj();
if (objs == null || objs.length == 0) {
CommonUITool.openErrorBox(Messages.errNoDatabaseSelected);
return;
}
List<ICubridNode> selections = new ArrayList<ICubridNode>();
Set<CubridDatabase> addedDatabaseSet = new HashSet<CubridDatabase>();
for (Object obj : objs) {
if (obj instanceof CubridServer) {
CubridServer server = (CubridServer) obj;
selections.add(server);
List<ICubridNode> children = server.getChildren();
if (children != null) {
for (ICubridNode child : children) {
if (child instanceof DefaultCubridNode) {
List<ICubridNode> dbChildren = ((DefaultCubridNode) child).getChildren();
for (ICubridNode dbChild : dbChildren) {
if (dbChild instanceof CubridDatabase) {
addedDatabaseSet.add((CubridDatabase) dbChild);
}
}
}
}
}
}
}
for (Object obj : objs) {
if (obj instanceof CubridDatabase) {
if (!addedDatabaseSet.contains(obj)) {
selections.add((ICubridNode) obj);
}
}
}
/*Process export*/
ExportConnectionDialog dialog = new ExportConnectionDialog(this.getShell(), selections);
dialog.open();
}
Aggregations