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;
}
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);
}
}
}
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);
}
}
}
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);
}
}
}
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);
}
}
}
Aggregations