Search in sources :

Example 1 with CubridTriggerFolderLoader

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

the class CubridDatabaseLoader method addTriggerFolder.

/**
	 * Add trigger folder
	 * 
	 * @param monitor the IProgressMonitor
	 * @param database the CubridDatabase
	 */
private void addTriggerFolder(final IProgressMonitor monitor, CubridDatabase database) {
    String tiggerFolderId = database.getId() + NODE_SEPARATOR + CubridTriggerFolderLoader.TRIGGER_FOLDER_ID;
    ICubridNode tiggerFolder = database.getChild(tiggerFolderId);
    //IsDBAUserTask
    if (tiggerFolder == null) {
        tiggerFolder = new DefaultSchemaNode(tiggerFolderId, TRIGGER_FOLDER_NAME, "icons/navigator/trigger_group.png");
        tiggerFolder.setType(NodeType.TRIGGER_FOLDER);
        tiggerFolder.setContainer(true);
        ICubridNodeLoader loader = new CubridTriggerFolderLoader();
        loader.setLevel(getLevel());
        tiggerFolder.setLoader(loader);
        database.addChild(tiggerFolder);
        if (getLevel() == DEFINITE_LEVEL) {
            tiggerFolder.getChildren(monitor);
        }
    } else {
        if (tiggerFolder.getLoader() != null && tiggerFolder.getLoader().isLoaded()) {
            tiggerFolder.getLoader().setLoaded(false);
            tiggerFolder.getChildren(monitor);
        }
    }
}
Also used : ICubridNodeLoader(com.cubrid.common.ui.spi.model.ICubridNodeLoader) CubridTriggerFolderLoader(com.cubrid.common.ui.spi.model.loader.CubridTriggerFolderLoader) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) DefaultSchemaNode(com.cubrid.common.ui.spi.model.DefaultSchemaNode)

Example 2 with CubridTriggerFolderLoader

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

the class CQBDbConnectionLoader method addTriggerFolder.

/**
	 * Add trigger folder
	 * 
	 * @param monitor the IProgressMonitor
	 * @param database the CubridDatabase
	 */
private void addTriggerFolder(final IProgressMonitor monitor, CubridDatabase database) {
    if (!database.getDatabaseInfo().getAuthLoginedDbUserInfo().isDbaAuthority()) {
        return;
    }
    String tiggerFolderId = database.getId() + NODE_SEPARATOR + TRIGGER_FOLDER_ID;
    ICubridNode tiggerFolder = database.getChild(tiggerFolderId);
    if (tiggerFolder == null) {
        tiggerFolder = new DefaultSchemaNode(tiggerFolderId, TRIGGER_FOLDER_NAME, "icons/navigator/trigger_group.png");
        tiggerFolder.setType(NodeType.TRIGGER_FOLDER);
        tiggerFolder.setContainer(true);
        ICubridNodeLoader loader = new CubridTriggerFolderLoader();
        loader.setLevel(getLevel());
        tiggerFolder.setLoader(loader);
        database.addChild(tiggerFolder);
        if (getLevel() == DEFINITE_LEVEL) {
            tiggerFolder.getChildren(monitor);
        }
    } else {
        if (tiggerFolder.getLoader() != null && tiggerFolder.getLoader().isLoaded()) {
            tiggerFolder.getLoader().setLoaded(false);
            tiggerFolder.getChildren(monitor);
        }
    }
}
Also used : ICubridNodeLoader(com.cubrid.common.ui.spi.model.ICubridNodeLoader) CubridTriggerFolderLoader(com.cubrid.common.ui.spi.model.loader.CubridTriggerFolderLoader) 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 CubridTriggerFolderLoader (com.cubrid.common.ui.spi.model.loader.CubridTriggerFolderLoader)2