use of org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel in project statecharts by Yakindu.
the class ExternalXtextLabelEditPart method createFigure.
@Override
protected IFigure createFigure() {
final WrappingLabel label = new SyntaxColoringLabel();
label.setTextWrap(true);
label.setAlignment(PositionConstants.LEFT | PositionConstants.TOP);
return label;
}
use of org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel in project statecharts by Yakindu.
the class XtextDirectEditManager method hookListeners.
protected void hookListeners() {
super.hookListeners();
// TODO: This gets around the problem of the cell editor not growing big
// enough when in autosize mode because it doesn't listen to textflow
// size changes. The superclass should be modified to not assume we want
// to listen to the editpart's figure.
ILabelDelegate label = (ILabelDelegate) getEditPart().getAdapter(ILabelDelegate.class);
if (label != null && getEditPart().getFigure() instanceof WrappingLabel) {
textFigureListener = new AncestorListener.Stub() {
public void ancestorMoved(IFigure ancestor) {
getLocator().relocate(getCellEditor());
}
};
((IFigure) ((WrappingLabel) getEditPart().getFigure()).getTextFigure().getChildren().get(0)).addAncestorListener(textFigureListener);
}
}
Aggregations