org.eclipse.xsd.XSDAttributeDeclaration.getResolvedAttributeDeclaration()方法的使用及代码示例

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

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

XSDAttributeDeclaration.getResolvedAttributeDeclaration介绍

[英]Returns the value of the 'Resolved Attribute Declaration' reference.

This concrete reference represents the attribute declaration resolved by the ref attribute.
[中]返回“已解析属性声明”引用的值。
这个具体的引用表示由ref属性解析的属性声明。

代码示例

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

XSDAttributeDeclaration attribute = (XSDAttributeDeclaration) itr.next();
if ( attribute.isAttributeDeclarationReference() ) {
  attribute = attribute.getResolvedAttributeDeclaration();

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

public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
 {
  if (attr.isAttributeDeclarationReference())
  {
   thingsWeNeedToListenTo.add(attr);
   thingsWeNeedToListenTo.add(attr.getResolvedAttributeDeclaration());
   concreteComponentList.add(attr);
  }
  else
  {
   concreteComponentList.add(attr.getResolvedAttributeDeclaration());
   thingsWeNeedToListenTo.add(attr.getResolvedAttributeDeclaration());
  }
 }
}

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

.getAttributeDeclarations(xsdType, false)) {
if (attribute.isAttributeDeclarationReference()) {
  attribute = attribute.getResolvedAttributeDeclaration();

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

@Override
 public void setPropertyValue(Object object, Object value)
 {
  super.setPropertyValue(((XSDAttributeDeclaration)object).getResolvedAttributeDeclaration(), value);
 }
}

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

protected void setAttributeType(XSDAttributeDeclaration ad)
 {
  ad = ad.getResolvedAttributeDeclaration();
  if (ad != null && newType instanceof XSDSimpleTypeDefinition)
  {
   ad.setTypeDefinition((XSDSimpleTypeDefinition)newType);
  }  
 }
}

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

@Override
public Object getPropertyValue(Object object)
{
 return super.getPropertyValue(((XSDAttributeDeclaration)object).getResolvedAttributeDeclaration());
}

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

protected XSDAttributeDeclaration getResolvedXSDAttributeDeclaration()
{
 return getXSDAttributeDeclaration().getResolvedAttributeDeclaration();
}

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

protected XSDAttributeDeclaration getResolvedXSDAttributeDeclaration()
{
 return getXSDAttributeDeclaration().getResolvedAttributeDeclaration();
}

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

/**
 * This returns XSDAttributeDeclaration.gif.
 */
@Override
public Object getImage(Object object)
{
 XSDAttributeDeclaration xsdAttributeDeclaration = ((XSDAttributeDeclaration)object);
 XSDAttributeDeclaration resolvedAttributeDeclaration = xsdAttributeDeclaration.getResolvedAttributeDeclaration();
 return 
  XSDEditPlugin.INSTANCE.getImage
   (resolvedAttributeDeclaration.getContainer() == null ?
    "full/obj16/XSDAttributeUnresolved" :
    xsdAttributeDeclaration.getResolvedAttributeDeclaration() == xsdAttributeDeclaration ?
     "full/obj16/XSDAttributeDeclaration" :
     "full/obj16/XSDAttributeUse");
}

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

@Override
 public String getText(Object object)
 {
  XSDAttributeDeclaration xsdAttributeDeclaration = ((XSDAttributeDeclaration)object);
  XSDAttributeDeclaration resolvedXSDAttributeDeclaration = xsdAttributeDeclaration.getResolvedAttributeDeclaration();
  String result = resolvedXSDAttributeDeclaration.getName();
  return result == null ? XSDEditPlugin.INSTANCE.getString("_UI_Absent_label") : result;
 }
};

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

public static List getChildAttributes(XSDComplexTypeDefinition ct)
{
 EList attrContents = ct.getAttributeContents();
 List attrs = new ArrayList();
 for (int i = 0; i < attrContents.size(); i++)
 {
  Object next = attrContents.get(i);
  if (next instanceof XSDAttributeUse)
  {
   attrs.add(((XSDAttributeUse) next).getContent().getResolvedAttributeDeclaration());
  }
  else if (next instanceof XSDAttributeGroupDefinition)
  {
   //XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) next;
  }
 }
 return attrs;
}

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

public int compare(XSDAttributeUse o1, XSDAttributeUse o2)
 {
  String name1 = o1.getContent().getResolvedAttributeDeclaration().getName();
  String name2 = o2.getContent().getResolvedAttributeDeclaration().getName();
  if (name1 == null && name2 == null)
  {
   return 0;
  }
  else if (name1 == null)
  {
   return 1;
  }
  else if (name2 == null)
  {
   return -1;
  }
  else
  {
   return collator.compare(name1, name2);
  }
 }
});

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

