use of com.twinsoft.convertigo.eclipse.views.projectexplorer.TreeParent in project convertigo by convertigo.
the class CreateDesignDocumentViewReduceAction 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) {
DesignDocumentViewTreeObject ddvto = (DesignDocumentViewTreeObject) explorerView.getFirstSelectedTreeObject();
DesignDocumentFunctionTreeObject ddfto = ddvto.addReduce();
DesignDocumentTreeObject ddto = (DesignDocumentTreeObject) ddvto.getParent().getParent();
if (ddto.hasChanged()) {
TreeParent treeParent = ddto.getParent();
if (treeParent instanceof FolderTreeObject)
treeParent = treeParent.getParent();
explorerView.objectChanged(new CompositeEvent(treeParent.getObject(), ddfto.getPath()));
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to create a reduce function!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.TreeParent in project convertigo by convertigo.
the class CreateMobileUIComponentAction method selectionChanged.
public void selectionChanged(IAction action, ISelection selection) {
try {
boolean enable = true;
super.selectionChanged(action, selection);
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
if (treeObject instanceof ObjectsFolderTreeObject) {
ObjectsFolderTreeObject oft = (ObjectsFolderTreeObject) treeObject;
if (oft.folderType == ObjectsFolderTreeObject.FOLDER_TYPE_PAGES) {
enable = false;
} else {
TreeParent treeParent = oft.getParent();
enable = treeParent != null && treeParent instanceof MobileComponentTreeObject;
}
} else if (treeObject instanceof DatabaseObjectTreeObject) {
DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
enable = actionModel.isEnabled;
}
action.setEnabled(enable);
} catch (Exception e) {
}
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.TreeParent in project convertigo by convertigo.
the class CreatePropertyTableColumnAction 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) {
PropertyTableRowTreeObject propertyTableRowTreeObject = (PropertyTableRowTreeObject) explorerView.getFirstSelectedTreeObject();
TreeParent owner = propertyTableRowTreeObject.getTreeObjectOwner();
IPropertyTreeObject pto = propertyTableRowTreeObject.addNewColumn();
if (owner instanceof DatabaseObjectTreeObject) {
DatabaseObjectTreeObject databaseObjectTreeObject = (DatabaseObjectTreeObject) owner;
if (databaseObjectTreeObject.hasChanged()) {
TreeParent treeParent = databaseObjectTreeObject.getParent();
if (treeParent instanceof FolderTreeObject)
treeParent = treeParent.getParent();
// explorerView.reloadTreeObject(treeParent);
explorerView.objectChanged(new CompositeEvent(treeParent.getObject(), pto.getPath()));
}
} else
explorerView.refreshTreeObject(owner, true);
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to create a new column!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.TreeParent in project convertigo by convertigo.
the class DatabaseObjectTreeObject method getParentDatabaseObjectTreeObject.
public DatabaseObjectTreeObject getParentDatabaseObjectTreeObject() {
DatabaseObjectTreeObject databaseObjectTreeObject = null;
TreeParent treeParent = getParent();
while ((treeParent != null) && (!(treeParent instanceof DatabaseObjectTreeObject))) treeParent = treeParent.getParent();
if (treeParent != null)
databaseObjectTreeObject = (DatabaseObjectTreeObject) treeParent;
return databaseObjectTreeObject;
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.TreeParent in project convertigo by convertigo.
the class TraceDeleteAction 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) {
TraceTreeObject traceObject = (TraceTreeObject) explorerView.getFirstSelectedTreeObject();
MessageBox messageBox = new MessageBox(shell, SWT.YES | SWT.NO | SWT.CANCEL | SWT.ICON_QUESTION | SWT.APPLICATION_MODAL);
String message = java.text.MessageFormat.format("Do you really want to delete the trace \"{0}\"?", new Object[] { traceObject.getName() });
messageBox.setMessage(message);
if (messageBox.open() == SWT.YES) {
File file = (File) traceObject.getObject();
if (file.exists()) {
if (file.delete()) {
TreeParent treeParent = traceObject.getParent();
treeParent.removeChild(traceObject);
explorerView.refreshTreeObject(treeParent);
} else {
throw new Exception("Unable to delete file \"" + file.getAbsolutePath() + "\"");
}
}
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to delete the trace file!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
Aggregations