Search in sources :

Example 41 with DefaultSchemaNode

use of com.cubrid.common.ui.spi.model.DefaultSchemaNode in project cubrid-manager by CUBRID.

the class CubridTablesFolderLoader method createUserTableNode.

/**
	 * 
	 * Create user table node for other type
	 * 
	 * @param parent ICubridNode
	 * @param id The node id
	 * @param classInfo The model object
	 * @param level The load level
	 * @param monitor The IProgressMonitor
	 * @return ICubridNode object
	 */
public static ICubridNode createUserTableNode(ICubridNode parent, String id, ClassInfo classInfo, int level, IProgressMonitor monitor) {
    ICubridNode classNode = new DefaultSchemaNode(id, classInfo.getClassName(), "icons/navigator/schema_table_item.png");
    classNode.setEditorId(SchemaInfoEditorPart.ID);
    classNode.setContainer(true);
    classNode.setModelObj(classInfo);
    classNode.setType(NodeType.USER_TABLE);
    parent.addChild(classNode);
    ICubridNodeLoader loader = null;
    if (classInfo.isPartitionedClass()) {
        classNode.setType(NodeType.USER_PARTITIONED_TABLE_FOLDER);
        classNode.setIconPath("icons/navigator/schema_table_partition.png");
        classNode.setContainer(true);
        loader = new CubridPartitionedTableLoader();
    } else {
        loader = new CubridUserTableLoader();
    }
    loader.setLevel(level);
    classNode.setLoader(loader);
    if (level == DEFINITE_LEVEL) {
        classNode.getChildren(monitor);
    }
    return classNode;
}
Also used : ICubridNodeLoader(com.cubrid.common.ui.spi.model.ICubridNodeLoader) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) DefaultSchemaNode(com.cubrid.common.ui.spi.model.DefaultSchemaNode)

Example 42 with DefaultSchemaNode

use of com.cubrid.common.ui.spi.model.DefaultSchemaNode in project cubrid-manager by CUBRID.

the class CubridDatabaseLoader method addSerialFolder.

/**
	 * Add serial folder
	 * 
	 * @param monitor the IProgressMonitor
	 * @param database the CubridDatabase
	 */
private void addSerialFolder(final IProgressMonitor monitor, CubridDatabase database) {
    String serialFolderId = database.getId() + NODE_SEPARATOR + CubridSerialFolderLoader.SERIAL_FOLDER_ID;
    ICubridNode serialFolder = database.getChild(serialFolderId);
    if (serialFolder == null) {
        serialFolder = new DefaultSchemaNode(serialFolderId, SERIAL_FOLDER_NAME, "icons/navigator/serial_group.png");
        serialFolder.setType(NodeType.SERIAL_FOLDER);
        serialFolder.setContainer(true);
        ICubridNodeLoader loader = new CubridSerialFolderLoader();
        loader.setLevel(getLevel());
        serialFolder.setLoader(loader);
        database.addChild(serialFolder);
        if (getLevel() == DEFINITE_LEVEL) {
            serialFolder.getChildren(monitor);
        }
    } else {
        if (serialFolder.getLoader() != null && serialFolder.getLoader().isLoaded()) {
            serialFolder.getLoader().setLoaded(false);
            serialFolder.getChildren(monitor);
        }
    }
}
Also used : ICubridNodeLoader(com.cubrid.common.ui.spi.model.ICubridNodeLoader) CubridSerialFolderLoader(com.cubrid.common.ui.spi.model.loader.CubridSerialFolderLoader) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) DefaultSchemaNode(com.cubrid.common.ui.spi.model.DefaultSchemaNode)

Example 43 with DefaultSchemaNode

use of com.cubrid.common.ui.spi.model.DefaultSchemaNode in project cubrid-manager by CUBRID.

the class CubridDatabaseLoader method addViewFolder.

/**
	 * Add view folder
	 * 
	 * @param monitor the IProgressMonitor
	 * @param database the CubridDatabase
	 */
private void addViewFolder(final IProgressMonitor monitor, CubridDatabase database) {
    String viewsFolderId = database.getId() + NODE_SEPARATOR + CubridViewsFolderLoader.VIEWS_FOLDER_ID;
    ICubridNode viewsFolder = database.getChild(viewsFolderId);
    if (viewsFolder == null) {
        viewsFolder = new DefaultSchemaNode(viewsFolderId, VIEWS_FOLDER_NAME, "icons/navigator/schema_view.png");
        viewsFolder.setType(NodeType.VIEW_FOLDER);
        viewsFolder.setContainer(true);
        ICubridNodeLoader loader = new CubridViewsFolderLoader();
        loader.setLevel(getLevel());
        viewsFolder.setLoader(loader);
        database.addChild(viewsFolder);
        if (getLevel() == DEFINITE_LEVEL) {
            viewsFolder.getChildren(monitor);
        }
    } else {
        if (viewsFolder.getLoader() != null && viewsFolder.getLoader().isLoaded()) {
            viewsFolder.getLoader().setLoaded(false);
            viewsFolder.getChildren(monitor);
        }
    }
}
Also used : ICubridNodeLoader(com.cubrid.common.ui.spi.model.ICubridNodeLoader) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) DefaultSchemaNode(com.cubrid.common.ui.spi.model.DefaultSchemaNode) CubridViewsFolderLoader(com.cubrid.common.ui.spi.model.loader.schema.CubridViewsFolderLoader)

