Search in sources :

Example 31 with ToolbarLayout

use of org.eclipse.draw2d.ToolbarLayout in project archi by archimatetool.

the class DrawerFigure method setLayoutMode.

public void setLayoutMode(int layoutMode) {
    if (this.layoutMode == layoutMode) {
        return;
    }
    this.layoutMode = layoutMode;
    LayoutManager manager;
    if (layoutMode == PaletteViewerPreferences.LAYOUT_COLUMNS) {
        manager = new ColumnsLayout();
        getContentPane().setBorder(SCROLL_PANE_BORDER);
    } else if (layoutMode == PaletteViewerPreferences.LAYOUT_ICONS) {
        PaletteContainerFlowLayout fl = new PaletteContainerFlowLayout();
        fl.setMinorSpacing(0);
        fl.setMajorSpacing(0);
        manager = fl;
        getContentPane().setBorder(SCROLL_PANE_BORDER);
    } else {
        manager = new ToolbarLayout();
        getContentPane().setBorder(SCROLL_PANE_LIST_BORDER);
    }
    getContentPane().setLayoutManager(manager);
}
Also used : PaletteToolbarLayout(org.eclipse.gef.ui.palette.editparts.PaletteToolbarLayout) ToolbarLayout(org.eclipse.draw2d.ToolbarLayout) LayoutManager(org.eclipse.draw2d.LayoutManager)

Example 32 with ToolbarLayout

use of org.eclipse.draw2d.ToolbarLayout in project archi by archimatetool.

the class GroupEditPart method refreshVisuals.

/**
 * @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals()
 */
@Override
protected void refreshVisuals() {
    int layout = getLayoutSetting();
    if (cachedLayout == layout)
        return;
    cachedLayout = layout;
    LayoutManager manager;
    if (layout == PaletteViewerPreferences.LAYOUT_COLUMNS) {
        manager = new ColumnsLayout();
        getContentPane().setBorder(SCROLL_PANE_BORDER);
    } else if (layout == PaletteViewerPreferences.LAYOUT_ICONS) {
        PaletteContainerFlowLayout flow = new PaletteContainerFlowLayout();
        flow.setMajorSpacing(0);
        flow.setMinorSpacing(0);
        manager = flow;
        getContentPane().setBorder(SCROLL_PANE_BORDER);
    } else {
        manager = new ToolbarLayout();
        getContentPane().setBorder(SCROLL_PANE_LIST_BORDER);
    }
    getContentPane().setLayoutManager(manager);
}
Also used : ToolbarLayout(org.eclipse.draw2d.ToolbarLayout) LayoutManager(org.eclipse.draw2d.LayoutManager)

Example 33 with ToolbarLayout

use of org.eclipse.draw2d.ToolbarLayout in project xtext-eclipse by eclipse.

the class RailroadDiagram method createLayoutManager.

@Override
protected LayoutManager createLayoutManager() {
    ToolbarLayout layout = new ToolbarLayout();
    layout.setSpacing(ILayoutConstants.VSPACE_BETWEEN_TRACKS);
    return layout;
}
Also used : ToolbarLayout(org.eclipse.draw2d.ToolbarLayout)

Example 34 with ToolbarLayout

use of org.eclipse.draw2d.ToolbarLayout in project jbosstools-hibernate by jbosstools.

the class NodeHeaderFigure method addEmbeddedParent.

private void addEmbeddedParent(String nodeName, String nodeType, String iconDescriptor, boolean hideName) {
    embeddedFigure = new Figure();
    ToolbarLayout layout = new ToolbarLayout(true);
    layout.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);
    embeddedFigure.setLayoutManager(layout);
    addIconLabel(iconDescriptor);
    addTypeAndNameColumn(nodeType, nodeName, hideName);
    add(embeddedFigure);
}
Also used : ToolbarLayout(org.eclipse.draw2d.ToolbarLayout) Figure(org.eclipse.draw2d.Figure)

Aggregations

ToolbarLayout (org.eclipse.draw2d.ToolbarLayout)34 Figure (org.eclipse.draw2d.Figure)14 IFigure (org.eclipse.draw2d.IFigure)11 MarginBorder (org.eclipse.draw2d.MarginBorder)8 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 LayoutManager (org.eclipse.draw2d.LayoutManager)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 PaletteToolbarLayout (org.eclipse.gef.ui.palette.editparts.PaletteToolbarLayout)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 PaletteViewer (org.eclipse.gef.ui.palette.PaletteViewer)2