Search in sources :

Example 1 with ComboFieldEditor

use of org.talend.commons.ui.utils.workbench.preferences.ComboFieldEditor in project tdi-studio-se by Talend.

the class ComponentsPreferencePage method createFieldEditors2.

public void createFieldEditors2(Composite composite) {
    LINK_STYLE[] linkStyles = LINK_STYLE.values();
    String[][] strComboValues = new String[linkStyles.length][2];
    for (int i = 0; i < linkStyles.length; i++) {
        strComboValues[i][0] = linkStyles[i].getDisplayName();
        strComboValues[i][1] = linkStyles[i].getName();
    }
    ComboFieldEditor dbTypeField = new ComboFieldEditor(IComponentPreferenceConstant.LINK_STYLE, Messages.getString("ComponentsPreferencePage.configuration.LINK_STYLE"), strComboValues, //$NON-NLS-1$
    composite);
    addField(dbTypeField);
}
Also used : ComboFieldEditor(org.talend.commons.ui.utils.workbench.preferences.ComboFieldEditor)

Example 2 with ComboFieldEditor

use of org.talend.commons.ui.utils.workbench.preferences.ComboFieldEditor in project tdi-studio-se by Talend.

the class MetadataTypeLengthPreferencePage method createJavaFieldEditors.

/**
     * DOC qwei Comment method "createJavaFieldEditors".
     */
private void createJavaFieldEditors(Composite com) {
    JavaType[] strTypeValue = JavaTypesManager.getJavaTypes();
    String[] strDisplay = new String[strTypeValue.length];
    String[] strValue = new String[strTypeValue.length];
    for (int i = 0; i < strDisplay.length; i++) {
        strDisplay[i] = strTypeValue[i].getNullableClass().getSimpleName();
        strValue[i] = strTypeValue[i].getId();
    }
    String[][] strvalueType = new String[strDisplay.length][2];
    for (int i = 0; i < strDisplay.length; i++) {
        strvalueType[i][0] = strDisplay[i];
        strvalueType[i][1] = strValue[i];
    }
    comboValueTypeField = new ComboFieldEditor(MetadataTypeLengthConstants.VALUE_DEFAULT_TYPE, Messages.getString("MetadataTypeLengthConstants.VALUE_DEFAULT_TYPE"), strvalueType, //$NON-NLS-1$
    com);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan = 4;
    com.setLayoutData(gridData);
    GridLayout gridLayout = (GridLayout) com.getLayout();
    gridLayout.numColumns = 6;
    com.setLayout(gridLayout);
    valueLengthField = new StringFieldEditor(MetadataTypeLengthConstants.VALUE_DEFAULT_LENGTH, Messages.getString("MetadataTypeLengthConstants.VALUE_DEFAULT_LENGTH"), //$NON-NLS-1$
    valueGroup);
    addField(comboValueTypeField);
    addField(valueLengthField);
    /**
         * set Fields
         * 
         */
    fieldGroup = new Group(parent, SWT.NONE);
    //$NON-NLS-1$
    fieldGroup.setText(Messages.getString("MetadataTypeLengthPreferencePage.FIELD"));
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    fieldGroup.setLayoutData(gd);
    com = new Composite(fieldGroup, SWT.NONE);
    comboFieldTypeField = new ComboFieldEditor(MetadataTypeLengthConstants.FIELD_DEFAULT_TYPE, Messages.getString("MetadataTypeLengthConstants.FIELD_DEFAULT_TYPE"), strvalueType, //$NON-NLS-1$
    com);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan = 4;
    com.setLayoutData(gridData);
    gridLayout = (GridLayout) com.getLayout();
    gridLayout.numColumns = 6;
    com.setLayout(gridLayout);
    fieldLengthField = new StringFieldEditor(MetadataTypeLengthConstants.FIELD_DEFAULT_LENGTH, Messages.getString("MetadataTypeLengthConstants.FIELD_DEFAULT_LENGTH"), //$NON-NLS-1$
    fieldGroup);
    /**
         * set data Type
         */
    dbTypeGroup = new Group(parent, SWT.NONE);
    //$NON-NLS-1$
    dbTypeGroup.setText(Messages.getString("MetadataTypeLengthPreferencePage.DBTYPE"));
    gd = new GridData(GridData.FILL_HORIZONTAL);
    dbTypeGroup.setLayoutData(gd);
    booleanField = new StringFieldEditor(MetadataTypeLengthConstants.ID_BOOLEAN, Messages.getString("MetadataTypeLengthConstants.BOOLEAN_LENGTH"), //$NON-NLS-1$
    dbTypeGroup);
    bigDecimalField = new StringFieldEditor(MetadataTypeLengthConstants.ID_BIGDECIMAL, Messages.getString("MetadataTypeLengthConstants.BIGDECIMAL_LENGTH"), //$NON-NLS-1$
    dbTypeGroup);
    byteField = new StringFieldEditor(MetadataTypeLengthConstants.ID_BYTE, Messages.getString("MetadataTypeLengthConstants.BYTE_LENGTH"), //$NON-NLS-1$
    dbTypeGroup);
    integerField = new StringFieldEditor(MetadataTypeLengthConstants.ID_INTEGER, Messages.getString("MetadataTypeLengthConstants.INTEGER_LENGTH"), //$NON-NLS-1$
    dbTypeGroup);
    bytearrayField = new StringFieldEditor(MetadataTypeLengthConstants.ID_BYTEARRAY, Messages.getString("MetadataTypeLengthConstants.BYTEARRAY_LENGTH"), //$NON-NLS-1$
    dbTypeGroup);
    longField = new StringFieldEditor(MetadataTypeLengthConstants.ID_LONG, Messages.getString("MetadataTypeLengthConstants.LONG_LENGTH"), //$NON-NLS-1$
    dbTypeGroup);
    characterField = new StringFieldEditor(MetadataTypeLengthConstants.ID_CHARACTER, Messages.getString("MetadataTypeLengthConstants.CHARACTER_LENGTH"), //$NON-NLS-1$
    dbTypeGroup);
    objectField = new StringFieldEditor(MetadataTypeLengthConstants.ID_OBJECT, Messages.getString("MetadataTypeLengthConstants.OBJECT_LENGTH"), //$NON-NLS-1$
    dbTypeGroup);
    dateField = new StringFieldEditor(MetadataTypeLengthConstants.ID_DATE, Messages.getString("MetadataTypeLengthConstants.DATE_LENGHT"), //$NON-NLS-1$
    dbTypeGroup);
    shortField = new StringFieldEditor(MetadataTypeLengthConstants.ID_SHORT, Messages.getString("MetadataTypeLengthConstants.SHORT_LENGTH"), //$NON-NLS-1$
    dbTypeGroup);
    doubleField = new StringFieldEditor(MetadataTypeLengthConstants.ID_DOUBLE, Messages.getString("MetadataTypeLengthConstants.DOUBLE_LENGTH"), //$NON-NLS-1$
    dbTypeGroup);
    stringField = new StringFieldEditor(MetadataTypeLengthConstants.ID_STRING, Messages.getString("MetadataTypeLengthConstants.STRING_LENGTH"), //$NON-NLS-1$
    dbTypeGroup);
    floatField = new StringFieldEditor(MetadataTypeLengthConstants.ID_FLOAT, Messages.getString("MetadataTypeLengthConstants.FLOAT_LENGTH"), //$NON-NLS-1$
    dbTypeGroup);
    listField = new StringFieldEditor(MetadataTypeLengthConstants.ID_LIST, Messages.getString("MetadataTypeLengthConstants.LIST_LENGTH"), //$NON-NLS-1$
    dbTypeGroup);
    addField(comboFieldTypeField);
    addField(fieldLengthField);
    gridLayout = (GridLayout) dbTypeGroup.getLayout();
    gridLayout.numColumns = 4;
    dbTypeGroup.setLayout(gridLayout);
    addField(bigDecimalField);
    addField(booleanField);
    addField(byteField);
    addField(integerField);
    addField(bytearrayField);
    addField(longField);
    addField(characterField);
    addField(objectField);
    addField(dateField);
    addField(shortField);
    addField(doubleField);
    addField(stringField);
    addField(floatField);
    addField(listField);
}
Also used : StringFieldEditor(org.eclipse.jface.preference.StringFieldEditor) Group(org.eclipse.swt.widgets.Group) JavaType(org.talend.core.model.metadata.types.JavaType) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) ComboFieldEditor(org.talend.commons.ui.utils.workbench.preferences.ComboFieldEditor)

