Search in sources :

Example 1 with MarginBorder

use of org.eclipse.draw2d.MarginBorder in project dbeaver by serge-rider.

the class ERDOutlinePage method createControl.

/* (non-Javadoc)
     * @see org.eclipse.ui.part.IPage#createControl(org.eclipse.swt.widgets.Composite)
     */
@Override
public void createControl(Composite parent) {
    // create canvas and lws
    overview = new Canvas(parent, SWT.NONE);
    LightweightSystem lws = new LightweightSystem(overview);
    // create thumbnail
    thumbnail = new ScrollableThumbnail((Viewport) rootEditPart.getFigure());
    thumbnail.setBorder(new MarginBorder(3));
    thumbnail.setSource(rootEditPart.getLayer(LayerConstants.PRINTABLE_LAYERS));
    lws.setContents(thumbnail);
}
Also used : Canvas(org.eclipse.swt.widgets.Canvas) MarginBorder(org.eclipse.draw2d.MarginBorder) Viewport(org.eclipse.draw2d.Viewport) LightweightSystem(org.eclipse.draw2d.LightweightSystem) ScrollableThumbnail(org.eclipse.draw2d.parts.ScrollableThumbnail)

Example 2 with MarginBorder

use of org.eclipse.draw2d.MarginBorder in project tdi-studio-se by Talend.

the class GlobalMapKeysTable method createColumns.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.designer.gefabstractmap.figures.table.AbstractTable#createColumns()
     */
@Override
protected void createColumns() {
    layoutManager.setAjustToTableWidth(false);
    if (inputxmlTree != null && inputxmlTree.isLookup()) {
        expressionColumn = new TableColumn(ColumnKeyConstant.KEY_EXPRESSION);
        expressionColumn.setText(Messages.getString("InputTreeGlobalMapKeysTable.expressionTitle"));
        addColumn(expressionColumn);
        columnSash = new ColumnSash(this);
        columnSash.setLeftColumn(expressionColumn);
        addSeparator(columnSash);
        globalMapKeyColumn = new TableColumn(ColumnKeyConstant.KEY_NAME);
        globalMapKeyColumn.setText(Messages.getString("InputTreeGlobalMapKeysTable.globalMapKeyTitle"));
        columnSash.setRightColumn(globalMapKeyColumn);
        addColumn(globalMapKeyColumn);
        columnSash = new ColumnSash(this);
        columnSash.setLeftColumn(globalMapKeyColumn);
        addSeparator(columnSash);
        addColumn = new TableColumn(ColumnKeyConstant.KEY_VARIABLE);
        addColumn.setIcon(ImageProviderMapper.getImage(ImageInfo.ADD));
        addColumn.setLabelAlignment(PositionConstants.BOTTOM);
        columnSash.setRightColumn(addColumn);
        addColumn.setBorder(new MarginBorder(2));
        addColumn(addColumn);
        // add Listener
        addColumn.addMouseListener(new MouseListener() {

            @Override
            public void mousePressed(MouseEvent me) {
                GlobalMapNode defaultGlobalMapNode = XmlmapFactory.eINSTANCE.createGlobalMapNode();
                defaultGlobalMapNode.setExpression("");
                defaultGlobalMapNode.setName("\"myKey\"");
                inputxmlTree.getGlobalMapKeysValues().add(defaultGlobalMapNode);
            }

            @Override
            public void mouseReleased(MouseEvent me) {
            }

            @Override
            public void mouseDoubleClicked(MouseEvent me) {
            }
        });
    }
}
Also used : MouseListener(org.eclipse.draw2d.MouseListener) MouseEvent(org.eclipse.draw2d.MouseEvent) MarginBorder(org.eclipse.draw2d.MarginBorder) GlobalMapNode(org.talend.designer.xmlmap.model.emf.xmlmap.GlobalMapNode) ColumnSash(org.talend.designer.gefabstractmap.figures.table.ColumnSash) TableColumn(org.talend.designer.gefabstractmap.figures.table.TableColumn)

