Search in sources :

Example 1 with CubridSPFolderLoader

use of com.cubrid.common.ui.spi.model.loader.sp.CubridSPFolderLoader 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)

Example 2 with CubridSPFolderLoader

use of com.cubrid.common.ui.spi.model.loader.sp.CubridSPFolderLoader in project cubrid-manager by CUBRID.

the class CQBDbConnectionLoader 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 + 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)2 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)2 ICubridNodeLoader (com.cubrid.common.ui.spi.model.ICubridNodeLoader)2 CubridSPFolderLoader (com.cubrid.common.ui.spi.model.loader.sp.CubridSPFolderLoader)2