use of com.twinsoft.convertigo.eclipse.editors.sequence.SequenceEditor in project convertigo by convertigo.
the class ConvertigoPartListener method partClosed.
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener#partClosed(org.eclipse.ui.IWorkbenchPart)
*/
public void partClosed(IWorkbenchPart part) {
if (part instanceof ConnectorEditor) {
// close editor properly
((ConnectorEditor) part).close();
}
if (part instanceof SequenceEditor) {
// close editor properly
((SequenceEditor) part).close();
}
if (part instanceof ProjectExplorerView) {
// close view properly
((ProjectExplorerView) part).close();
}
if (part instanceof SourcePickerView) {
// close view properly
((SourcePickerView) part).close();
}
if (part instanceof ConsoleView) {
ConvertigoPlugin convertigoPlugin = ConvertigoPlugin.getDefault();
boolean shuttingDown = convertigoPlugin.isShuttingDown();
if (shuttingDown) {
IConsole[] tabConsoles = ConsolePlugin.getDefault().getConsoleManager().getConsoles();
String openedConsoles = "";
for (IConsole console : tabConsoles) {
if (console instanceof MessageConsole) {
if ((console.equals(convertigoPlugin.engineConsole)) && (openedConsoles.indexOf("engine") == -1))
openedConsoles += (openedConsoles.equals("") ? "" : ",") + "engine";
else if ((console.equals(convertigoPlugin.stdoutConsole)) && (openedConsoles.indexOf("stdout") == -1))
openedConsoles += (openedConsoles.equals("") ? "" : ",") + "stdout";
}
}
ConvertigoPlugin.setProperty(ConvertigoPlugin.PREFERENCE_OPENED_CONSOLES, openedConsoles);
}
}
if (part instanceof EditorPart) {
IEditorInput input = ((EditorPart) part).getEditorInput();
if (input instanceof com.twinsoft.convertigo.eclipse.editors.mobile.ApplicationComponentEditorInput) {
try {
com.twinsoft.convertigo.eclipse.editors.mobile.ApplicationComponentEditorInput acei = GenericUtils.cast(input);
MobileBuilder mb = acei.getApplication().getProject().getMobileBuilder();
mb.removeMobileEventListener((com.twinsoft.convertigo.eclipse.editors.mobile.ApplicationComponentEditor) part);
mb.setAutoBuild(true);
} catch (Exception e) {
e.printStackTrace();
}
}
if (input instanceof com.twinsoft.convertigo.eclipse.editors.ngx.ApplicationComponentEditorInput) {
try {
com.twinsoft.convertigo.eclipse.editors.ngx.ApplicationComponentEditorInput acei = GenericUtils.cast(input);
MobileBuilder mb = acei.getApplication().getProject().getMobileBuilder();
mb.removeMobileEventListener((com.twinsoft.convertigo.eclipse.editors.ngx.ApplicationComponentEditor) part);
mb.setAutoBuild(true);
} catch (Exception e) {
e.printStackTrace();
}
}
if (input instanceof JScriptEditorInput) {
try {
((JScriptEditorInput) input).getFile().getParent().delete(true, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (input instanceof com.twinsoft.convertigo.eclipse.editors.mobile.ComponentFileEditorInput) {
try {
((com.twinsoft.convertigo.eclipse.editors.mobile.ComponentFileEditorInput) input).getFile().delete(true, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (input instanceof com.twinsoft.convertigo.eclipse.editors.ngx.ComponentFileEditorInput) {
try {
((com.twinsoft.convertigo.eclipse.editors.ngx.ComponentFileEditorInput) input).getFile().delete(true, null);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
Aggregations