Example 3 with ComboFieldEditor

use of org.talend.commons.ui.utils.workbench.preferences.ComboFieldEditor in project tdi-studio-se by Talend.

the class MapPreferencePage method createFieldEditors.

/**
     * Create all field editors for this page
     */
public void createFieldEditors() {
    LINK_STYLE[] linkStyles = LINK_STYLE.values();
    String[][] strComboValues = new String[linkStyles.length][2];
    for (int i = 0; i < linkStyles.length; i++) {
        strComboValues[i][0] = linkStyles[i].getDisplayName();
        strComboValues[i][1] = linkStyles[i].getName();
    }
    ComboFieldEditor dbTypeField = new ComboFieldEditor(MapPrefsConstants.LINK_STYLE, Messages.getString("prefs.configuration.LINK_STYLE"), strComboValues, //$NON-NLS-1$
    getFieldEditorParent());
    addField(dbTypeField);
}
Also used : LINK_STYLE(org.talend.designer.abstractmap.ui.properties.LINK_STYLE) ComboFieldEditor(org.talend.commons.ui.utils.workbench.preferences.ComboFieldEditor)

Aggregations

ComboFieldEditor (org.talend.commons.ui.utils.workbench.preferences.ComboFieldEditor)3 StringFieldEditor (org.eclipse.jface.preference.StringFieldEditor)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 Group (org.eclipse.swt.widgets.Group)1 JavaType (org.talend.core.model.metadata.types.JavaType)1 LINK_STYLE (org.talend.designer.abstractmap.ui.properties.LINK_STYLE)1