Search in sources :

Example 61 with ICubridNode

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());
                }
            }
        }
    }
}
Also used : ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode)

Example 62 with ICubridNode

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());
    }
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) BackupPlanInfo(com.cubrid.cubridmanager.core.cubrid.jobauto.model.BackupPlanInfo)

Example 63 with ICubridNode

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);
    }
}
Also used : ISchemaNode(com.cubrid.common.ui.spi.model.ISchemaNode) TableItem(org.eclipse.swt.widgets.TableItem) ArrayList(java.util.ArrayList) DeleteQueryPlanAction(com.cubrid.cubridmanager.ui.cubrid.jobauto.action.DeleteQueryPlanAction) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) QueryPlanInfo(com.cubrid.cubridmanager.core.cubrid.jobauto.model.QueryPlanInfo) HashSet(java.util.HashSet)

Example 64 with ICubridNode

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);
    }
}
Also used : DeleteBackupPlanAction(com.cubrid.cubridmanager.ui.cubrid.jobauto.action.DeleteBackupPlanAction) ISchemaNode(com.cubrid.common.ui.spi.model.ISchemaNode) TableItem(org.eclipse.swt.widgets.TableItem) ArrayList(java.util.ArrayList) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) BackupPlanInfo(com.cubrid.cubridmanager.core.cubrid.jobauto.model.BackupPlanInfo) HashSet(java.util.HashSet)

Example 65 with ICubridNode

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();
    }
}
Also used : ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode)

Aggregations

ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)362 CubridDatabase (com.cubrid.common.ui.spi.model.CubridDatabase)67 ArrayList (java.util.ArrayList)67 DefaultSchemaNode (com.cubrid.common.ui.spi.model.DefaultSchemaNode)62 TreeViewer (org.eclipse.jface.viewers.TreeViewer)62 CubridNodeChangedEvent (com.cubrid.common.ui.spi.event.CubridNodeChangedEvent)55 ISchemaNode (com.cubrid.common.ui.spi.model.ISchemaNode)55 CubridServer (com.cubrid.common.ui.spi.model.CubridServer)41 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)40 ServerUserInfo (com.cubrid.cubridmanager.core.common.model.ServerUserInfo)33 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)32 DatabaseInfo (com.cubrid.cubridmanager.core.cubrid.database.model.DatabaseInfo)31 ICubridNodeLoader (com.cubrid.common.ui.spi.model.ICubridNodeLoader)27 ExecTaskWithProgress (com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)26 CubridGroupNode (com.cubrid.common.ui.spi.model.CubridGroupNode)25 DefaultCubridNode (com.cubrid.common.ui.spi.model.DefaultCubridNode)25 TaskExecutor (com.cubrid.common.ui.spi.progress.TaskExecutor)25 ISelectionProvider (org.eclipse.jface.viewers.ISelectionProvider)25 CommonTaskExec (com.cubrid.common.ui.spi.progress.CommonTaskExec)23 CubridNavigatorView (com.cubrid.common.ui.common.navigator.CubridNavigatorView)22