Search in sources :

Example 1 with CubridTablesFolderLoader

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

the class CubridDatabaseLoader method addTableFolder.

/**
	 * Add table folder
	 * 
	 * @param monitor the IProgressMonitor
	 * @param database the CubridDatabase
	 */
private void addTableFolder(final IProgressMonitor monitor, CubridDatabase database) {
    String tablesFolderId = database.getId() + NODE_SEPARATOR + CubridTablesFolderLoader.TABLES_FOLDER_ID;
    ICubridNode tablesFolder = database.getChild(tablesFolderId);
    if (tablesFolder == null) {
        tablesFolder = new DefaultSchemaNode(tablesFolderId, TABLES_FOLDER_NAME, "icons/navigator/schema_table.png");
        tablesFolder.setType(NodeType.TABLE_FOLDER);
        tablesFolder.setContainer(true);
        ICubridNodeLoader loader = new CubridTablesFolderLoader();
        loader.setLevel(getLevel());
        tablesFolder.setLoader(loader);
        database.addChild(tablesFolder);
        if (getLevel() == DEFINITE_LEVEL) {
            tablesFolder.getChildren(monitor);
        }
    } else {
        if (tablesFolder.getLoader() != null && tablesFolder.getLoader().isLoaded()) {
            tablesFolder.getLoader().setLoaded(false);
            tablesFolder.getChildren(monitor);
        }
    }
}
Also used : ICubridNodeLoader(com.cubrid.common.ui.spi.model.ICubridNodeLoader) CubridTablesFolderLoader(com.cubrid.common.ui.spi.model.loader.schema.CubridTablesFolderLoader) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) DefaultSchemaNode(com.cubrid.common.ui.spi.model.DefaultSchemaNode)

Example 2 with CubridTablesFolderLoader

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

the class CQBDbConnectionLoader method addTableFolder.

/**
	 * Add table folder
	 * 
	 * @param monitor the IProgressMonitor
	 * @param database the CubridDatabase
	 */
private void addTableFolder(final IProgressMonitor monitor, CubridDatabase database) {
    String tablesFolderId = database.getId() + NODE_SEPARATOR + CubridTablesFolderLoader.TABLES_FOLDER_ID;
    ICubridNode tablesFolder = database.getChild(tablesFolderId);
    if (tablesFolder == null) {
        tablesFolder = new DefaultSchemaNode(tablesFolderId, TABLES_FOLDER_NAME, "icons/navigator/schema_table.png");
        tablesFolder.setType(NodeType.TABLE_FOLDER);
        tablesFolder.setContainer(true);
        ICubridNodeLoader loader = new CubridTablesFolderLoader();
        loader.setLevel(getLevel());
        tablesFolder.setLoader(loader);
        database.addChild(tablesFolder);
        if (getLevel() == DEFINITE_LEVEL) {
            tablesFolder.getChildren(monitor);
        }
    } else {
        if (tablesFolder.getLoader() != null && tablesFolder.getLoader().isLoaded()) {
            tablesFolder.getLoader().setLoaded(false);
            tablesFolder.getChildren(monitor);
        }
    }
}
Also used : ICubridNodeLoader(com.cubrid.common.ui.spi.model.ICubridNodeLoader) CubridTablesFolderLoader(com.cubrid.common.ui.spi.model.loader.schema.CubridTablesFolderLoader) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) DefaultSchemaNode(com.cubrid.common.ui.spi.model.DefaultSchemaNode)

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