org.eclipse.xsd.XSDModelGroup类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中org.eclipse.xsd.XSDModelGroup类的一些代码示例,展示了XSDModelGroup类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSDModelGroup类的具体详情如下:
包路径:org.eclipse.xsd.XSDModelGroup
类名称:XSDModelGroup

XSDModelGroup介绍

[英]A representation of the model object 'Model Group'.

The following features are supported:

  • org.eclipse.xsd.XSDModelGroup#getCompositor
  • org.eclipse.xsd.XSDModelGroup#getAnnotation
  • org.eclipse.xsd.XSDModelGroup#getContents
  • org.eclipse.xsd.XSDModelGroup#getParticles
    [中]模型对象Model Group的表示形式。
    支持以下功能:
    *组织。日食xsd。XSDModelGroup#getCompositor
    *组织。日食xsd。XSDModelGroup#getAnnotation
    *组织。日食xsd。XSDModelGroup#getContents
    *组织。日食xsd。XSDModelGroup#getParticles

代码示例

代码示例来源:origin: geotools/geotools

group.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
      dom.createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "element"));
  group.getContents().add(particle);

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

switch (xsdModelGroup.getCompositor().getValue())
  return xsdModelGroup.getParticles().isEmpty();
  return xsdModelGroup.getParticles().isEmpty() && xsdParticle.getMinOccurs() == 0;

代码示例来源:origin: geotools/geotools

