use of com.cubrid.common.ui.spi.model.ICubridNode in project cubrid-manager by CUBRID.
the class SettingHostPage method initSlaveDBList.
/**
* Init slave db list
*
*/
private void initSlaveDBList(CubridServer cubridServer) {
slaveDBList.removeAll();
List<ICubridNode> children = cubridServer.getChildren();
for (ICubridNode child : children) {
if (NodeType.DATABASE_FOLDER.equals(child.getType())) {
for (ICubridNode db : child.getChildren()) {
if (NodeType.DATABASE.equals(db.getType())) {
slaveDBList.add(db.getName());
}
}
}
}
}
use of com.cubrid.common.ui.spi.model.ICubridNode in project cubrid-manager by CUBRID.
the class EditBackupPlanDialog method initPara.
/**
* Initials the backupPlanInfo,database and childrenLabel
*
* @param selection the selection to set
*/
public void initPara(DefaultSchemaNode selection) {
childrenLabel = new ArrayList<String>();
ICubridNode[] childrenNode = null;
database = selection.getDatabase();
if (operation == AddEditType.EDIT) {
backupPlanInfo = (BackupPlanInfo) selection.getAdapter(BackupPlanInfo.class);
childrenNode = selection.getParent().getChildren(new NullProgressMonitor());
} else {
backupPlanInfo = new BackupPlanInfo();
String dbPath = database.getDatabaseInfo().getDbDir();
dbPath = FileUtil.changeSeparatorByOS(dbPath, database.getServer().getServerInfo().getServerOsInfo());
defaultPath = dbPath + selection.getServer().getServerInfo().getPathSeparator() + "backup";
childrenNode = selection.getChildren(new NullProgressMonitor());
}
for (ICubridNode childNode : childrenNode) {
childrenLabel.add(childNode.getLabel());
}
}
use of com.cubrid.common.ui.spi.model.ICubridNode in project cubrid-manager by CUBRID.
the class JobAutoDashboardEditorPart method deleteQueryPlan.
public void deleteQueryPlan() {
TableItem[] items = queryPlanInfoTable.getTable().getSelection();
if (items.length > 0) {
List<ISchemaNode> selectNodeList = new ArrayList<ISchemaNode>();
for (TableItem item : items) {
QueryPlanInfo queryPlanInfo = (QueryPlanInfo) item.getData();
Set<String> typeSet = new HashSet<String>();
typeSet.add(CubridNodeType.QUERY_PLAN);
ICubridNode queryPlanNode = CommonUITool.findNode(database, typeSet, queryPlanInfo.getQuery_id());
selectNodeList.add((ISchemaNode) queryPlanNode);
}
if (selectNodeList.size() > 0) {
DeleteQueryPlanAction action = (DeleteQueryPlanAction) ActionManager.getInstance().getAction(DeleteQueryPlanAction.ID);
ISchemaNode[] nodeArr = new ISchemaNode[selectNodeList.size()];
action.run(selectNodeList.toArray(nodeArr));
refreshQueryPlan();
}
} else {
CommonUITool.openWarningBox(Messages.errJobAutoNoSelection);
}
}
use of com.cubrid.common.ui.spi.model.ICubridNode in project cubrid-manager by CUBRID.
the class JobAutoDashboardEditorPart method deleteBackupPlan.
public void deleteBackupPlan() {
TableItem[] items = backupPlanInfoTable.getTable().getSelection();
if (items.length > 0) {
List<ISchemaNode> selectNodeList = new ArrayList<ISchemaNode>();
for (TableItem item : items) {
BackupPlanInfo backupPlanInfo = (BackupPlanInfo) item.getData();
Set<String> typeSet = new HashSet<String>();
typeSet.add(CubridNodeType.BACKUP_PLAN);
ICubridNode backupPlanNode = CommonUITool.findNode(database, typeSet, backupPlanInfo.getBackupid());
selectNodeList.add((ISchemaNode) backupPlanNode);
}
if (selectNodeList.size() > 0) {
DeleteBackupPlanAction action = (DeleteBackupPlanAction) ActionManager.getInstance().getAction(DeleteBackupPlanAction.ID);
ISchemaNode[] nodeArr = new ISchemaNode[selectNodeList.size()];
action.run(selectNodeList.toArray(nodeArr));
refreshBackupPlan();
}
} else {
CommonUITool.openWarningBox(Messages.errJobAutoNoSelection);
}
}
use of com.cubrid.common.ui.spi.model.ICubridNode in project cubrid-manager by CUBRID.
the class CQBUserEditor method nodeChanged.
/**
* When node changed,call it
*
* @param event the node changed event
*/
public void nodeChanged(CubridNodeChangedEvent event) {
ICubridNode eventNode = event.getCubridNode();
if (eventNode == null || event.getType() != CubridNodeChangedEventType.CONTAINER_NODE_REFRESH) {
return;
}
ICubridNode node = eventNode.getChild(cubridNode == null ? "" : cubridNode.getId());
if (node == null) {
return;
}
synchronized (this) {
loadData();
}
}
Aggregations