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 void visit(XSDParticle particle) { XSDElementDeclaration decl = (XSDElementDeclaration) particle.getContent(); if (decl.isElementDeclarationReference()) { decl = decl.getResolvedElementDeclaration(); } if (decl == fElement) { if (particle.isSetMinOccurs()) { minOccurs.add(Integer.valueOf(particle.getMinOccurs())); } else if (particle.getContainer() instanceof XSDModelGroup && particle.getContainer().getContainer() instanceof XSDParticle) { particle = (XSDParticle) particle.getContainer().getContainer(); minOccurs.add(Integer.valueOf(particle.getMinOccurs())); } else { minOccurs.add(1); } } } };
public XSDConcreteComponent getRootContainer() { for (XSDConcreteComponent root = this;;) { XSDConcreteComponent parent = root.getContainer(); if (parent == null) { return root; } root = parent; } }
public XSDSchema getSchema() { for (XSDConcreteComponent container = this; container != null; container = container.getContainer()) { if (container instanceof XSDSchema) { return (XSDSchema)container; } } return null; }
public XSDConcreteComponent getRootContainer() { for (XSDConcreteComponent root = this;;) { XSDConcreteComponent parent = root.getContainer(); if (parent == null) { return root; } root = parent; } }
public boolean contains(XSDConcreteComponent xsdConcreteComponent) { while (xsdConcreteComponent != null) { if (xsdConcreteComponent == this) { return true; } xsdConcreteComponent = xsdConcreteComponent.getContainer(); } return false; }
public XSDSchema getSchema() { for (XSDConcreteComponent container = this; container != null; container = container.getContainer()) { if (container instanceof XSDSchema) { return (XSDSchema)container; } } return null; }
public boolean contains(XSDConcreteComponent xsdConcreteComponent) { while (xsdConcreteComponent != null) { if (xsdConcreteComponent == this) { return true; } xsdConcreteComponent = xsdConcreteComponent.getContainer(); } return false; }
private boolean isComponentDefined(XSDConcreteComponent component) { // note the getContainer() test to eliminate 'synthetic' types // that are created by the XMLSchema model when resolution fails return component != null && component.getContainer() != null; }
public MakeLocalElementGlobalCommand (XSDConcreteComponent element) { super(element.getContainer()); setModelObject(element); }
public MakeAnonymousTypeGlobalCommand(XSDConcreteComponent element, String newName) { super(element.getContainer()); setModelObject(element); fNewName = newName; }
public XSDScope getScope() { for (XSDConcreteComponent container = getContainer(); container != null; container = container.getContainer()) { if (container instanceof XSDScope) { return (XSDScope)container; } else if (container instanceof XSDModelGroupDefinition || container instanceof XSDAttributeGroupDefinition) { return null; } } return null; }
public boolean isGlobal() { for (XSDConcreteComponent container = getContainer(); container != null; container = container.getContainer()) { if (container instanceof XSDScope) { return container instanceof XSDSchema; } else if (container instanceof XSDModelGroupDefinition || container instanceof XSDAttributeGroupDefinition) { return false; } } return true; }
public XSDScope getScope() { for (XSDConcreteComponent container = getContainer(); container != null; container = container.getContainer()) { if (container instanceof XSDScope) { return (XSDScope)container; } else if (container instanceof XSDModelGroupDefinition || container instanceof XSDAttributeGroupDefinition) { return null; } } return null; }
public boolean isGlobal() { for (XSDConcreteComponent container = getContainer(); container != null; container = container.getContainer()) { if (container instanceof XSDScope) { return container instanceof XSDSchema; } else if (container instanceof XSDModelGroupDefinition || container instanceof XSDAttributeGroupDefinition) { return false; } } return true; }
if (nextRefComponent.getContainer().getContainer() == parentComponent) if (previousRefComponent.getContainer().getContainer() == parentComponent)
public static int getMinOccurs(XSDConcreteComponent component) { int minOccur = -2; if (component != null) { Object o = component.getContainer(); if (o instanceof XSDParticle) { if (((XSDParticle) o).isSetMinOccurs()) { try { minOccur = ((XSDParticle) o).getMinOccurs(); } catch (Exception e) { } } } } return minOccur; }
public static int getMaxOccurs(XSDConcreteComponent component) { int maxOccur = -2; if (component != null) { Object o = component.getContainer(); if (o instanceof XSDParticle) { if (((XSDParticle) o).isSetMaxOccurs()) { try { maxOccur = ((XSDParticle) o).getMaxOccurs(); } catch (Exception e) { } } } } return maxOccur; }
public void mouseDoubleClick(MouseEvent e) { ISelection iSelection = getTreeViewer().getSelection(); if (iSelection instanceof StructuredSelection) { StructuredSelection selection = (StructuredSelection) iSelection; Object obj = selection.getFirstElement(); if (obj instanceof XSDConcreteComponent) { XSDConcreteComponent comp = (XSDConcreteComponent) obj; if (comp.getContainer() instanceof XSDSchema) { // getXSDEditor().getGraphViewer().setInput(obj); } } } } });
/** * Wraps an XSD diagnostic into a WSDL diagnostic. Used to report problems in * inline schemas. * * @param xsdDiagnostic * the XSD diagnostic object to wrap. Must not be null. */ public WSDLDiagnosticImpl(XSDDiagnostic xsdDiagnostic) { this(); setMessage(xsdDiagnostic.getMessage()); setSeverity(getSeverity(xsdDiagnostic.getSeverity())); setLine(xsdDiagnostic.getLine()); setColumn(xsdDiagnostic.getColumn()); setNode(xsdDiagnostic.getNode()); setContainer(xsdDiagnostic.getContainer()); setLocation(xsdDiagnostic.getLocation()); setKey(xsdDiagnostic.getKey()); getSubstitutions().addAll(xsdDiagnostic.getSubstitutions()); }