Search in sources :

Example 1 with TextControlCreator

use of org.eclipse.jface.fieldassist.TextControlCreator in project tdi-studio-se by Talend.

the class TextController 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) {
    if (!estimateInitialized) {
        final DecoratedField dField = new DecoratedField(subComposite, SWT.BORDER, new TextControlCreator());
        Point initialSize = dField.getLayoutControl().computeSize(SWT.DEFAULT, SWT.DEFAULT);
        dField.getLayoutControl().dispose();
        rowSize = initialSize.y + ITabbedPropertyConstants.VSPACE;
        estimateInitialized = true;
    }
    return rowSize;
}
Also used : DecoratedField(org.eclipse.jface.fieldassist.DecoratedField) SelectAllTextControlCreator(org.talend.designer.core.ui.editor.properties.controllers.creator.SelectAllTextControlCreator) TextControlCreator(org.eclipse.jface.fieldassist.TextControlCreator) Point(org.eclipse.swt.graphics.Point)

Example 2 with TextControlCreator

use of org.eclipse.jface.fieldassist.TextControlCreator in project tdi-studio-se by Talend.

the class VersionController 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) {
    DecoratedField dField = new DecoratedField(subComposite, SWT.BORDER, new TextControlCreator());
    Point initialSize = dField.getLayoutControl().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    dField.getLayoutControl().dispose();
    Button btnUp, btnDown;
    //$NON-NLS-1$
    btnUp = getWidgetFactory().createButton(subComposite, "M", SWT.PUSH);
    Point btnUpSize = btnUp.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    btnUp.dispose();
    //$NON-NLS-1$
    btnDown = getWidgetFactory().createButton(subComposite, "m", SWT.PUSH);
    Point btnDownSize = btnDown.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    btnDown.dispose();
    Point btnSize = new Point(Math.max(btnUpSize.x, btnDownSize.x), Math.max(btnUpSize.y, btnDownSize.y));
    return Math.max(btnSize.y, initialSize.y) + ITabbedPropertyConstants.VSPACE;
}
Also used : Button(org.eclipse.swt.widgets.Button) DecoratedField(org.eclipse.jface.fieldassist.DecoratedField) SelectAllTextControlCreator(org.talend.designer.core.ui.editor.properties.controllers.creator.SelectAllTextControlCreator) TextControlCreator(org.eclipse.jface.fieldassist.TextControlCreator) Point(org.eclipse.swt.graphics.Point)

Example 3 with TextControlCreator

use of org.eclipse.jface.fieldassist.TextControlCreator in project tdi-studio-se by Talend.

the class CommandController method estimateRowSize.

@Override
public int estimateRowSize(Composite subComposite, IElementParameter param) {
    DecoratedField dField = new DecoratedField(subComposite, SWT.BORDER, new TextControlCreator());
    Point initialSize = dField.getLayoutControl().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    dField.getLayoutControl().dispose();
    return initialSize.y + ITabbedPropertyConstants.VSPACE;
}
Also used : DecoratedField(org.eclipse.jface.fieldassist.DecoratedField) SelectAllTextControlCreator(org.talend.designer.core.ui.editor.properties.controllers.creator.SelectAllTextControlCreator) TextControlCreator(org.eclipse.jface.fieldassist.TextControlCreator) Point(org.eclipse.swt.graphics.Point)

Example 4 with TextControlCreator

use of org.eclipse.jface.fieldassist.TextControlCreator in project tdi-studio-se by Talend.

the class DCSchemaController method estimateRowSize.

@SuppressWarnings("deprecation")
@Override
public int estimateRowSize(Composite subComposite, IElementParameter param) {
    DecoratedField dField = new DecoratedField(subComposite, SWT.BORDER, new TextControlCreator());
    Point initialSize = dField.getLayoutControl().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    dField.getLayoutControl().dispose();
    return initialSize.y + ITabbedPropertyConstants.VSPACE;
}
Also used : DecoratedField(org.eclipse.jface.fieldassist.DecoratedField) SelectAllTextControlCreator(org.talend.designer.core.ui.editor.properties.controllers.creator.SelectAllTextControlCreator) TextControlCreator(org.eclipse.jface.fieldassist.TextControlCreator) Point(org.eclipse.swt.graphics.Point)

Example 5 with TextControlCreator

use of org.eclipse.jface.fieldassist.TextControlCreator in project tdi-studio-se by Talend.

the class DateController 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) {
    DecoratedField dField = new DecoratedField(subComposite, SWT.BORDER, new TextControlCreator());
    Point initialSize = dField.getLayoutControl().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    dField.getLayoutControl().dispose();
    return initialSize.y + ITabbedPropertyConstants.VSPACE;
}
Also used : DecoratedField(org.eclipse.jface.fieldassist.DecoratedField) SelectAllTextControlCreator(org.talend.designer.core.ui.editor.properties.controllers.creator.SelectAllTextControlCreator) TextControlCreator(org.eclipse.jface.fieldassist.TextControlCreator) Point(org.eclipse.swt.graphics.Point)

Aggregations

DecoratedField (org.eclipse.jface.fieldassist.DecoratedField)11 TextControlCreator (org.eclipse.jface.fieldassist.TextControlCreator)11 Point (org.eclipse.swt.graphics.Point)11 SelectAllTextControlCreator (org.talend.designer.core.ui.editor.properties.controllers.creator.SelectAllTextControlCreator)10 Button (org.eclipse.swt.widgets.Button)2 FormData (org.eclipse.swt.layout.FormData)1 Text (org.eclipse.swt.widgets.Text)1