Search in sources :

Example 1 with ITreeElement

use of org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement in project webtools.sourceediting by eclipse.

the class BoxEditPart method createFigure.

protected IFigure createFigure() {
    BoxFigure figure = new BoxFigure();
    LineBorder boxLineBorder = new LineBorder(1);
    figure.setBorder(boxLineBorder);
    ToolbarLayout toolbarLayout = new ToolbarLayout();
    toolbarLayout.setStretchMinorAxis(true);
    figure.setLayoutManager(toolbarLayout);
    // we should organize ITreeElement and integrate it with the facade
    if (getModel() instanceof ITreeElement) {
        figure.getNameLabel().setIcon(((ITreeElement) getModel()).getImage());
    }
    return figure;
}
Also used : BoxFigure(org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.BoxFigure) ToolbarLayout(org.eclipse.draw2d.ToolbarLayout) LineBorder(org.eclipse.draw2d.LineBorder) ITreeElement(org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement)

Example 2 with ITreeElement

use of org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement in project webtools.sourceediting by eclipse.

the class XSDSimpleTypeDefinitionAdapter method getChildren.

public ITreeElement[] getChildren() {
    List adapterList = new ArrayList();
    XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) target;
    List list = xsdSimpleTypeDefinition.getEnumerationFacets();
    populateAdapterList(list, adapterList);
    return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
}
Also used : XSDSimpleTypeDefinition(org.eclipse.xsd.XSDSimpleTypeDefinition) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) ITreeElement(org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement)

Example 3 with ITreeElement

use of org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement 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]);
}
Also used : XSDModelGroup(org.eclipse.xsd.XSDModelGroup) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) XSDModelGroupDefinition(org.eclipse.xsd.XSDModelGroupDefinition) ITreeElement(org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement)

Example 4 with ITreeElement

use of org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement in project webtools.sourceediting by eclipse.

the class XSDRedefineAdapter method getChildren.

public ITreeElement[] getChildren() {
    XSDRedefine xsdRedefine = (XSDRedefine) getTarget();
    children = new ArrayList();
    if (attributesCategory != null) {
        List attributes = getCategoryChildren(CategoryAdapter.ATTRIBUTES);
        List groups = getCategoryChildren(CategoryAdapter.GROUPS);
        List types = getCategoryChildren(CategoryAdapter.TYPES);
        attributesCategory.setChildren(attributes);
        attributesCategory.setAllChildren(attributes);
        typesCategory.setChildren(types);
        typesCategory.setAllChildren(types);
        groupsCategory.setChildren(groups);
        groupsCategory.setAllChildren(groups);
    } else {
        createCategoryAdapters(xsdRedefine);
    }
    children.add(attributesCategory);
    children.add(typesCategory);
    children.add(groupsCategory);
    return (ITreeElement[]) children.toArray(new ITreeElement[0]);
}
Also used : XSDRedefine(org.eclipse.xsd.XSDRedefine) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) ITreeElement(org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement)

Example 5 with ITreeElement

use of org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement in project webtools.sourceediting by eclipse.

the class XSDSchemaDirectiveAdapter method getChildren.

public ITreeElement[] getChildren() {
    List list = new ArrayList();
    List adapterList = new ArrayList();
    populateAdapterList(list, adapterList);
    return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
}
Also used : ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) ITreeElement(org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement)

Aggregations

ITreeElement (org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement)11 ArrayList (java.util.ArrayList)9 List (java.util.List)9 Iterator (java.util.Iterator)3 IADTObject (org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject)3 XSDModelGroup (org.eclipse.xsd.XSDModelGroup)3 XSDWildcard (org.eclipse.xsd.XSDWildcard)3 LineBorder (org.eclipse.draw2d.LineBorder)2 ToolbarLayout (org.eclipse.draw2d.ToolbarLayout)2 XSDAttributeGroupDefinition (org.eclipse.xsd.XSDAttributeGroupDefinition)2 XSDAttributeUse (org.eclipse.xsd.XSDAttributeUse)2 XSDComplexTypeDefinition (org.eclipse.xsd.XSDComplexTypeDefinition)2 XSDElementDeclaration (org.eclipse.xsd.XSDElementDeclaration)2 XSDModelGroupDefinition (org.eclipse.xsd.XSDModelGroupDefinition)2 XSDParticle (org.eclipse.xsd.XSDParticle)2 XSDParticleContent (org.eclipse.xsd.XSDParticleContent)2 XSDSimpleTypeDefinition (org.eclipse.xsd.XSDSimpleTypeDefinition)2 XSDTypeDefinition (org.eclipse.xsd.XSDTypeDefinition)2 EList (org.eclipse.emf.common.util.EList)1 IStructureFigure (org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure)1