public String getTextForAttribute(XSDAttributeDeclaration ad, boolean showType)
{
 ad = ad.getResolvedAttributeDeclaration();
 String name = ad.getName();
 StringBuffer result = new StringBuffer();
 if (name == null)
 {
  result.append(" " + Messages._UI_LABEL_ABSENT + " ");  //$NON-NLS-1$ //$NON-NLS-2$
 }
 else
 {
  result.append(name);
 }
 if (ad.getAnonymousTypeDefinition() == null && ad.getTypeDefinition() != null)
 {
  result.append(" : "); //$NON-NLS-1$
  // result.append(resolvedAttributeDeclaration.getTypeDefinition().getQName(xsdAttributeDeclaration));
  result.append(ad.getTypeDefinition().getName());
 }
 return result.toString();
}

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

protected void patchHelper()
{
 XSDAttributeDeclaration newAttributeDeclaration = getContent();
 if (newAttributeDeclaration != null)
 {
  newAttributeDeclaration = newAttributeDeclaration.getResolvedAttributeDeclaration();
 }
 if (newAttributeDeclaration != getAttributeDeclaration())
 {
  setAttributeDeclaration(newAttributeDeclaration);
 }
}

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

protected void patchHelper()
{
 XSDAttributeDeclaration newAttributeDeclaration = getContent();
 if (newAttributeDeclaration != null)
 {
  newAttributeDeclaration = newAttributeDeclaration.getResolvedAttributeDeclaration();
 }
 if (newAttributeDeclaration != getAttributeDeclaration())
 {
  setAttributeDeclaration(newAttributeDeclaration);
 }
}

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

@Override
public String getText(Object object)
{
 XSDAttributeDeclaration xsdAttributeDeclaration = ((XSDAttributeDeclaration)object);
 XSDAttributeDeclaration resolvedAttributeDeclaration = xsdAttributeDeclaration.getResolvedAttributeDeclaration();
 String name =
  xsdAttributeDeclaration != resolvedAttributeDeclaration ?
   xsdAttributeDeclaration.getQName() :
   xsdAttributeDeclaration.getName();
 StringBuffer result = new StringBuffer();
 if (name == null)
 {
  result.append(XSDEditPlugin.INSTANCE.getString("_UI_Absent_label"));
 }
 else
 {
  result.append(name);
 }
 if (resolvedAttributeDeclaration.getAnonymousTypeDefinition() == null && resolvedAttributeDeclaration.getTypeDefinition() != null)
 {
  result.append(" : ");
  result.append(resolvedAttributeDeclaration.getTypeDefinition().getQName(xsdAttributeDeclaration));
 }
 return result.toString();
}

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

public Object caseXSDAttributeDeclaration(XSDAttributeDeclaration attributeDeclaration)
{
 XSDConcreteComponent target = null;
 if (attributeDeclaration.isAttributeDeclarationReference())
 {
  target = attributeDeclaration.getResolvedAttributeDeclaration();
 }
 else if (attributeDeclaration.getAnonymousTypeDefinition() == null)
 {
  target = attributeDeclaration.getTypeDefinition();
  // Avoid navigating to built in data types.
  if (isFromSchemaForSchema(target))
  {
   target = null;
  }
 }
 return target;
}

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

@Override
protected void reconcileContents(Element changedElement) 
{
 super.reconcileContents(changedElement);
 if (changedElement == getElement())
 {
  XSDAttributeDeclaration theContent = getContent();
  if (theContent != null)
  {
   theContent.elementContentsChanged(changedElement);
   XSDAttributeDeclaration newAttributeDeclaration = theContent.getResolvedAttributeDeclaration();
   if (newAttributeDeclaration != getAttributeDeclaration())
   {
    setAttributeDeclaration(newAttributeDeclaration);
   }
  }
 }
}

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

@Override
protected void reconcileContents(Element changedElement) 
{
 super.reconcileContents(changedElement);
 if (changedElement == getElement())
 {
  XSDAttributeDeclaration theContent = getContent();
  if (theContent != null)
  {
   theContent.elementContentsChanged(changedElement);
   XSDAttributeDeclaration newAttributeDeclaration = theContent.getResolvedAttributeDeclaration();
   if (newAttributeDeclaration != getAttributeDeclaration())
   {
    setAttributeDeclaration(newAttributeDeclaration);
   }
  }
 }
}

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

private void fillTypesCombo()
{
 IEditorPart editor = getActiveEditor();
 XSDTypeReferenceEditManager manager = (XSDTypeReferenceEditManager)editor.getAdapter(XSDTypeReferenceEditManager.class);    
 ComponentSpecification[] items = manager.getQuickPicks();
 
 typeCombo.removeAll();
 typeCombo.add(Messages._UI_ACTION_BROWSE);
 typeCombo.add(Messages._UI_ACTION_NEW);
 for (int i = 0; i < items.length; i++)
 {
  typeCombo.add(items[i].getName());
 }
 XSDAttributeDeclaration namedComponent = ((XSDAttributeDeclaration) input).getResolvedAttributeDeclaration();
 XSDTypeDefinition namedComponentType = namedComponent.getType();
 if (namedComponentType != null)
 {
  String currentTypeName = namedComponentType.getQName(xsdSchema); // no prefix
  ComponentSpecification ret = getComponentSpecFromQuickPickForValue(currentTypeName, manager);
  if (ret == null) //not in quickPick
   typeCombo.add(currentTypeName);
 }
}

相关文章

微信公众号

最新文章

更多