private boolean fallBackCheckIsReadOnly() { Element element = ((XSDConcreteComponent)target).getElement(); if (element instanceof IDOMNode || element instanceof ElementImpl) { return false; } return true; }
public void visit(XSDParticle particle) { XSDElementDeclaration decl = (XSDElementDeclaration) particle.getContent(); if (decl.isElementDeclarationReference()) { decl = decl.getResolvedElementDeclaration(); } if (decl == fElement) { if (particle.isSetMaxOccurs()) { maxOccurs.add(Integer.valueOf(particle.getMaxOccurs())); } else if (particle.getContainer() instanceof XSDModelGroup && particle.getContainer().getContainer() instanceof XSDParticle) { particle = (XSDParticle) particle.getContainer().getContainer(); maxOccurs.add(Integer.valueOf(particle.getMaxOccurs())); } else { maxOccurs.add(1); } } } };
public XSDSchema getXSDSchema() { return component.getSchema(); }
parentNode = parentComponent.getElement(); nextRefChild = nextRefChildComponent != null ? nextRefChildComponent.getElement() : null; previousRefChild = previousRefChildComponent != null ? previousRefChildComponent.getElement() : null; if (nextRefComponent.getContainer().getContainer() == parentComponent) if (previousRefComponent.getContainer().getContainer() == parentComponent)
/*{@link */Element/*}*/ element = xsdConcreteComponent./*{@link XSDConcreteComponent#getElement */getElement/*}*/(); if (element == null) xsdConcreteComponent./*{@link XSDConcreteComponent#updateElement */updateElement/*}*/(); element = xsdConcreteComponent.getElement();
protected void adoptContent(EReference eReference, XSDConcreteComponent xsdConcreteComponent) { if (isReconciling) { if (xsdConcreteComponent.getElement() != null) { xsdConcreteComponent.elementChanged(xsdConcreteComponent.getElement()); } } else { Element childElement = xsdConcreteComponent.getElement(); if (getElement() != null && (childElement == null || childElement.getParentNode() == null)) { if (childElement != null && childElement.getOwnerDocument() != getElement().getOwnerDocument()) { xsdConcreteComponent.setElement(null); childElement = null; } handleElementForAdopt(eReference, xsdConcreteComponent); xsdConcreteComponent.updateElement(); } } XSDSchema xsdSchema = getSchema(); if (xsdSchema != null) { ((XSDConcreteComponentImpl)xsdConcreteComponent).adoptBy(xsdSchema); } }
Element element = xsdConcreteComponent./*{@link XSDConcreteComponent#getElement() /*}*/getElement(); if (element != null) XSDConcreteComponent result = (XSDConcreteComponent)XSDFactory.eINSTANCE.create(xsdConcreteComponent.eClass()); result.setElement(clonedElement); return result; XSDConcreteComponent result = xsdConcreteComponent.cloneConcreteComponent(true, false); return result;
public void execute() { try { beginRecording(component.getElement()); super.execute(); addAnnotationSet(component.getSchema(), extensionsSchemaSpec); formatChild(component.getElement()); } finally { endRecording(); } }
protected void changeAttribute(EAttribute eAttribute) { if (isReconciling) return; // TODO... revist this block of code // if (eAttribute == null || eAttribute == WSDLPackage.Literals.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__SCHEMA) { // We got a new schema so re-parent it. // cs... are we really doing the right thing here? this seems strange if (schema != null) { if ((schema.getElement() == null && getElement() == null) || (schema.getElement() != getElement())) { schema.setDocument(null); schema.setElement(null); adopt(schema); schema.updateElement(); } } } else if (eAttribute == WSDLPackage.Literals.WSDL_ELEMENT__ELEMENT) { setSchema(createSchema(element)); // element is not null } } } //XSDSchemaExtensibilityElementImpl
XSDConcreteComponent container = parent.getContainer(); container.getSchema().getContents().add(elementDecl); container.getSchema().updateElement(true); formatChild(elementDecl.getElement());
public void run() { XSDConcreteComponent model = getModelObject(); XSDConcreteComponent parent = model.getContainer(); XSDTypeDefinition globalTypeDef = null; if (model instanceof XSDComplexTypeDefinition) { .cloneConcreteComponent(true, false); globalTypeDef.setName(fNewName); parent.getSchema().getContents().add(globalTypeDef); ((XSDElementDeclaration) parent) .setTypeDefinition(globalTypeDef); .cloneConcreteComponent(true, false); globalTypeDef.setName(fNewName); parent.getSchema().getContents().add(globalTypeDef); ((XSDElementDeclaration) parent) .setTypeDefinition(globalTypeDef); .cloneConcreteComponent(true, false); globalTypeDef.setName(fNewName); parent.getSchema().getContents().add(globalTypeDef); ((XSDAttributeDeclaration) parent) .setTypeDefinition((XSDSimpleTypeDefinition) globalTypeDef);
protected boolean revealObject(final XSDConcreteComponent component) if (component.getRootContainer().equals(xsdSchema)) Node element = component.getElement(); if (element instanceof IndexedRegion) if (component.getSchema() != null) String schemaLocation = URIHelper.removePlatformResourceProtocol(component.getSchema().getSchemaLocation()); IPath schemaPath = new Path(schemaLocation); final IFile schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
public void elementChanged(Element changedElement) { if (!isUpdatingDOM()) { if (!isReconciling) { // System.out.println("**** changeFor " + eClass().getName()); isReconciling = true; reconcile(changedElement); XSDConcreteComponent theContainer = getContainer(); if (theContainer != null && theContainer.getElement() == changedElement) { theContainer.elementChanged(changedElement); } isReconciling = false; traverseToRootForPatching(); } else { // System.out.println("**** cyclic internal reconcile avoided " + eClass().getName()); } } else { // System.out.println("**** cyclic DOM reconcile avoided " + eClass().getName()); } }
if (remainingConcreteComponent.getElement() == child) Element potentialReplacedElement = potentialReplacement.getElement(); if (potentialReplacedElement != null && potentialReplacedElement.getParentNode() != changedElement && potentialReplacement.setElement((Element)child); newContents.add(potentialReplacement); continue;
concreteComp.updateElement(); for (Iterator containments = concreteComp.eClass().getEAllReferences().iterator(); containments.hasNext(); ) for (Iterator objects = ((Collection)concreteComp.eGet(eReference)).iterator(); objects.hasNext(); ) xsdConcreteComponent.updateElement(); XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent)concreteComp.eGet(eReference); if (xsdConcreteComponent != null) xsdConcreteComponent.updateElement();
protected static <T extends XSDConcreteComponent> List<T> cloneConcreteComponents(List<T> xsdConcreteComponents, boolean deep, boolean shareDOM) { List<T> result = new ArrayList<T>(xsdConcreteComponents.size()); for (XSDConcreteComponent xsdConcreteComponent : xsdConcreteComponents) { try { @SuppressWarnings("unchecked") T clonedConcreteComponent = (T)xsdConcreteComponent.cloneConcreteComponent(deep, shareDOM); result.add(clonedConcreteComponent); } catch (Exception exception) { exception.printStackTrace(); } } return result; }
String sort = xsdConcreteComponent.eClass().getName(); int sortCount = 0; int labelCount = 0;
public XSDSchema createSchema(Element element) { if (element.getLocalName().equals("schema") && XSDConstants.isSchemaForSchemaNamespace(element.getNamespaceURI())) { XSDSchema xsdSchema = XSDFactory.eINSTANCE.createXSDSchema(); xsdSchema.setElement(element); return xsdSchema; } else { return null; } }
concreteComponent.elementChanged((Element)node);
public void clearDiagnostics() { Collection<XSDDiagnostic> theDiagnostics = getDiagnostics(); if (!theDiagnostics.isEmpty()) { theDiagnostics.clear(); } for (XSDConcreteComponent content : getXSDContents()) { content.clearDiagnostics(); } }