use of org.eclipse.jface.fieldassist.TextControlCreator in project tdi-studio-se by Talend.
the class PasswordController method estimateRowSize.
/*
* (non-Javadoc)
*
* @see
* org.talend.designer.core.ui.editor.properties.controllers.TextController#estimateRowSize(org.eclipse.swt.widgets
* .Composite, org.talend.core.model.process.IElementParameter)
*/
@Override
public int estimateRowSize(Composite subComposite, IElementParameter param) {
if (!estimateInitialized) {
final DecoratedField dField = new DecoratedField(subComposite, SWT.BORDER, new TextControlCreator());
Point initialSize = dField.getLayoutControl().computeSize(SWT.DEFAULT, SWT.DEFAULT);
dField.getLayoutControl().dispose();
//$NON-NLS-1$
Button btn = getWidgetFactory().createButton(subComposite, "", SWT.PUSH);
int buttonSize = btn.computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
btn.dispose();
rowSize = Math.max(initialSize.y, buttonSize) + ITabbedPropertyConstants.VSPACE;
estimateInitialized = true;
}
return rowSize;
}
Aggregations