use of org.eclipse.xsd.XSDModelGroupDefinition in project webtools.sourceediting by eclipse.
the class XSDModelGroupDefinitionAdapter method getText.
public String getText() {
XSDModelGroupDefinition xsdModelGroupDefinition = (XSDModelGroupDefinition) target;
// Removed
if (xsdModelGroupDefinition.getResolvedModelGroupDefinition().getContainer() == null && xsdModelGroupDefinition.getName() == null)
return "";
String result = xsdModelGroupDefinition.isModelGroupDefinitionReference() ? xsdModelGroupDefinition.getQName() : xsdModelGroupDefinition.getName();
return result == null ? Messages._UI_LABEL_ABSENT : result;
}
use of org.eclipse.xsd.XSDModelGroupDefinition in project webtools.sourceediting by eclipse.
the class XSDModelGroupDefinitionAdapter method getChildren.
public ITreeElement[] getChildren() {
XSDModelGroupDefinition def = (XSDModelGroupDefinition) target;
List list = new ArrayList();
// entries in the tree viewer for the same item
if (!def.isModelGroupDefinitionReference()) {
XSDModelGroup xsdModelGroup = ((XSDModelGroupDefinition) target).getResolvedModelGroupDefinition().getModelGroup();
if (xsdModelGroup != null)
list.add(xsdModelGroup);
}
List adapterList = new ArrayList();
populateAdapterList(list, adapterList);
return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
}
use of org.eclipse.xsd.XSDModelGroupDefinition in project webtools.sourceediting by eclipse.
the class XSDModelGroupDefinitionAdapter method getTopContainer.
public IADTObject getTopContainer() {
XSDModelGroupDefinition group = getXSDModelGroupDefinition();
XSDConcreteComponent container = group.getContainer();
if (container instanceof XSDSchema || container instanceof XSDRedefine)
return this;
else
return getGlobalXSDContainer(group);
}
use of org.eclipse.xsd.XSDModelGroupDefinition in project webtools.sourceediting by eclipse.
the class XSDRedefineAdapter method getCategoryChildren.
private List getCategoryChildren(int category) {
List list = new ArrayList();
XSDRedefine redefine = (XSDRedefine) target;
Iterator iterator = redefine.getContents().iterator();
while (iterator.hasNext()) {
XSDRedefineContent redefineContent = (XSDRedefineContent) iterator.next();
if (redefineContent instanceof XSDAttributeGroupDefinition && category == CategoryAdapter.ATTRIBUTES) {
list.add(redefineContent);
} else if (redefineContent instanceof XSDModelGroupDefinition && category == CategoryAdapter.GROUPS) {
list.add(redefineContent);
} else if (redefineContent instanceof XSDComplexTypeDefinition && category == CategoryAdapter.TYPES) {
list.add(redefineContent);
} else if (redefineContent instanceof XSDSimpleTypeDefinition && category == CategoryAdapter.TYPES) {
list.add(redefineContent);
}
}
List adapterList = new ArrayList();
populateAdapterList(list, adapterList);
return adapterList;
}
use of org.eclipse.xsd.XSDModelGroupDefinition in project tmdm-studio-se by Talend.
the class TreeExpandHelper method getName.
private String getName(Object objA) {
if (objA instanceof XSDElementDeclaration) {
XSDElementDeclaration decl = (XSDElementDeclaration) objA;
return decl.getName();
}
if (objA instanceof XSDModelGroup) {
XSDModelGroup goup = (XSDModelGroup) objA;
XSDParticle particle = (XSDParticle) goup.getContainer();
XSDComplexTypeDefinition complexTypeDefinition = (XSDComplexTypeDefinition) particle.getContainer();
String name = complexTypeDefinition.getName();
return name;
}
if (objA instanceof XSDModelGroupDefinition) {
XSDModelGroupDefinition goupDef = (XSDModelGroupDefinition) objA;
return goupDef.getName();
}
if (objA instanceof XSDParticle) {
XSDParticle particle = (XSDParticle) objA;
if (particle.getTerm() instanceof XSDElementDeclaration) {
XSDElementDeclaration decl = (XSDElementDeclaration) particle.getTerm();
return decl.getName();
}
}
if (objA instanceof XSDAnnotation) {
return null;
}
if (objA instanceof XSDIdentityConstraintDefinition) {
XSDIdentityConstraintDefinition constraint = (XSDIdentityConstraintDefinition) objA;
return constraint.getName();
}
if (objA instanceof XSDSimpleTypeDefinition) {
XSDSimpleTypeDefinition simpleDefine = (XSDSimpleTypeDefinition) objA;
return simpleDefine.getName();
}
if (objA instanceof XSDComplexTypeDefinition) {
XSDComplexTypeDefinition complexDefine = (XSDComplexTypeDefinition) objA;
return complexDefine.getName();
}
return null;
}
Aggregations