Search in sources :

Example 21 with IControlCreator

use of org.eclipse.jface.fieldassist.IControlCreator in project tesb-studio-se by Talend.

the class RouteResourceController method estimateRowSize.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.designer.core.ui.editor.properties.controllers.
     * AbstractElementPropertySectionController#estimateRowSize (org.eclipse.swt.widgets.Composite,
     * org.talend.core.model.process.IElementParameter)
     */
@Override
public int estimateRowSize(Composite subComposite, IElementParameter param) {
    final DecoratedField dField = new DecoratedField(subComposite, SWT.BORDER, new IControlCreator() {

        public Control createControl(Composite parent, int style) {
            return getWidgetFactory().createButton(parent, EParameterName.ROUTE_RESOURCE_TYPE.getDisplayName(), SWT.None);
        }
    });
    Point initialSize = dField.getLayoutControl().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    dField.getLayoutControl().dispose();
    return initialSize.y + ITabbedPropertyConstants.VSPACE;
}
Also used : IControlCreator(org.eclipse.jface.fieldassist.IControlCreator) Control(org.eclipse.swt.widgets.Control) Composite(org.eclipse.swt.widgets.Composite) DecoratedField(org.eclipse.jface.fieldassist.DecoratedField) Point(org.eclipse.swt.graphics.Point) Point(org.eclipse.swt.graphics.Point)

Aggregations

DecoratedField (org.eclipse.jface.fieldassist.DecoratedField)21 IControlCreator (org.eclipse.jface.fieldassist.IControlCreator)21 Composite (org.eclipse.swt.widgets.Composite)21 Point (org.eclipse.swt.graphics.Point)20 Control (org.eclipse.swt.widgets.Control)18 FormData (org.eclipse.swt.layout.FormData)12 FormAttachment (org.eclipse.swt.layout.FormAttachment)9 Button (org.eclipse.swt.widgets.Button)9 FieldDecoration (org.eclipse.jface.fieldassist.FieldDecoration)7 CLabel (org.eclipse.swt.custom.CLabel)6 Node (org.talend.designer.core.ui.editor.nodes.Node)6 GC (org.eclipse.swt.graphics.GC)5 ColorStyledText (org.talend.commons.ui.swt.colorstyledtext.ColorStyledText)5 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)2 StyledText (org.eclipse.swt.custom.StyledText)2 Font (org.eclipse.swt.graphics.Font)2 FontData (org.eclipse.swt.graphics.FontData)2 FormLayout (org.eclipse.swt.layout.FormLayout)2 Display (org.eclipse.swt.widgets.Display)2 Label (org.eclipse.swt.widgets.Label)2