Search in sources :

Example 6 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 7 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 8 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 9 with TextControlCreator

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;
}
Also used : Button(org.eclipse.swt.widgets.Button) DecoratedField(org.eclipse.jface.fieldassist.DecoratedField) TextControlCreator(org.eclipse.jface.fieldassist.TextControlCreator) Point(org.eclipse.swt.graphics.Point) Point(org.eclipse.swt.graphics.Point)

Example 10 with TextControlCreator

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

the class DirectoryController 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)10 TextControlCreator (org.eclipse.jface.fieldassist.TextControlCreator)10 Point (org.eclipse.swt.graphics.Point)10 SelectAllTextControlCreator (org.talend.designer.core.ui.editor.properties.controllers.creator.SelectAllTextControlCreator)9 Button (org.eclipse.swt.widgets.Button)2 FormData (org.eclipse.swt.layout.FormData)1 Text (org.eclipse.swt.widgets.Text)1