use of com.twinsoft.convertigo.eclipse.editors.mobile.ApplicationComponentEditor in project convertigo by convertigo.
the class MobileApplicationComponentTreeObject method activeEditor.
public ApplicationComponentEditor activeEditor(boolean autoLaunch) {
ApplicationComponentEditor editorPart = null;
ApplicationComponent application = (ApplicationComponent) getObject();
synchronized (application) {
String tpl = application.getTplProjectName();
try {
if (StringUtils.isBlank(tpl) || Engine.theApp.databaseObjectsManager.getOriginalProjectByName(tpl, false) == null) {
throw new InvalidParameterException("The value '" + tpl + "' of the property 'Template project' from '" + application.getQName() + "' is incorrect.");
}
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
if (activePage != null) {
IEditorReference[] editorRefs = activePage.getEditorReferences();
for (int i = 0; i < editorRefs.length; i++) {
IEditorReference editorRef = (IEditorReference) editorRefs[i];
try {
IEditorInput editorInput = editorRef.getEditorInput();
if ((editorInput != null) && (editorInput instanceof ApplicationComponentEditorInput)) {
if (((ApplicationComponentEditorInput) editorInput).is(application)) {
editorPart = (ApplicationComponentEditor) editorRef.getEditor(false);
}
}
} catch (PartInitException e) {
}
}
if (editorPart != null) {
activePage.activate(editorPart);
} else {
IEditorPart editor = activePage.openEditor(new ApplicationComponentEditorInput(application, autoLaunch), "com.twinsoft.convertigo.eclipse.editors.mobile.ApplicationComponentEditor");
if (editor instanceof ApplicationComponentEditor) {
editorPart = (ApplicationComponentEditor) editor;
} else {
ConvertigoPlugin.logWarning("The Application Component Editor won't open, please see the error log.");
}
}
}
} catch (Exception e) {
ConvertigoPlugin.logException(e, "Error while loading the page editor '" + application.getName() + "'");
}
}
return editorPart;
}
use of com.twinsoft.convertigo.eclipse.editors.mobile.ApplicationComponentEditor in project convertigo by convertigo.
the class MobilePageComponentTreeObject method launchEditor.
@Override
public void launchEditor(String editorType) {
ApplicationComponentEditor editor = ((MobileApplicationComponentTreeObject) getParentDatabaseObjectTreeObject()).activeEditor();
editor.selectPage(getObject().getSegment());
}
use of com.twinsoft.convertigo.eclipse.editors.mobile.ApplicationComponentEditor in project convertigo by convertigo.
the class MobileComponentTreeObject method launchEditor.
@Override
public void launchEditor(String editorType) {
DatabaseObjectTreeObject parent = getParentDatabaseObjectTreeObject();
while (!(parent == null || parent instanceof MobileApplicationComponentTreeObject)) {
parent = parent.getParentDatabaseObjectTreeObject();
}
if (parent != null) {
ApplicationComponentEditor editor = ((MobileApplicationComponentTreeObject) parent).activeEditor();
editor.highlightComponent(getObject(), true);
}
}
Aggregations