Example 3 with MarginBorder

use of org.eclipse.draw2d.MarginBorder in project tdi-studio-se by Talend.

the class TalendDrawerFigure method getTitleBorder.

protected Border getTitleBorder() {
    Insets insets = cssStyleSetting.getTitleMarginBorder().getInsets(null);
    Border talendTitleBorder = new MarginBorder(insets.top, insets.left + customizedCSSStyleSetting.getXOffset() * childLevel, insets.bottom, insets.right);
    return talendTitleBorder;
}
Also used : Insets(org.eclipse.draw2d.geometry.Insets) MarginBorder(org.eclipse.draw2d.MarginBorder) Border(org.eclipse.draw2d.Border) MarginBorder(org.eclipse.draw2d.MarginBorder)

Example 4 with MarginBorder

use of org.eclipse.draw2d.MarginBorder in project tdi-studio-se by Talend.

the class MapperRootEditPart method createFigure.

@Override
protected IFigure createFigure() {
    Figure mainFigure = new Figure();
    XmlMapDataLayout manager2 = new XmlMapDataLayout(getRootModelManager().getGraphicalViewer());
    mainFigure.setLayoutManager(manager2);
    // input
    Figure inputZone = new Figure();
    inputZone.setLayoutManager(new ZoneLayout());
    inputToolBar = createInputZoneToolBar();
    inputToolBar.setBorder(new LineBorder(ColorProviderMapper.getColor(ColorInfo.COLOR_TREE_BORDER)));
    inputZone.add(inputToolBar);
    inputScroll = new ScrollPane();
    inputScroll.setHorizontalScrollBarVisibility(ScrollPane.NEVER);
    leftFigure = new Figure();
    // ToolbarLayout subManager = new ToolbarLayout();
    ToolbarLayout subManager = createZoneContentLayout();
    subManager.setSpacing(20);
    subManager.setVertical(true);
    leftFigure.setLayoutManager(subManager);
    leftFigure.setBorder(new MarginBorder(20, 40, 20, 40));
    inputScroll.getViewport().setContents(leftFigure);
    inputScroll.getViewport().setContentsTracksWidth(true);
    inputZone.add(inputScroll);
    mainFigure.add(inputZone);
    // separator 1
    SashSeparator separatorLeft = new SashSeparator();
    separatorLeft.setImage(ImageProviderMapper.getImage(ImageInfo.ZONE_SASH));
    mainFigure.add(separatorLeft);
    // search , var
    searchToolBar = createSearchZoneToolBar();
    searchToolBar.setBorder(new LineBorder(ColorProviderMapper.getColor(ColorInfo.COLOR_TREE_BORDER)));
    varScroll = new ScrollPane();
    varScroll.setHorizontalScrollBarVisibility(ScrollPane.NEVER);
    centerFigure = new Figure();
    subManager = createZoneContentLayout();
    subManager.setSpacing(20);
    subManager.setVertical(true);
    centerFigure.setLayoutManager(subManager);
    centerFigure.setBorder(new MarginBorder(10, 40, 10, 40));
    varScroll.getViewport().setContents(centerFigure);
    varScroll.getViewport().setContentsTracksWidth(true);
    centerFigure.add(searchToolBar);
    mainFigure.add(varScroll);
    // separetor 2
    SashSeparator separatorRight = new SashSeparator();
    separatorRight.setImage(ImageProviderMapper.getImage(ImageInfo.ZONE_SASH));
    mainFigure.add(separatorRight);
    // output
    Figure outputZone = new Figure();
    outputZone.setLayoutManager(new ZoneLayout());
    outputToolBar = createOutputZoneToolBar();
    outputToolBar.setBorder(new LineBorder(ColorProviderMapper.getColor(ColorInfo.COLOR_TREE_BORDER)));
    outputZone.add(outputToolBar);
    outputScroll = new ScrollPane();
    outputScroll.setHorizontalScrollBarVisibility(ScrollPane.NEVER);
    rightFigure = new Figure();
    subManager = createZoneContentLayout();
    subManager.setSpacing(20);
    subManager.setVertical(true);
    rightFigure.setLayoutManager(subManager);
    rightFigure.setBorder(new MarginBorder(20, 40, 20, 40));
    outputScroll.getViewport().setContents(rightFigure);
    outputScroll.getViewport().setContentsTracksWidth(true);
    outputZone.add(outputScroll);
    mainFigure.add(outputZone);
    mainFigure.setOpaque(true);
    mainFigure.setBackgroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_BACKGROUND_LINKS_ZONE));
    separatorLeft.setLeftFigure(inputZone);
    separatorLeft.setRightFigure(varScroll);
    separatorLeft.setParentFigure(mainFigure);
    separatorRight.setLeftFigure(varScroll);
    separatorRight.setRightFigure(outputZone);
    separatorRight.setParentFigure(mainFigure);
    return mainFigure;
}
Also used : ToolbarLayout(org.eclipse.draw2d.ToolbarLayout) XmlMapDataLayout(org.talend.designer.gefabstractmap.figures.layout.XmlMapDataLayout) ScrollPane(org.eclipse.draw2d.ScrollPane) LineBorder(org.eclipse.draw2d.LineBorder) MarginBorder(org.eclipse.draw2d.MarginBorder) SashSeparator(org.talend.designer.gefabstractmap.figures.sash.SashSeparator) IFigure(org.eclipse.draw2d.IFigure) Figure(org.eclipse.draw2d.Figure)

