use of com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxUIComponentTreeObject in project convertigo by convertigo.
the class DisableNgxUIComponentAction 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;
UIComponent component = null;
TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
for (int i = treeObjects.length - 1; i >= 0; i--) {
treeObject = (DatabaseObjectTreeObject) treeObjects[i];
if (treeObject instanceof NgxUIComponentTreeObject) {
NgxUIComponentTreeObject componentTreeObject = GenericUtils.cast(treeObject);
component = (UIComponent) componentTreeObject.getObject();
component.setEnabled(false);
componentTreeObject.setEnabled(false);
componentTreeObject.hasBeenModified(true);
TreeObjectEvent treeObjectEvent = new TreeObjectEvent(componentTreeObject, "isEnabled", true, false);
explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
}
}
explorerView.refreshSelectedTreeObjects();
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to disable component!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxUIComponentTreeObject in project convertigo by convertigo.
the class EditNgxComponentClassAction 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) {
TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
if (treeObject instanceof NgxComponentTreeObject) {
if (treeObject instanceof NgxApplicationComponentTreeObject) {
NgxApplicationComponentTreeObject mpcto = GenericUtils.cast(treeObject);
mpcto.editAppComponentTsFile();
} else if (treeObject instanceof NgxPageComponentTreeObject) {
NgxPageComponentTreeObject mpcto = GenericUtils.cast(treeObject);
mpcto.editPageTsFile();
} else if (treeObject instanceof NgxUIComponentTreeObject) {
NgxUIComponentTreeObject mpcto = GenericUtils.cast(treeObject);
mpcto.editCompTsFile();
}
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to edit ngx component class!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxUIComponentTreeObject in project convertigo by convertigo.
the class EnableNgxUIComponentAction 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;
UIComponent component = null;
TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
for (int i = treeObjects.length - 1; i >= 0; i--) {
treeObject = (DatabaseObjectTreeObject) treeObjects[i];
if (treeObject instanceof NgxUIComponentTreeObject) {
NgxUIComponentTreeObject componentTreeObject = GenericUtils.cast(treeObject);
component = (UIComponent) componentTreeObject.getObject();
component.setEnabled(true);
componentTreeObject.setEnabled(true);
componentTreeObject.hasBeenModified(true);
TreeObjectEvent treeObjectEvent = new TreeObjectEvent(componentTreeObject, "isEnabled", false, true);
explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
}
}
explorerView.refreshSelectedTreeObjects();
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to enable component!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
Aggregations