Search in sources :

Example 1 with CubridViewsFolderLoader

use of com.cubrid.common.ui.spi.model.loader.schema.CubridViewsFolderLoader 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 2 with CubridViewsFolderLoader

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

the class CQBDbConnectionLoader 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 + 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)

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 CubridViewsFolderLoader (com.cubrid.common.ui.spi.model.loader.schema.CubridViewsFolderLoader)2