Search in sources :

Example 11 with DataModelMainPage

use of com.amalto.workbench.editors.DataModelMainPage 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;
}
Also used : XSDEditor(com.amalto.workbench.editors.xsdeditor.XSDEditor) DataModelMainPage(com.amalto.workbench.editors.DataModelMainPage) IEditorPart(org.eclipse.ui.IEditorPart) XSDSchema(org.eclipse.xsd.XSDSchema)

Aggregations

DataModelMainPage (com.amalto.workbench.editors.DataModelMainPage)11 IEditorPart (org.eclipse.ui.IEditorPart)5 XSDEditor (com.amalto.workbench.editors.xsdeditor.XSDEditor)4 IStructuredContentProvider (org.eclipse.jface.viewers.IStructuredContentProvider)3 WSDataModel (com.amalto.workbench.webservices.WSDataModel)2 ByteArrayInputStream (java.io.ByteArrayInputStream)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)2 PartInitException (org.eclipse.ui.PartInitException)2 XSDAnnotation (org.eclipse.xsd.XSDAnnotation)2 XSDElementDeclaration (org.eclipse.xsd.XSDElementDeclaration)2 XSDIdentityConstraintDefinition (org.eclipse.xsd.XSDIdentityConstraintDefinition)2 XSDSchema (org.eclipse.xsd.XSDSchema)2 XSDXPathDefinition (org.eclipse.xsd.XSDXPathDefinition)2 Element (org.w3c.dom.Element)2 SAXParseException (org.xml.sax.SAXParseException)2 CommitException (com.amalto.workbench.detailtabs.exception.CommitException)1 CommitValidationException (com.amalto.workbench.detailtabs.exception.CommitValidationException)1 TreeObject (com.amalto.workbench.models.TreeObject)1 XSDAnnotationsStructure (com.amalto.workbench.utils.XSDAnnotationsStructure)1