use of com.cubrid.common.ui.spi.event.CubridNodeChangedEventType in project cubrid-manager by CUBRID.
the class EditVirtualTableDialog method nodeChanged.
public void nodeChanged(CubridNodeChangedEvent event) {
ICubridNode cubridNode = event.getCubridNode();
CubridNodeChangedEventType eventType = event.getType();
if (cubridNode == null || eventType == null) {
return;
}
if (CubridNodeChangedEventType.SERVER_DISCONNECTED.equals(event.getType())) {
super.close();
}
if (CubridNodeChangedEventType.DATABASE_LOGOUT.equals(event.getType()) || CubridNodeChangedEventType.DATABASE_STOP.equals(event.getType())) {
super.close();
}
}
use of com.cubrid.common.ui.spi.event.CubridNodeChangedEventType in project cubrid-manager by CUBRID.
the class DBSpaceLabelProvider method nodeChanged.
/**
* Perform node change event
*/
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.SERVER_DISCONNECTED.equals(eventType) || CubridNodeChangedEventType.NODE_REMOVE.equals(eventType)) {
if (serverInfo != null && StringUtil.isEqualNotIgnoreNull(cubridNode.getName(), serverInfo.getServerName())) {
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 SchemaInfoEditorPart method nodeChanged.
/**
* @see com.cubrid.common.ui.spi.event.ICubridNodeChangedListener#nodeChanged(com.cubrid.common.ui.spi.event.CubridNodeChangedEvent)
* @param event the CubridNodeChangedEvent object
*/
public void nodeChanged(CubridNodeChangedEvent event) {
ICubridNode eventNode = event.getCubridNode();
if (eventNode == null) {
return;
}
CubridNodeChangedEventType type = event.getType();
ICubridNode node = null;
if (type == CubridNodeChangedEventType.CONTAINER_NODE_REFRESH) {
node = eventNode.getChild(cubridNode == null ? "" : cubridNode.getId());
} else if (type == CubridNodeChangedEventType.NODE_REFRESH && eventNode.getId().equals(cubridNode.getId())) {
node = eventNode;
} else {
return;
}
if (node == null) {
return;
}
cubridNode = node;
synchronized (this) {
database.clearSchemas();
refresh();
}
}
use of com.cubrid.common.ui.spi.event.CubridNodeChangedEventType in project cubrid-manager by CUBRID.
the class ERSchemaEditor method close.
/**
* Close the editors which are the same database
*
* @param event CubridNodeChangedEvent
* @param database CubridDatabase
*/
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 CubridEditorPart method close.
/**
* close the editors which are the same server
* @param event
* @param database
*/
public void close(CubridNodeChangedEvent event, CubridServer server) {
ICubridNode cubridNode = event.getCubridNode();
CubridNodeChangedEventType eventType = event.getType();
if (cubridNode == null || eventType == null) {
return;
}
if (event.getSource() instanceof CubridServer) {
CubridServer eventCubridServer = (CubridServer) event.getSource();
if (eventCubridServer.equals(server)) {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window == null) {
return;
}
window.getActivePage().closeEditor(this, true);
}
}
}
Aggregations