Example 5 with MarginBorder

use of org.eclipse.draw2d.MarginBorder in project tdi-studio-se by Talend.

the class FilterContainer method createContent.

private void createContent() {
    FilterContainerLayout manager = new FilterContainerLayout();
    manager.setVertical(false);
    manager.setSpacing(5);
    setLayoutManager(manager);
    textArea = new FilterTextArea();
    textArea.setText(tableManager.getExpressionFilter());
    this.add(textArea);
    textArea.setOpaque(true);
    setBackgroundColor(ColorConstants.white);
    button = new ImageFigure(ImageProviderMapper.getImage(ImageInfo.FILTER_BUTTON));
    addButtonListener();
    this.add(button);
    setOpaque(true);
    setBackgroundColor(ColorConstants.yellow);
    setBorder(new MarginBorder(2));
}
Also used : MarginBorder(org.eclipse.draw2d.MarginBorder) ImageFigure(org.eclipse.draw2d.ImageFigure)

Aggregations

MarginBorder (org.eclipse.draw2d.MarginBorder)8 Figure (org.eclipse.draw2d.Figure)3 IFigure (org.eclipse.draw2d.IFigure)3 LineBorder (org.eclipse.draw2d.LineBorder)3 ImageFigure (org.eclipse.draw2d.ImageFigure)2 Label (org.eclipse.draw2d.Label)2 ScrollPane (org.eclipse.draw2d.ScrollPane)2 ToolbarLayout (org.eclipse.draw2d.ToolbarLayout)2 List (java.util.List)1 Border (org.eclipse.draw2d.Border)1 LightweightSystem (org.eclipse.draw2d.LightweightSystem)1 MouseEvent (org.eclipse.draw2d.MouseEvent)1 MouseListener (org.eclipse.draw2d.MouseListener)1 Viewport (org.eclipse.draw2d.Viewport)1 Insets (org.eclipse.draw2d.geometry.Insets)1 Rectangle (org.eclipse.draw2d.geometry.Rectangle)1 ScrollableThumbnail (org.eclipse.draw2d.parts.ScrollableThumbnail)1 Canvas (org.eclipse.swt.widgets.Canvas)1 ComboCellLabel (org.talend.designer.gefabstractmap.figures.ComboCellLabel)1 GenericFigure (org.talend.designer.gefabstractmap.figures.GenericFigure)1