Search in sources :

Example 11 with ToolbarLayout

use of org.eclipse.draw2d.ToolbarLayout 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 12 with ToolbarLayout

use of org.eclipse.draw2d.ToolbarLayout in project webtools.sourceediting by eclipse.

the class RootContentEditPart method createFigure.

protected IFigure createFigure() {
    Panel panel = new Panel();
    panel.setBorder(new MarginBorder(60));
    ToolbarLayout panelLayout = new ToolbarLayout(false);
    panelLayout.setStretchMinorAxis(true);
    panel.setLayoutManager(panelLayout);
    contentPane = new Figure();
    panel.add(contentPane);
    ToolbarLayout tb = new ToolbarLayout(false);
    tb.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);
    tb.setStretchMinorAxis(true);
    tb.setSpacing(40);
    contentPane.setLayoutManager(tb);
    return panel;
}
Also used : Panel(org.eclipse.draw2d.Panel) ToolbarLayout(org.eclipse.draw2d.ToolbarLayout) MarginBorder(org.eclipse.draw2d.MarginBorder) IFigure(org.eclipse.draw2d.IFigure) Figure(org.eclipse.draw2d.Figure)

Example 13 with ToolbarLayout

use of org.eclipse.draw2d.ToolbarLayout in project webtools.sourceediting by eclipse.

the class RootHolderEditPart method createFigure.

protected IFigure createFigure() {
    panel = new Panel();
    ToolbarLayout layout = new ToolbarLayout(true);
    layout.setStretchMinorAxis(false);
    layout.setSpacing(100);
    panel.setLayoutManager(layout);
    return panel;
}
Also used : Panel(org.eclipse.draw2d.Panel) ToolbarLayout(org.eclipse.draw2d.ToolbarLayout)

Example 14 with ToolbarLayout

use of org.eclipse.draw2d.ToolbarLayout 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 15 with ToolbarLayout

use of org.eclipse.draw2d.ToolbarLayout in project cubrid-manager by CUBRID.

the class GraphPlanTooltipFigure method addTextItem.

public void addTextItem(String name, String value) {
    ToolbarLayout layout = new ToolbarLayout(false);
    Panel panel = new Panel();
    panel.setLayoutManager(layout);
    getTextCompartment().add(panel);
    Label namelbl = new Label();
    namelbl.setFont(bolderFont);
    namelbl.setTextAlignment(PositionConstants.LEFT);
    namelbl.setText(name);
    panel.add(namelbl);
    Label outputLbl = new Label();
    outputLbl.setText(value);
    outputLbl.setFont(normalFont);
    panel.add(outputLbl);
    updateMap(name, textFigures, namelbl, outputLbl);
}
Also used : ToolbarLayout(org.eclipse.draw2d.ToolbarLayout) Panel(org.eclipse.draw2d.Panel) Label(org.eclipse.draw2d.Label)

Aggregations

ToolbarLayout (org.eclipse.draw2d.ToolbarLayout)30 Figure (org.eclipse.draw2d.Figure)14 IFigure (org.eclipse.draw2d.IFigure)11 MarginBorder (org.eclipse.draw2d.MarginBorder)7 LineBorder (org.eclipse.draw2d.LineBorder)6 Rectangle (org.eclipse.draw2d.geometry.Rectangle)5 List (java.util.List)3 ImageFigure (org.eclipse.draw2d.ImageFigure)3 Label (org.eclipse.draw2d.Label)3 Panel (org.eclipse.draw2d.Panel)3 RectangleFigure (org.eclipse.draw2d.RectangleFigure)3 Dimension (org.eclipse.draw2d.geometry.Dimension)3 Point (org.eclipse.draw2d.geometry.Point)3 Image (org.eclipse.swt.graphics.Image)3 ECoreImage (org.talend.commons.ui.runtime.image.ECoreImage)3 SimpleHtmlFigure (org.talend.commons.ui.utils.workbench.gef.SimpleHtmlFigure)3 ScrollPane (org.eclipse.draw2d.ScrollPane)2 IStructureFigure (org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure)2 ITreeElement (org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement)2 HeadingFigure (org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.HeadingFigure)2