XSDModelGroup group = (XSDModelGroup) particle.eContainer();
if (group.eContainer() instanceof XSDParticle) {
  XSDParticle cParticle =
      (XSDParticle) group.eContainer();

代码示例来源:origin: geotools/geotools

List parts = grp.getParticles();
  parts = grp.getContents();

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public void undo()
{
 super.undo();
 
 if (parent instanceof XSDModelGroup)
 {
  XSDModelGroup model = (XSDModelGroup) parent;
  model.getContents().remove(newModelGroup.getContainer());
 }
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public void visitModelGroup(XSDModelGroup modelGroup)
{
 if (modelGroup.getContents() != null)
 {
  for (Iterator iterator = modelGroup.getContents().iterator(); iterator.hasNext();)
  {
   XSDParticle particle = (XSDParticle) iterator.next();
   visitParticle(particle);
  }
 }
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public void undo()
 {
  xsdModelGroup.setCompositor(oldXSDCompositor);
 }
}

代码示例来源:origin: org.eclipse/org.eclipse.xsd

extensionParticle.setMaxOccurs(1);
 XSDModelGroup xsdModelGroup = getXSDFactory().createXSDModelGroup();
 xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
 extensionParticle.setContent(xsdModelGroup);
List<XSDParticle> remainingParticles = new ArrayList<XSDParticle>(extensionGroup.getParticles());
remainingParticles.removeAll(newParticles);
if (!remainingParticles.isEmpty())
 extensionGroup.getParticles().removeAll(remainingParticles);
setListContentAndOrder(extensionGroup.getParticles(), newParticles);
extensionParticle.setMaxOccurs(1);
XSDModelGroup xsdModelGroup = getXSDFactory().createXSDModelGroup();
xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
extensionParticle.setContent(xsdModelGroup);

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

XSDParticle particle = factory.createXSDParticle();
 xsdModelGroup = factory.createXSDModelGroup();
 xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
 particle.setContent(xsdModelGroup);
 xsdModelGroupDefinition.setModelGroup(xsdModelGroup);
 xsdModelGroup.getContents().add(createXSDElementDeclarationForModelGroupDefinitions());
 xsdModelGroup.getContents().add(createXSDElementReference());
xsdSchema = xsdModelGroup.getSchema();
beginRecording(xsdSchema.getElement());
if (!isReference)
 xsdModelGroup.getContents().add(createXSDElementDeclaration());
 xsdModelGroup.getContents().add(createXSDElementReference());
formatChild(xsdModelGroup.getElement());
 XSDParticle particle = factory.createXSDParticle();
 xsdModelGroup = factory.createXSDModelGroup();
 xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
 particle.setContent(xsdModelGroup);
 xsdComplexTypeDefinition.setContent(particle);
 xsdModelGroup.getContents().add(createXSDElementDeclarationForComplexType());
 xsdModelGroup.getContents().add(createXSDElementReference());

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

List<XSDParticle> particles = xsdModelGroup.getParticles();
if (particles.size() == 0 ||
   xsdModelGroup.getContainer() instanceof XSDModelGroupDefinition &&
   ((XSDModelGroupDefinition)xsdModelGroup.getContainer()).isCircular())
 if (xsdModelGroup.getCompositor() == XSDCompositor.CHOICE_LITERAL)
 for (XSDParticle childXSDParticle : ((XSDModelGroup)xsdTerm).getParticles())

代码示例来源:origin: org.eclipse.emf/org.eclipse.xsd.edit

if (modelGroup != null && visited.add(modelGroup) && modelGroup.getParticles() != null)
 for (XSDParticle particle : modelGroup.getParticles())

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

public static XSDModelGroup createModelGroup(Node node)
{
 switch (XSDConstants.nodeType(node))
 {
  case XSDConstants.ALL_ELEMENT:
  {
   XSDModelGroup xsdModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
   xsdModelGroup.setCompositor(XSDCompositor.ALL_LITERAL);
   xsdModelGroup.setElement((Element)node);
   return xsdModelGroup;
  }
  case XSDConstants.CHOICE_ELEMENT:
  {
   XSDModelGroup xsdModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
   xsdModelGroup.setCompositor(XSDCompositor.CHOICE_LITERAL);
   xsdModelGroup.setElement((Element)node);
   return xsdModelGroup;
  }
  case XSDConstants.SEQUENCE_ELEMENT:
  {
   XSDModelGroup xsdModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
   xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
   xsdModelGroup.setElement((Element)node);
   return xsdModelGroup;
  }
 }
 return null;
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

String name = xsdModelGroup.getCompositor().getName();
if (name != null)
Element element = xsdModelGroup.getElement();
  if (hasMinOccurs)
   int min = ((XSDParticle) xsdModelGroup.getContainer()).getMinOccurs();
   if (min == XSDParticle.UNBOUNDED)
   int min = ((XSDParticle) xsdModelGroup.getContainer()).getMinOccurs();
   result.append(String.valueOf(min));
   int max = ((XSDParticle) xsdModelGroup.getContainer()).getMaxOccurs();
   result.append(".."); //$NON-NLS-1$
   if (max == XSDParticle.UNBOUNDED)
   int max = ((XSDParticle) xsdModelGroup.getContainer()).getMaxOccurs();
   result.append(String.valueOf(max));

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public UpdateContentModelCommand(String label, XSDModelGroup xsdModelGroup, XSDCompositor xsdCompositor)
{
 super(label);
 this.xsdModelGroup = xsdModelGroup;
 this.newXSDCompositor = xsdCompositor;
 this.oldXSDCompositor = xsdModelGroup.getCompositor();
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public void execute()
{
 try
 {
  super.execute();
  beginRecording(xsdModelGroup.getElement());
  xsdModelGroup.setCompositor(newXSDCompositor);
 }
 finally
 {
  endRecording();
 }
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public void refresh()
{
 super.refresh();
 if (isReadOnly)
 {
  composite.setEnabled(false);
 }
 else
 {
  composite.setEnabled(true);
 }
 setListenerEnabled(false);
 if (input != null)
 {
  if (input instanceof XSDModelGroup)
  {
   XSDModelGroup particle = (XSDModelGroup)input;
   String modelType = particle.getCompositor().getName();
   modelGroupCombo.setText(modelType);
   
   minCombo.setEnabled(!(particle.eContainer() instanceof XSDModelGroupDefinition));
   maxCombo.setEnabled(!(particle.eContainer() instanceof XSDModelGroupDefinition));
  }
 }
 
 refreshMinMax();
 setListenerEnabled(true);
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public void execute()
 {
  try
  {
   beginRecording(parent.getElement());
   XSDWildcard wildCard = XSDFactory.eINSTANCE.createXSDWildcard();
   XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
   particle.setContent(wildCard);
   parent.getContents().add(particle);
   addedXSDConcreteComponent = wildCard;
   formatChild(parent.getElement());
  }
  finally
  {
   endRecording();
  }
 }
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

XSDModelGroup modelGroup = (XSDModelGroup)container;
int index = modelGroup.getContents().indexOf(parent);
XSDParticle particle = 
   XSDFactory.eINSTANCE.createXSDParticle();
particle.setContent(elementRef);
modelGroup.getContents().add(index, particle); 
modelGroup.getContents().remove(parent);
modelGroup.updateElement(true);
formatChild(modelGroup.getElement());

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public Object getParent(Object object)
{
 XSDModelGroup element = (XSDModelGroup) object;
 return element.getContainer();
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public static XSDModelGroup getModelGroup(XSDComplexTypeDefinition cType)
{
 XSDParticle particle = cType.getComplexType();
 if (particle == null || particle.eContainer() != cType)
  return null;
 Object particleContent = particle.getContent();
 XSDModelGroup group = null;
 if (particleContent instanceof XSDModelGroupDefinition)
  group = ((XSDModelGroupDefinition) particleContent).getResolvedModelGroupDefinition().getModelGroup();
 else if (particleContent instanceof XSDModelGroup)
  group = (XSDModelGroup) particleContent;
 if (group == null)
  return null;
 if (group.getContents().isEmpty() || group.eResource() != cType.eResource())
 {
  XSDComplexTypeContent content = cType.getContent();
  if (content instanceof XSDParticle)
   group = (XSDModelGroup) ((XSDParticle) content).getContent();
 }
 return group;
}

相关文章