use of com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView in project convertigo by convertigo.
the class SetMobileRootPageAction 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) {
MobilePageComponentTreeObject pageTreeObject = (MobilePageComponentTreeObject) explorerView.getFirstSelectedTreeObject();
PageComponent page = (PageComponent) pageTreeObject.getObject();
ApplicationComponent application = (ApplicationComponent) page.getParent();
MobilePageComponentTreeObject rootPageTreeObject = null;
PageComponent rootPage = application.getRootPage();
if (rootPage != null) {
rootPageTreeObject = (MobilePageComponentTreeObject) explorerView.findTreeObjectByUserObject(rootPage);
}
application.setRootPage(page);
application.markRootAsDirty();
if (rootPageTreeObject != null) {
rootPageTreeObject.isDefault = false;
rootPageTreeObject.hasBeenModified(true);
}
pageTreeObject.isDefault = true;
pageTreeObject.hasBeenModified(true);
// Updating the tree
explorerView.refreshTreeObject(pageTreeObject.getParentDatabaseObjectTreeObject());
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to set page to root one!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView in project convertigo by convertigo.
the class SheetEditAction 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) {
Object treeObject = explorerView.getFirstSelectedTreeObject();
((IEditableTreeObject) treeObject).launchEditor(null);
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to edit the sheet!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView in project convertigo by convertigo.
the class ShowStepInPickerAction 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 != null) {
if (treeObject instanceof DatabaseObjectTreeObject) {
DatabaseObject selectedDbo = ((DatabaseObjectTreeObject) treeObject).getObject();
if (selectedDbo != null) {
StepSourceEvent event = null;
if (showSource) {
if (selectedDbo instanceof Step) {
Step step = (Step) selectedDbo;
Set<StepSource> sources = step.getSources();
if (!sources.isEmpty()) {
event = new StepSourceEvent(sources.iterator().next());
} else {
throw new Exception("No Source defined");
}
}
} else {
event = new StepSourceEvent(selectedDbo);
}
if (event != null) {
SourcePickerView spv = ConvertigoPlugin.getDefault().getSourcePickerView();
if (spv == null) {
spv = (SourcePickerView) getActivePage().showView("com.twinsoft.convertigo.eclipse.views.sourcepicker.SourcePickerView");
}
if (spv != null) {
spv.sourceSelected(event);
}
}
}
}
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to show object in Picker!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView in project convertigo by convertigo.
the class StepExportVariablesToSequenceAction 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();
Object databaseObject = treeObject.getObject();
if ((databaseObject != null) && (databaseObject instanceof RequestableStep)) {
RequestableStep requestableStep = (RequestableStep) databaseObject;
requestableStep.exportVariableDefinition();
Sequence sequence = requestableStep.getSequence();
if (sequence.hasChanged) {
SequenceTreeObject sequenceTreeObject = (SequenceTreeObject) explorerView.findTreeObjectByUserObject(sequence);
explorerView.reloadTreeObject(sequenceTreeObject);
explorerView.setSelectedTreeObject(sequenceTreeObject);
StructuredSelection structuredSelection = new StructuredSelection(sequenceTreeObject);
ConvertigoPlugin.getDefault().getPropertiesView().selectionChanged((IWorkbenchPart) explorerView, structuredSelection);
}
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to export step variables to main sequence!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView in project convertigo by convertigo.
the class StepImportSequenceVariablesAction 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();
Object databaseObject = treeObject.getObject();
if ((databaseObject != null) && (databaseObject instanceof SequenceStep)) {
SequenceStep sequenceStep = (SequenceStep) databaseObject;
sequenceStep.importVariableDefinition();
if (sequenceStep.hasChanged) {
explorerView.reloadTreeObject(treeObject);
StructuredSelection structuredSelection = new StructuredSelection(treeObject);
ConvertigoPlugin.getDefault().getPropertiesView().selectionChanged((IWorkbenchPart) explorerView, structuredSelection);
}
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to add sequence variables to step!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
Aggregations