Search in sources :

Example 1 with HyperLinkLabel

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

Aggregations

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