use of org.eclipse.gef.requests.SelectionRequest in project tdi-studio-se by Talend.
the class SubjobContainerPart method performRequest.
@Override
public void performRequest(Request req) {
if (req instanceof SelectionRequest) {
Point location = ((SelectionRequest) req).getLocation();
List<NodeContainer> list = this.getModelChildren();
for (NodeContainer nodeCon : list) {
if (nodeCon.getErrorMarkRectangle() != null && nodeCon.getErrorMarkRectangle().contains(location)) {
Node node = nodeCon.getNode();
if (node.isErrorFlag()) {
// getViewer().getControl().getShell();
Shell shell = Display.getCurrent().getActiveShell();
ErrorMessageDialog dialog = new ErrorMessageDialog(new Shell(shell), node);
dialog.open();
break;
}
} else if (nodeCon.getErrorRectangle() != null && nodeCon.getErrorRectangle().contains(location)) {
Node node = nodeCon.getNode();
showModules(node);
}
}
}
super.performRequest(req);
}
use of org.eclipse.gef.requests.SelectionRequest in project cubrid-manager by CUBRID.
the class MonitorDetailAction method run.
/**
* Open monitor detail windows.
*/
public void run() {
Object[] objArr = this.getSelectedObj();
if (objArr == null || objArr.length <= 0 || !isSupported(objArr[0])) {
setEnabled(false);
return;
}
HANodePart part = null;
if (objArr[0] instanceof HostMonitorPart) {
part = (HostMonitorPart) objArr[0];
} else if (objArr[0] instanceof DatabaseMonitorPart) {
part = (DatabaseMonitorPart) objArr[0];
} else if (objArr[0] instanceof BrokerMonitorPart) {
part = (BrokerMonitorPart) objArr[0];
}
if (part != null) {
SelectionRequest sr = new SelectionRequest();
sr.setType(RequestConstants.REQ_OPEN);
part.performRequest(sr);
}
}
Aggregations