use of com.amalto.workbench.editors.xsdeditor.XSDEditor in project tmdm-studio-se by Talend.
the class ComplexTypeWrapper method changeTypeName.
public boolean changeTypeName() {
if (curXSDComplexType.getName().equals(newTypeName))
return false;
curXSDComplexType.setName(newTypeName);
curXSDComplexType.updateElement();
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IEditorPart activeEditor = activePage.getActiveEditor();
if (activeEditor instanceof XSDEditor) {
XSDEditor editor = (XSDEditor) activeEditor;
DataModelMainPage page = editor.getdMainPage();
IStructuredContentProvider provider = (IStructuredContentProvider) page.getSchemaContentProvider();
Util.updateReferenceToXSDTypeDefinition(page.getSite(), curXSDComplexType, provider);
}
return true;
}
use of com.amalto.workbench.editors.xsdeditor.XSDEditor in project tmdm-studio-se by Talend.
the class SimpleTypeWrapper method changeTypeName.
public boolean changeTypeName() {
if (getNewTypeName().trim().equals(getOldTypeName()))
return false;
xsdSimpleType.setName(getNewTypeName().trim());
xsdSimpleType.updateElement();
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IEditorPart activeEditor = activePage.getActiveEditor();
if (activeEditor instanceof XSDEditor) {
XSDEditor editor = (XSDEditor) activeEditor;
DataModelMainPage page = editor.getdMainPage();
IStructuredContentProvider provider = (IStructuredContentProvider) page.getSchemaContentProvider();
Util.updateReferenceToXSDTypeDefinition(page.getSite(), xsdSimpleType, provider);
}
return true;
}
use of com.amalto.workbench.editors.xsdeditor.XSDEditor in project tmdm-studio-se by Talend.
the class DataModelMainPage method gotoMarker.
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.ide.IGotoMarker#gotoMarker(org.eclipse.core.resources.IMarker)
*/
public void gotoMarker(IMarker marker) {
MultiPageEditorSite site = (MultiPageEditorSite) getEditorSite();
MultiPageEditorPart part = site.getMultiPageEditor();
int activePage = part.getActivePage();
try {
String type = marker.getType();
if (type.equals(MARKER_XSD_ERR) || activePage == 1) {
((XSDEditor) part).gotoMarker(marker);
return;
} else if (type.equals(MARKER_DATA_MODEL)) {
boolean openInSource = marker.getAttribute(OPEN_IN_SOURCE, false);
if (openInSource) {
marker.setAttribute(OPEN_IN_SOURCE, false);
((XSDEditor) part).gotoMarker(marker);
return;
}
Object domElement = marker.getAttribute(DOM_ELEMENT);
Integer msgGroup = (Integer) marker.getAttribute(MSG_GROUP);
if (domElement != null && msgGroup != null) {
switch(msgGroup) {
case MSG_GROUP_TYPE:
activeMarkerItem(typesViewer, (Element) domElement);
break;
case MSG_GROUP_ELEMENT:
case MSG_GROUP_ENTITY:
activeMarkerItem(viewer, (Element) domElement);
break;
default:
break;
}
}
}
} catch (CoreException e) {
log.error(e.getMessage(), e);
}
}
use of com.amalto.workbench.editors.xsdeditor.XSDEditor in project tmdm-studio-se by Talend.
the class ElementWrapperCommitHandler method getPage.
private DataModelMainPage getPage() {
IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (activeEditor instanceof XSDEditor) {
XSDEditor xsdEditor = (XSDEditor) activeEditor;
DataModelMainPage page = xsdEditor.getdMainPage();
return page;
}
return null;
}
use of com.amalto.workbench.editors.xsdeditor.XSDEditor in project tmdm-studio-se by Talend.
the class Util method getXSDSchemaOfDirtyEditor.
public static XSDSchema getXSDSchemaOfDirtyEditor(String dataModelName) {
XSDSchema xsd = null;
IEditorPart[] editors = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getDirtyEditors();
if (null != editors) {
for (IEditorPart editorpart : editors) {
if (editorpart instanceof XSDEditor) {
XSDEditor xeditor = (XSDEditor) editorpart;
DataModelMainPage mainPage = xeditor.getdMainPage();
if (mainPage.getDataModel().getName().equals(dataModelName)) {
xsd = mainPage.getXSDSchema();
break;
}
}
}
}
return xsd;
}
Aggregations