Example 44 with DefaultSchemaNode

use of com.cubrid.common.ui.spi.model.DefaultSchemaNode in project cubrid-manager by CUBRID.

the class CubridDatabaseLoader method addSpaceFolder.

/**
	 * Add database space folder
	 * 
	 * @param monitor the IProgressMonitor
	 * @param database the CubridDatabase
	 */
private void addSpaceFolder(final IProgressMonitor monitor, CubridDatabase database) {
    String databaseSpaceFolderId = database.getId() + NODE_SEPARATOR + DB_SPACE_FOLDER_ID;
    ICubridNode databaseSpaceFolder = database.getChild(databaseSpaceFolderId);
    if (databaseSpaceFolder == null) {
        databaseSpaceFolder = new DefaultSchemaNode(databaseSpaceFolderId, DB_SPACE_FOLDER_NAME, "icons/navigator/volume_group.png");
        databaseSpaceFolder.setType(CubridNodeType.DBSPACE_FOLDER);
        databaseSpaceFolder.setContainer(true);
        databaseSpaceFolder.setEditorId(DatabaseStatusEditor.ID);
        ICubridNodeLoader loader = new CubridDbSpaceFolderLoader();
        loader.setLevel(getLevel());
        databaseSpaceFolder.setLoader(loader);
        database.addChild(databaseSpaceFolder);
        if (getLevel() == DEFINITE_LEVEL) {
            databaseSpaceFolder.getChildren(monitor);
        }
    } else {
        if (databaseSpaceFolder.getLoader() != null && databaseSpaceFolder.getLoader().isLoaded()) {
            databaseSpaceFolder.getLoader().setLoaded(false);
            databaseSpaceFolder.getChildren(monitor);
        }
    }
}
Also used : ICubridNodeLoader(com.cubrid.common.ui.spi.model.ICubridNodeLoader) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) DefaultSchemaNode(com.cubrid.common.ui.spi.model.DefaultSchemaNode)

Example 45 with DefaultSchemaNode

use of com.cubrid.common.ui.spi.model.DefaultSchemaNode in project cubrid-manager by CUBRID.

the class CubridDatabaseLoader method addProcedureFolder.

/**
	 * Add procedure folder
	 * 
	 * @param monitor the IProgressMonitor
	 * @param database the CubridDatabase
	 */
private void addProcedureFolder(final IProgressMonitor monitor, CubridDatabase database) {
    String spFolderId = database.getId() + NODE_SEPARATOR + CubridSPFolderLoader.SP_FOLDER_ID;
    ICubridNode spFolder = database.getChild(spFolderId);
    if (spFolder == null) {
        spFolder = new DefaultSchemaNode(spFolderId, SP_FOLDER_NAME, "icons/navigator/procedure_group.png");
        spFolder.setType(NodeType.STORED_PROCEDURE_FOLDER);
        spFolder.setContainer(true);
        ICubridNodeLoader loader = new CubridSPFolderLoader();
        loader.setLevel(getLevel());
        spFolder.setLoader(loader);
        database.addChild(spFolder);
        if (getLevel() == DEFINITE_LEVEL) {
            spFolder.getChildren(monitor);
        }
    } else {
        if (spFolder.getLoader() != null && spFolder.getLoader().isLoaded()) {
            spFolder.getLoader().setLoaded(false);
            spFolder.getChildren(monitor);
        }
    }
}
Also used : ICubridNodeLoader(com.cubrid.common.ui.spi.model.ICubridNodeLoader) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) DefaultSchemaNode(com.cubrid.common.ui.spi.model.DefaultSchemaNode) CubridSPFolderLoader(com.cubrid.common.ui.spi.model.loader.sp.CubridSPFolderLoader)

Aggregations

DefaultSchemaNode (com.cubrid.common.ui.spi.model.DefaultSchemaNode)88 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)62 CubridDatabase (com.cubrid.common.ui.spi.model.CubridDatabase)33 ISchemaNode (com.cubrid.common.ui.spi.model.ISchemaNode)22 ICubridNodeLoader (com.cubrid.common.ui.spi.model.ICubridNodeLoader)21 DatabaseInfo (com.cubrid.cubridmanager.core.cubrid.database.model.DatabaseInfo)18 CubridNodeChangedEvent (com.cubrid.common.ui.spi.event.CubridNodeChangedEvent)17 ArrayList (java.util.ArrayList)15 TreeViewer (org.eclipse.jface.viewers.TreeViewer)10 CommonTaskExec (com.cubrid.common.ui.spi.progress.CommonTaskExec)9 ExecTaskWithProgress (com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)9 Display (org.eclipse.swt.widgets.Display)9 TaskExecutor (com.cubrid.common.ui.spi.progress.TaskExecutor)8 ClassInfo (com.cubrid.cubridmanager.core.cubrid.table.model.ClassInfo)7 File (java.io.File)5 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)4 CommonQueryTask (com.cubrid.cubridmanager.core.common.task.CommonQueryTask)4 DbSpaceInfoList (com.cubrid.cubridmanager.core.cubrid.dbspace.model.DbSpaceInfoList)4 GetAllClassListTask (com.cubrid.cubridmanager.core.cubrid.table.task.GetAllClassListTask)4 DbUserInfo (com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfo)4