use of com.twinsoft.convertigo.beans.core.Listener in project convertigo by convertigo.
the class EnableListenerAction method run.
public void run() {
Display display = Display.getDefault();
Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
Shell shell = getParentShell();
shell.setCursor(waitCursor);
try {
ProjectExplorerView explorerView = getProjectExplorerView();
if (explorerView != null) {
DatabaseObjectTreeObject treeObject = null;
Listener listener = null;
TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
for (int i = treeObjects.length - 1; i >= 0; i--) {
treeObject = (DatabaseObjectTreeObject) treeObjects[i];
if (treeObject instanceof ListenerTreeObject) {
ListenerTreeObject listenerTreeObject = (ListenerTreeObject) treeObject;
listener = (Listener) listenerTreeObject.getObject();
listener.setEnabled(true);
listenerTreeObject.setEnabled(true);
listenerTreeObject.hasBeenModified(true);
// Updating the tree
explorerView.refreshTreeObject(listenerTreeObject);
}
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to enable listener!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
use of com.twinsoft.convertigo.beans.core.Listener in project convertigo by convertigo.
the class DisableListenerAction method run.
public void run() {
Display display = Display.getDefault();
Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
Shell shell = getParentShell();
shell.setCursor(waitCursor);
try {
ProjectExplorerView explorerView = getProjectExplorerView();
if (explorerView != null) {
DatabaseObjectTreeObject treeObject = null;
Listener listener = null;
TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
for (int i = treeObjects.length - 1; i >= 0; i--) {
treeObject = (DatabaseObjectTreeObject) treeObjects[i];
if (treeObject instanceof ListenerTreeObject) {
ListenerTreeObject listenerTreeObject = (ListenerTreeObject) treeObject;
listener = (Listener) listenerTreeObject.getObject();
listener.setEnabled(false);
listenerTreeObject.setEnabled(false);
listenerTreeObject.hasBeenModified(true);
// Updating the tree
explorerView.refreshTreeObject(listenerTreeObject);
}
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to disable listener!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
use of com.twinsoft.convertigo.beans.core.Listener in project convertigo by convertigo.
the class DisableListenerAction method run2.
@Override
protected void run2() throws Exception {
try {
WrapObject[] treeObjects = studio.getSelectedObjects().toArray(new WrapObject[0]);
for (int i = treeObjects.length - 1; i >= 0; --i) {
WrapDatabaseObject treeObject = (WrapDatabaseObject) treeObjects[i];
if (treeObject.instanceOf(Listener.class)) {
// StepView stepTreeObject = (StepView) treeObject;
Listener listener = (Listener) treeObject.getObject();
listener.setEnabled(false);
// stepTreeObject.setEnabled(true);
// stepTreeObject.hasBeenModified(true);
// TreeObjectEvent treeObjectEvent = new TreeObjectEvent(stepTreeObject, "isEnable", false, true);
// explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
}
}
// explorerView.refreshSelectedTreeObjects();
} catch (Throwable e) {
throw e;
// ConvertigoPlugin.logException(e, "Unable to enable step!");
}
// finally {
// shell.setCursor(null);
// waitCursor.dispose();
}
use of com.twinsoft.convertigo.beans.core.Listener in project convertigo by convertigo.
the class EnableListenerAction method run2.
@Override
protected void run2() throws Exception {
try {
WrapObject[] treeObjects = studio.getSelectedObjects().toArray(new WrapObject[0]);
for (int i = treeObjects.length - 1; i >= 0; --i) {
WrapDatabaseObject treeObject = (WrapDatabaseObject) treeObjects[i];
if (treeObject.instanceOf(Listener.class)) {
// StepView stepTreeObject = (StepView) treeObject;
Listener listener = (Listener) treeObject.getObject();
listener.setEnabled(true);
// stepTreeObject.setEnabled(true);
// stepTreeObject.hasBeenModified(true);
// TreeObjectEvent treeObjectEvent = new TreeObjectEvent(stepTreeObject, "isEnable", false, true);
// explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
}
}
// explorerView.refreshSelectedTreeObjects();
} catch (Throwable e) {
throw e;
// ConvertigoPlugin.logException(e, "Unable to enable step!");
}
// finally {
// shell.setCursor(null);
// waitCursor.dispose();
}
Aggregations