Search in sources :

Example 1 with HeadingFigure

use of org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.HeadingFigure in project webtools.sourceediting by eclipse.

the class XSDSchemaEditPart method createFigure.

protected IFigure createFigure() {
    outer = new Figure();
    outer.setBorder(new LineBorder(1));
    FillLayout fillLayout = new FillLayout(4);
    outer.setLayoutManager(fillLayout);
    headingFigure = new HeadingFigure();
    outer.add(headingFigure);
    RectangleFigure line = new RectangleFigure() {

        public Dimension getPreferredSize(int wHint, int hHint) {
            Dimension d = super.getPreferredSize(wHint, hHint);
            d.height = 1;
            return d;
        }
    };
    ToolbarLayout lineLayout = new ToolbarLayout(false);
    lineLayout.setVertical(true);
    lineLayout.setStretchMinorAxis(true);
    line.setLayoutManager(lineLayout);
    outer.add(line);
    contentFigure = new Figure();
    contentFigure.setBorder(new MarginBorder(4));
    fillLayout = new FillLayout(4);
    contentFigure.setLayoutManager(fillLayout);
    outer.add(contentFigure);
    return outer;
}
Also used : ToolbarLayout(org.eclipse.draw2d.ToolbarLayout) RectangleFigure(org.eclipse.draw2d.RectangleFigure) LineBorder(org.eclipse.draw2d.LineBorder) MarginBorder(org.eclipse.draw2d.MarginBorder) FillLayout(org.eclipse.wst.xsd.ui.internal.design.layouts.FillLayout) Dimension(org.eclipse.draw2d.geometry.Dimension) HeadingFigure(org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.HeadingFigure) IFigure(org.eclipse.draw2d.IFigure) RectangleFigure(org.eclipse.draw2d.RectangleFigure) Figure(org.eclipse.draw2d.Figure) HeadingFigure(org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.HeadingFigure)

Example 2 with HeadingFigure

use of org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.HeadingFigure in project webtools.sourceediting by eclipse.

the class CategoryEditPart method createHeadingFigure.

protected void createHeadingFigure() {
    headingFigure = new HeadingFigure();
    outerPane.add(headingFigure);
    headingFigure.getLabel().setText(((CategoryAdapter) getModel()).getText());
    headingFigure.getLabel().setIcon(((CategoryAdapter) getModel()).getImage());
}
Also used : HeadingFigure(org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.HeadingFigure)

Example 3 with HeadingFigure

use of org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.HeadingFigure in project webtools.sourceediting by eclipse.

the class XSDSimpleTypeEditPart method refreshVisuals.

protected void refreshVisuals() {
    XSDSimpleTypeDefinitionAdapter adapter = (XSDSimpleTypeDefinitionAdapter) getModel();
    String name = adapter.getDisplayName();
    HeadingFigure headingFigure = figure.getHeadingFigure();
    headingFigure.setIsReadOnly(adapter.isReadOnly());
    Label label = headingFigure.getLabel();
    label.setText(name);
    label.setIcon(XSDCommonUIUtils.getUpdatedImage(adapter.getXSDTypeDefinition(), adapter.getImage(), adapter.isReadOnly()));
}
Also used : XSDSimpleTypeDefinitionAdapter(org.eclipse.wst.xsd.ui.internal.adapters.XSDSimpleTypeDefinitionAdapter) Label(org.eclipse.draw2d.Label) HeadingFigure(org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.HeadingFigure)

Aggregations

HeadingFigure (org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.HeadingFigure)3 Figure (org.eclipse.draw2d.Figure)1 IFigure (org.eclipse.draw2d.IFigure)1 Label (org.eclipse.draw2d.Label)1 LineBorder (org.eclipse.draw2d.LineBorder)1 MarginBorder (org.eclipse.draw2d.MarginBorder)1 RectangleFigure (org.eclipse.draw2d.RectangleFigure)1 ToolbarLayout (org.eclipse.draw2d.ToolbarLayout)1 Dimension (org.eclipse.draw2d.geometry.Dimension)1 XSDSimpleTypeDefinitionAdapter (org.eclipse.wst.xsd.ui.internal.adapters.XSDSimpleTypeDefinitionAdapter)1 FillLayout (org.eclipse.wst.xsd.ui.internal.design.layouts.FillLayout)1