Search in sources :

Example 1 with FillLayout

use of org.eclipse.wst.xsd.ui.internal.design.layouts.FillLayout in project webtools.sourceediting by eclipse.

the class TopLevelComponentEditPart method createFigure.

protected IFigure createFigure() {
    Figure typeGroup = new Figure() {

        public void paint(Graphics graphics) {
            super.paint(graphics);
            if (hasFocus) {
                try {
                    graphics.pushState();
                    Rectangle r = getBounds();
                    graphics.setXORMode(true);
                    graphics.drawFocus(r.x, r.y + 1, r.width - 1, r.height - 2);
                } finally {
                    graphics.popState();
                }
            }
        }
    };
    typeGroup.setLayoutManager(new ToolbarLayout());
    labelHolder = new Figure();
    FillLayout fillLayout = new FillLayout();
    labelHolder.setLayoutManager(fillLayout);
    typeGroup.add(labelHolder);
    label = new HyperLinkLabel();
    label.setOpaque(true);
    label.setBorder(new MarginBorder(1, 2, 2, 5));
    if (!isHighContrast)
        label.setForegroundColor(ColorConstants.black);
    labelHolder.add(label);
    return typeGroup;
}
Also used : Graphics(org.eclipse.draw2d.Graphics) ToolbarLayout(org.eclipse.draw2d.ToolbarLayout) MarginBorder(org.eclipse.draw2d.MarginBorder) Rectangle(org.eclipse.draw2d.geometry.Rectangle) FillLayout(org.eclipse.wst.xsd.ui.internal.design.layouts.FillLayout) HyperLinkLabel(org.eclipse.wst.xsd.ui.internal.design.figures.HyperLinkLabel) IFigure(org.eclipse.draw2d.IFigure) FieldFigure(org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.FieldFigure) Figure(org.eclipse.draw2d.Figure)

Example 2 with FillLayout

use of org.eclipse.wst.xsd.ui.internal.design.layouts.FillLayout 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)

Aggregations

Figure (org.eclipse.draw2d.Figure)2 IFigure (org.eclipse.draw2d.IFigure)2 MarginBorder (org.eclipse.draw2d.MarginBorder)2 ToolbarLayout (org.eclipse.draw2d.ToolbarLayout)2 FillLayout (org.eclipse.wst.xsd.ui.internal.design.layouts.FillLayout)2 Graphics (org.eclipse.draw2d.Graphics)1 LineBorder (org.eclipse.draw2d.LineBorder)1 RectangleFigure (org.eclipse.draw2d.RectangleFigure)1 Dimension (org.eclipse.draw2d.geometry.Dimension)1 Rectangle (org.eclipse.draw2d.geometry.Rectangle)1 FieldFigure (org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.FieldFigure)1 HeadingFigure (org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.HeadingFigure)1 HyperLinkLabel (org.eclipse.wst.xsd.ui.internal.design.figures.HyperLinkLabel)1