use of com.liferay.ide.layouttpl.ui.draw2d.ColumnFigure in project liferay-ide by liferay.
the class PortletColumnEditPart method refreshVisuals.
protected void refreshVisuals() {
super.refreshVisuals();
IFigure parentFigure = ((GraphicalEditPart) getParent()).getFigure();
LayoutManager layoutManager = parentFigure.getLayoutManager();
Object constraint = layoutManager.getConstraint(getFigure());
GridData gd = null;
if (constraint instanceof GridData) {
gd = (GridData) constraint;
if (gd.heightHint == SWT.DEFAULT) {
gd.heightHint = getCastedParent().getDefaultColumnHeight();
}
} else {
gd = createGridData();
}
((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(), gd);
if (getFigure() instanceof ColumnFigure) {
Value<Integer> weight = getCastedModel().getWeight();
Integer weightValue = weight.content();
((ColumnFigure) getFigure()).setText(weightValue.toString());
}
}
use of com.liferay.ide.layouttpl.ui.draw2d.ColumnFigure in project liferay-ide by liferay.
the class PortletColumnEditPart method createFigureForModel.
protected Figure createFigureForModel() {
if (getModel() instanceof PortletColumnElement) {
RoundedRectangle rect = new ColumnFigure();
rect.setCornerDimensions(new Dimension(10, 10));
return rect;
} else {
throw new IllegalArgumentException();
}
}
Aggregations