Search in sources :

Example 1 with XSDSchemaAdapter

use of org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaAdapter in project webtools.sourceediting by eclipse.

the class XSDSchemaEditPart method getModelChildren.

protected List getModelChildren() {
    XSDSchemaAdapter schemaAdapter = (XSDSchemaAdapter) getModel();
    List list = new ArrayList();
    // Bug 103870: undo blanks out schema view
    // schemaAdapter.updateCategories();
    List templist = new ArrayList();
    templist.add(schemaAdapter.getCategory(CategoryAdapter.DIRECTIVES));
    Holder holder = new Holder(templist);
    list.add(holder);
    templist = new ArrayList();
    templist.add(schemaAdapter.getCategory(CategoryAdapter.ELEMENTS));
    templist.add(schemaAdapter.getCategory(CategoryAdapter.TYPES));
    holder = new Holder(templist);
    list.add(holder);
    templist = new ArrayList();
    templist.add(schemaAdapter.getCategory(CategoryAdapter.ATTRIBUTES));
    templist.add(schemaAdapter.getCategory(CategoryAdapter.GROUPS));
    holder = new Holder(templist);
    list.add(holder);
    return list;
}
Also used : ArrayList(java.util.ArrayList) XSDSchemaAdapter(org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaAdapter) ArrayList(java.util.ArrayList) List(java.util.List)

Example 2 with XSDSchemaAdapter

use of org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaAdapter in project webtools.sourceediting by eclipse.

the class XSDSchemaEditPart method refreshVisuals.

protected void refreshVisuals() {
    super.refreshVisuals();
    LineBorder border = (LineBorder) outer.getBorder();
    border.setWidth(isSelected ? 2 : 1);
    headingFigure.setSelected(isSelected);
    XSDSchemaAdapter schemaAdapter = (XSDSchemaAdapter) getModel();
    Image image = schemaAdapter.getImage();
    headingFigure.getLabel().setIcon(image);
    if (image != null) {
        headingFigure.getLabel().setIcon(XSDCommonUIUtils.getUpdatedImage((XSDConcreteComponent) schemaAdapter.getTarget(), image, false));
    }
    outer.repaint();
    String targetNamespaceValue = ((XSDSchema) ((XSDSchemaAdapter) getModel()).getTarget()).getTargetNamespace();
    targetNamespaceValue = TextProcessor.process(targetNamespaceValue);
    if (targetNamespaceValue == null || targetNamespaceValue.length() == 0) {
        targetNamespaceValue = Messages._UI_GRAPH_XSDSCHEMA_NO_NAMESPACE;
    }
    // $NON-NLS-1$
    headingFigure.getLabel().setText(Messages._UI_GRAPH_XSDSCHEMA + " : " + targetNamespaceValue);
}
Also used : XSDConcreteComponent(org.eclipse.xsd.XSDConcreteComponent) LineBorder(org.eclipse.draw2d.LineBorder) XSDSchemaAdapter(org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaAdapter) Image(org.eclipse.swt.graphics.Image) XSDSchema(org.eclipse.xsd.XSDSchema)

Aggregations

XSDSchemaAdapter (org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaAdapter)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 LineBorder (org.eclipse.draw2d.LineBorder)1 Image (org.eclipse.swt.graphics.Image)1 XSDConcreteComponent (org.eclipse.xsd.XSDConcreteComponent)1 XSDSchema (org.eclipse.xsd.XSDSchema)1