use of com.cubrid.common.ui.spi.event.CubridNodeChangedEventType in project cubrid-manager by CUBRID.
the class ServiceDashboardEditor method nodeChanged.
/**
* Perform node changed
*/
public void nodeChanged(CubridNodeChangedEvent event) {
ICubridNode cubridNode = event.getCubridNode();
CubridNodeChangedEventType eventType = event.getType();
if (cubridNode == null || eventType == null) {
return;
}
if (NodeType.SERVER.equals(cubridNode.getType())) {
if (CubridNodeChangedEventType.NODE_ADD.equals(event.getType()) || CubridNodeChangedEventType.NODE_REMOVE.equals(event.getType())) {
loadAllData();
} else {
serviceTreeViewer.refresh(cubridNode);
}
}
}
use of com.cubrid.common.ui.spi.event.CubridNodeChangedEventType in project cubrid-manager by CUBRID.
the class ColumnProposalAdvisor method nodeChanged.
/**
* Perform node changed event
*/
public void nodeChanged(CubridNodeChangedEvent event) {
ICubridNode cubridNode = event.getCubridNode();
CubridNodeChangedEventType eventType = event.getType();
if (cubridNode == null || eventType == null) {
return;
}
if ((NodeType.USER_TABLE.equals(cubridNode.getType()) || NodeType.USER_VIEW.equals(cubridNode.getType())) && cubridNode instanceof DefaultSchemaNode) {
DefaultSchemaNode schemaNode = (DefaultSchemaNode) cubridNode;
DatabaseInfo databaseInfo = schemaNode.getDatabase().getDatabaseInfo();
if (CubridNodeChangedEventType.NODE_REMOVE.equals(eventType)) {
removeTable(databaseInfo, schemaNode.getName());
} else if (CubridNodeChangedEventType.NODE_ADD.equals(eventType) || CubridNodeChangedEventType.NODE_REFRESH.equals(eventType)) {
refreshTable(databaseInfo, schemaNode.getName());
}
}
if (NodeType.DATABASE.equals(cubridNode.getType()) && cubridNode instanceof CubridDatabase) {
CubridDatabase database = (CubridDatabase) cubridNode;
if (CubridNodeChangedEventType.DATABASE_LOGIN.equals(eventType)) {
removeProposal(database.getDatabaseInfo());
findProposal(database.getDatabaseInfo());
}
if (CubridNodeChangedEventType.DATABASE_LOGOUT.equals(eventType)) {
removeProposal(database.getDatabaseInfo());
}
if (CubridNodeChangedEventType.CONTAINER_NODE_REFRESH.equals(eventType)) {
removeProposal(database.getDatabaseInfo());
findProposal(database.getDatabaseInfo());
}
}
if (NodeType.TABLE_FOLDER.equals(cubridNode.getType()) || NodeType.VIEW_FOLDER.equals(cubridNode.getType()) && CubridNodeChangedEventType.CONTAINER_NODE_REFRESH.equals(eventType) && cubridNode instanceof DefaultSchemaNode) {
DefaultSchemaNode schemaNode = (DefaultSchemaNode) cubridNode;
removeProposal(schemaNode.getDatabase().getDatabaseInfo());
findProposal(schemaNode.getDatabase().getDatabaseInfo());
}
}
use of com.cubrid.common.ui.spi.event.CubridNodeChangedEventType in project cubrid-manager by CUBRID.
the class CubridEditorPart method close.
/**
* close the editors which are the same database
* @param event
* @param database
*/
public void close(CubridNodeChangedEvent event, CubridDatabase database) {
ICubridNode cubridNode = event.getCubridNode();
CubridNodeChangedEventType eventType = event.getType();
if (cubridNode == null || eventType == null) {
return;
}
if (event.getSource() instanceof CubridDatabase) {
CubridDatabase eventCubridDatabase = (CubridDatabase) event.getSource();
if (eventCubridDatabase.equals(database)) {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window == null) {
return;
}
window.getActivePage().closeEditor(this, true);
}
}
}
use of com.cubrid.common.ui.spi.event.CubridNodeChangedEventType in project cubrid-manager by CUBRID.
the class ConnectionKeepAliveHandler method nodeChanged.
@Override
public void nodeChanged(CubridNodeChangedEvent event) {
ICubridNode cubridNode = event.getCubridNode();
CubridNodeChangedEventType eventType = event.getType();
if (cubridNode == null || eventType == null) {
return;
}
if (!(cubridNode instanceof CubridServer)) {
return;
}
CubridServer server = (CubridServer) cubridNode;
ServerInfo serverInfo = server.getServerInfo();
if (CubridNodeChangedEventType.SERVER_CONNECTED.equals(eventType)) {
addServer(serverInfo);
} else if (CubridNodeChangedEventType.SERVER_DISCONNECTED.equals(eventType)) {
delServer(serverInfo);
}
}
use of com.cubrid.common.ui.spi.event.CubridNodeChangedEventType in project cubrid-manager by CUBRID.
the class QueryEditorPart method nodeChanged.
/**
* When navigator node change ,refresh the database list on query editor
*
* @param event CubridNodeChangedEvent
*/
public void nodeChanged(CubridNodeChangedEvent event) {
ICubridNode cubridNode = event.getCubridNode();
CubridNodeChangedEventType eventType = event.getType();
if (cubridNode == null || eventType == null) {
return;
}
String type = cubridNode.getType();
if (!NodeType.SERVER.equals(type) && !NodeType.DATABASE_FOLDER.equals(type) && !NodeType.DATABASE.equals(type)) {
return;
}
/* Judge the event type */
if (!CubridNodeChangedEventType.SERVER_CONNECTED.equals(eventType) && !CubridNodeChangedEventType.SERVER_DISCONNECTED.equals(eventType) && !CubridNodeChangedEventType.DATABASE_LOGIN.equals(eventType) && !CubridNodeChangedEventType.DATABASE_LOGOUT.equals(eventType) && !CubridNodeChangedEventType.DATABASE_STOP.equals(eventType) && !CubridNodeChangedEventType.DATABASE_START.equals(eventType)) {
return;
}
synchronized (this) {
qeToolBar.refresh();
}
}
Aggregations