Search in sources :

Example 1 with BoxFigure

use of org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.BoxFigure in project webtools.sourceediting by eclipse.

the class TopLevelFieldEditPart method refreshVisuals.

protected void refreshVisuals() {
    IField field = (IField) getModel();
    BoxFigure boxFigure = (BoxFigure) getFigure();
    Label label = boxFigure.getNameLabel();
    label.setText(field.getName());
    if (field.isAbstract()) {
        if (italicFont == null) {
            Font font = label.getFont();
            italicFont = getItalicFont(font);
        }
        if (italicFont != null) {
            label.setFont(italicFont);
        }
    } else {
        label.setFont(label.getParent().getFont());
    }
    super.refreshVisuals();
}
Also used : BoxFigure(org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.BoxFigure) Label(org.eclipse.draw2d.Label) IField(org.eclipse.wst.xsd.ui.internal.adt.facade.IField) Font(org.eclipse.swt.graphics.Font)

Example 2 with BoxFigure

use of org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.BoxFigure 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 3 with BoxFigure

use of org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.BoxFigure in project webtools.sourceediting by eclipse.

the class BoxEditPart method removeFeedback.

public void removeFeedback() {
    BoxFigure boxFigure = (BoxFigure) figure;
    LineBorder boxFigureLineBorder = (LineBorder) boxFigure.getBorder();
    boxFigureLineBorder.setWidth(1);
    boxFigureLineBorder.setColor(ColorConstants.black);
    boxFigure.getHeadingFigure().setSelected(false);
    figure.repaint();
    super.removeFeedback();
}
Also used : BoxFigure(org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.BoxFigure) LineBorder(org.eclipse.draw2d.LineBorder)

Example 4 with BoxFigure

use of org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.BoxFigure in project webtools.sourceediting by eclipse.

the class BoxEditPart method addFeedback.

public void addFeedback() {
    BoxFigure boxFigure = (BoxFigure) figure;
    LineBorder boxFigureLineBorder = (LineBorder) boxFigure.getBorder();
    boxFigureLineBorder.setWidth(2);
    boxFigureLineBorder.setColor(ColorConstants.darkBlue);
    boxFigure.getHeadingFigure().setSelected(true);
    figure.repaint();
    super.addFeedback();
}
Also used : BoxFigure(org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.BoxFigure) LineBorder(org.eclipse.draw2d.LineBorder)

Aggregations

BoxFigure (org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.BoxFigure)4 LineBorder (org.eclipse.draw2d.LineBorder)3 Label (org.eclipse.draw2d.Label)1 ToolbarLayout (org.eclipse.draw2d.ToolbarLayout)1 Font (org.eclipse.swt.graphics.Font)1 IField (org.eclipse.wst.xsd.ui.internal.adt.facade.IField)1 ITreeElement (org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement)1