use of com.cubrid.cubridmanager.ui.mondashboard.editor.parts.HANodePart in project cubrid-manager by CUBRID.
the class GefViewerKeyHandler method keyPressed.
/**
* @see org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler.keyPressed
* @param event KeyEvent
* @return true or false.
*/
public boolean keyPressed(KeyEvent event) {
GraphicalEditPart editPart = getFocusEditPart();
if (editPart instanceof HANodePart) {
if (moveHANodesByKey(event)) {
return true;
}
if (deleteHANodeByKey(event)) {
return true;
}
}
if (editPart instanceof DashboardPart && event.keyCode == SWT.F5) {
DashboardPart dp = (DashboardPart) editPart;
dp.refresh();
List<?> childEditPart = dp.getChildren();
for (Object child : childEditPart) {
((EditPart) child).refresh();
}
}
return super.keyPressed(event);
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.parts.HANodePart in project cubrid-manager by CUBRID.
the class ClearNodeErrorMsgAction method run.
/**
* Create a new figure in dashboard.
*
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
IStructuredSelection selection = (IStructuredSelection) getSelection();
Iterator<?> iterator = selection.iterator();
EditPart root = null;
while (iterator.hasNext()) {
Object objSelected = iterator.next();
if (objSelected instanceof HANodePart) {
HANodePart ep = (HANodePart) objSelected;
((HANode) ep.getModel()).clearErrorMessages();
root = ep.getParent();
}
}
if (root != null) {
root.refresh();
}
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.parts.HANodePart in project cubrid-manager by CUBRID.
the class DashboardRefreshAction method run.
/**
* refresh dashboard run.
*
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
Object[] objArr = this.getSelectedObj();
if (objArr == null || objArr.length <= 0 || !isSupported(objArr[0])) {
setEnabled(false);
return;
}
DashboardPart dp = null;
if (objArr[0] instanceof DashboardPart) {
dp = (DashboardPart) objArr[0];
} else {
dp = (DashboardPart) ((EditPart) objArr[0]).getParent();
}
//Clear error messages
IStructuredSelection selection = (IStructuredSelection) getSelection();
Iterator<?> iterator = selection.iterator();
while (iterator.hasNext()) {
Object objSelected = iterator.next();
if (objSelected instanceof HANodePart) {
HANodePart ep = (HANodePart) objSelected;
((HANode) ep.getModel()).clearErrorMessages();
}
}
dp.refresh();
List<?> childEditPart = dp.getChildren();
for (Object child : childEditPart) {
((EditPart) child).refresh();
}
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.parts.HANodePart in project cubrid-manager by CUBRID.
the class MinimizeFigureAction method run.
/**
* Create a new figure in dashboard.
*
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
IStructuredSelection selection = (IStructuredSelection) getSelection();
Iterator<?> iterator = selection.iterator();
while (iterator.hasNext()) {
Object objSelected = iterator.next();
if (objSelected instanceof HANodePart) {
HANodePart cmp = (HANodePart) objSelected;
cmp.setMinimized(isChecked());
cmp.refresh();
}
}
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.parts.HANodePart in project cubrid-manager by CUBRID.
the class MinimizeFigureAction method isSupported.
/**
* Always support
*
* @see com.cubrid.common.ui.spi.action.ISelectionAction#isSupported(java.lang.Object)
* @param obj Object
* @return boolean support:true;not support:false;
*/
public boolean isSupported(Object obj) {
IStructuredSelection selection = (IStructuredSelection) getSelection();
Iterator<?> iterator = selection.iterator();
boolean minimize = true;
while (iterator.hasNext()) {
Object objSelected = iterator.next();
if (objSelected instanceof HANodePart) {
HANodePart cmp = (HANodePart) objSelected;
if (!cmp.isMinimized()) {
minimize = false;
break;
}
}
}
setChecked(minimize);
return true;
}
Aggregations