Search in sources :

Example 6 with DBClasses

use of com.cubrid.cubridmanager.core.cubrid.table.model.DBClasses in project cubrid-manager by CUBRID.

the class GetClassListTaskTest method testClassInfo.

public void testClassInfo() {
    if (StringUtil.isEqual(SystemParameter.getParameterValue("useMockTest"), "n"))
        return;
    System.out.println("<table.classinfo.001.req.txt>");
    GetClassListTask task = new GetClassListTask(serverInfo);
    task.setDbName("demodb");
    task.setDbStatus(OnOffType.OFF);
    task.execute();
    assertTrue(task.isSuccess());
    DBClasses classes = task.getDbClassInfo();
    ClassList classList = classes.getSystemClassList();
    List<ClassItem> list = classList.getClassList();
    assertEquals("db_root", list.get(0).getClassname());
}
Also used : ClassItem(com.cubrid.cubridmanager.core.cubrid.table.model.ClassItem) DBClasses(com.cubrid.cubridmanager.core.cubrid.table.model.DBClasses) ClassList(com.cubrid.cubridmanager.core.cubrid.table.model.ClassList)

Example 7 with DBClasses

use of com.cubrid.cubridmanager.core.cubrid.table.model.DBClasses in project cubrid-manager by CUBRID.

the class ModelUtil method getClassList.

/**
	 * Parse SchemaInfo message TreeNode and return SchemaInfo Object
	 * 
	 * @param classesinfo TreeNode
	 * @return DBClasses
	 */
public static DBClasses getClassList(TreeNode classesinfo) {
    DBClasses schema = new DBClasses();
    SocketTask.setFieldValue(classesinfo, schema);
    return schema;
}
Also used : DBClasses(com.cubrid.cubridmanager.core.cubrid.table.model.DBClasses)

Example 8 with DBClasses

use of com.cubrid.cubridmanager.core.cubrid.table.model.DBClasses in project cubrid-manager by CUBRID.

the class SelectTablesPage method pageChanged.

/**
	 * @see org.eclipse.jface.dialogs.IPageChangedListener#pageChanged(org.eclipse.jface.dialogs.PageChangedEvent)
	 * @param event PageChangedEvent
	 */
public void pageChanged(PageChangedEvent event) {
    IWizardPage page = (IWizardPage) event.getSelectedPage();
    if (page.getName().equals(PAGENAME)) {
        SelectDatabasePage selectDatabasePage = (SelectDatabasePage) getWizard().getPage(SelectDatabasePage.PAGENAME);
        String dbName = selectDatabasePage.getDbName();
        String dbaPassword = selectDatabasePage.getDbaPassword();
        if (host != null && host.isValid()) {
            String ip = host.getIp();
            String port = host.getPort();
            String userName = host.getUserName();
            String password = host.getPassword();
            GetAllClassesTaskExecutor taskExcutor = new GetAllClassesTaskExecutor(getShell(), ip, port, userName, password, dbName, dbaPassword);
            new ExecTaskWithProgress(taskExcutor).exec();
            if (taskExcutor.isSuccess()) {
                DBClasses dbClasses = taskExcutor.getDBClasses();
                selectTableComp.fillTableViewer(dbClasses);
                selectTableComp.setReplAllTables(master.isReplicateAll());
                selectTableComp.setSelectedTableList(master.getReplicatedClassList());
                setErrorMessage(null);
                setPageComplete(isEditable);
            } else {
                setErrorMessage(Messages.errPreviousPage);
                setPageComplete(false);
            }
        }
    }
}
Also used : ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress) IWizardPage(org.eclipse.jface.wizard.IWizardPage) DBClasses(com.cubrid.cubridmanager.core.cubrid.table.model.DBClasses) GetAllClassesTaskExecutor(com.cubrid.cubridmanager.ui.replication.control.GetAllClassesTaskExecutor)

Aggregations

DBClasses (com.cubrid.cubridmanager.core.cubrid.table.model.DBClasses)8 ExecTaskWithProgress (com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)4 IWizardPage (org.eclipse.jface.wizard.IWizardPage)3 ClassItem (com.cubrid.cubridmanager.core.cubrid.table.model.ClassItem)2 ITask (com.cubrid.common.core.task.ITask)1 CubridDatabase (com.cubrid.common.ui.spi.model.CubridDatabase)1 ISchemaNode (com.cubrid.common.ui.spi.model.ISchemaNode)1 TaskExecutor (com.cubrid.common.ui.spi.progress.TaskExecutor)1 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)1 TreeNode (com.cubrid.cubridmanager.core.common.socket.TreeNode)1 ClassList (com.cubrid.cubridmanager.core.cubrid.table.model.ClassList)1 GetClassListTask (com.cubrid.cubridmanager.core.cubrid.table.task.GetClassListTask)1 UnloadDatabaseDialog (com.cubrid.cubridmanager.ui.cubrid.database.dialog.UnloadDatabaseDialog)1 GetAllClassesTaskExecutor (com.cubrid.cubridmanager.ui.replication.control.GetAllClassesTaskExecutor)1 ArrayList (java.util.ArrayList)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 Shell (org.eclipse.swt.widgets.Shell)1