Example usage for org.eclipse.jface.viewers ComboViewer ComboViewer

List of usage examples for org.eclipse.jface.viewers ComboViewer ComboViewer

Introduction

In this page you can find the example usage for org.eclipse.jface.viewers ComboViewer ComboViewer.

Prototype

public ComboViewer(Composite parent, int style) 

Source Link

Document

Creates a combo viewer on a newly-created combo control under the given parent.

Usage

From source file:com.amalto.workbench.detailtabs.sections.composites.ComplexTypeConfigComposite.java

License:Open Source License

public ComplexTypeConfigComposite(Composite parent, int style) {
    super(parent, style);
    final GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 2;//from w  w w  .j  a va 2 s .  c  om
    setLayout(gridLayout);

    final Label lblName = new Label(this, SWT.NONE);
    lblName.setText(Messages.ComplexTypeConfigComposite_Name);

    txtName = new Text(this, SWT.BORDER);
    txtName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    final Label extensionLabel = new Label(this, SWT.NONE);
    extensionLabel.setText(Messages.ComplexTypeConfigComposite_Extends);

    comboExtends = new ComboViewer(this, SWT.READ_ONLY);
    comboExtends.setContentProvider(new ListContentProvider());
    comboExtends.setLabelProvider(new XSDNamedComponentLabelProvider());
    comboExtends.setSorter(new SchemaElementSorter());
    Combo combo = comboExtends.getCombo();
    combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    final Group gpGroup = new Group(this, SWT.NONE);
    gpGroup.setText(Messages.ComplexTypeConfigComposite_SubElementsGroup);
    gpGroup.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
    gpGroup.setLayout(new GridLayout());

    radGroupAll = new Button(gpGroup, SWT.RADIO);
    radGroupAll.setSelection(true);
    radGroupAll.setText("All");//$NON-NLS-1$

    radGroupSequence = new Button(gpGroup, SWT.RADIO);
    radGroupSequence.setText("Sequence");//$NON-NLS-1$

    radGroupChoice = new Button(gpGroup, SWT.RADIO);
    radGroupChoice.setText("Choice");//$NON-NLS-1$

    abstractBun = new Button(this, SWT.CHECK);
    abstractBun.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
    abstractBun.setText(Messages.ComplexTypeConfigComposite_btnCheckButton_text);

    initUIListener();
}

From source file:com.amalto.workbench.detailtabs.sections.composites.SimpleTypeConfigComposite.java

License:Open Source License

public SimpleTypeConfigComposite(Composite parent, int style, BasePropertySection section) {
    super(parent, style);
    this.section = section;

    final GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 2;/*from w  w  w  .j a  va 2s  .  c  om*/
    setLayout(gridLayout);

    final Label lblName = new Label(this, SWT.NONE);
    lblName.setText(Messages.SimpleTypeConfigComposite_Name);

    txtName = new Text(this, SWT.BORDER);
    final GridData gd_txtName = new GridData(SWT.FILL, SWT.CENTER, true, false);
    txtName.setLayoutData(gd_txtName);

    final Group baseTypeGroup = new Group(this, SWT.NONE);
    baseTypeGroup.setText(Messages.SimpleTypeConfigComposite_BaseType);
    final GridData gd_baseTypeGroup = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
    baseTypeGroup.setLayoutData(gd_baseTypeGroup);
    baseTypeGroup.setLayout(new GridLayout());

    final Composite composite = new Composite(baseTypeGroup, SWT.NONE);
    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    final GridLayout gridLayout_1 = new GridLayout();
    gridLayout_1.numColumns = 2;
    composite.setLayout(gridLayout_1);

    radCustomTypes = new Button(composite, SWT.RADIO);
    radCustomTypes.setSelection(true);
    radCustomTypes.setText(Messages.SimpleTypeConfigComposite_CustomTypes);

    comboCustomTypes = new ComboViewer(composite, SWT.READ_ONLY);
    final GridData gd_comboCustomTypes = new GridData(SWT.FILL, SWT.CENTER, true, false);
    comboCustomTypes.getCombo().setLayoutData(gd_comboCustomTypes);
    comboCustomTypes.setContentProvider(new ListContentProvider());
    comboCustomTypes.setLabelProvider(new ListStringLabelProvider());
    comboCustomTypes.setSorter(new CustomTypeSorter());

    radBuildInTypes = new Button(composite, SWT.RADIO);
    radBuildInTypes.setText(Messages.SimpleTypeConfigComposite_BuildinTypes);

    comboBuildInTypes = new ComboViewer(composite, SWT.READ_ONLY);
    Combo combo = comboBuildInTypes.getCombo();
    combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    comboBuildInTypes.setContentProvider(new ListContentProvider());
    comboBuildInTypes.setLabelProvider(new XSDNamedComponentLabelProvider());
    comboBuildInTypes.setSorter(new SchemaElementSorter());

    compProperty = new PropertyComposite(this, SWT.NONE, "", "", Messages.SimpleTypeConfigComposite_Facet, //$NON-NLS-1$//$NON-NLS-2$
            Messages.SimpleTypeConfigComposite_Value, section);
    GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
    data.horizontalSpan = 2;
    data.heightHint = 200;
    compProperty.setLayoutData(data);

    initUIListeners();
}

From source file:com.amalto.workbench.editors.DataClusterDialog.java

License:Open Source License

private Composite createFirstLine(Composite parent) {
    Composite firstLine = new Composite(parent, SWT.NONE);
    firstLine.setLayout(new GridLayout(4, false));

    Label serverLabel = new Label(firstLine, SWT.NONE);
    serverLabel.setText(Messages.DataClusterDialog_1);
    serverLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));

    serverComboViewer = new ComboViewer(firstLine, SWT.DROP_DOWN | SWT.READ_ONLY);
    Combo combo = serverComboViewer.getCombo();
    GridData data = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
    data.widthHint = 200;//  ww w .j  a va 2s. co  m
    combo.setLayoutData(data);
    serverComboViewer.setLabelProvider(new LabelProvider() {

        @Override
        public String getText(Object element) {
            MDMServerDef serverDef = (MDMServerDef) element;
            return serverDef.getName() + " (" + serverDef.getHost() + ")"; //$NON-NLS-1$ //$NON-NLS-2$;
        }
    });
    serverComboViewer.setContentProvider(new ArrayContentProvider());

    serverComboViewer.setInput(getAllServerDefs());

    Label containerLabel = new Label(firstLine, SWT.NONE);
    containerLabel.setText(Messages.DataClusterDialog_2);
    containerLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));

    containerComboViewer = new ComboViewer(firstLine, SWT.DROP_DOWN | SWT.READ_ONLY);
    Combo containerCombo = containerComboViewer.getCombo();
    GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
    layoutData.widthHint = 200;
    containerCombo.setLayoutData(layoutData);
    containerComboViewer.setLabelProvider(new LabelProvider() {

        @Override
        public String getText(Object element) {
            TreeObject treeObj = (TreeObject) element;

            return treeObj.getName();
        }
    });

    containerComboViewer.setContentProvider(new ArrayContentProvider());
    containerComboViewer.setInput(new TreeObject[0]);
    containerComboViewer.getCombo().setEnabled(false);

    return firstLine;
}

From source file:com.amalto.workbench.widgets.composites.ComboListStringContentComposite.java

License:Open Source License

@Override
protected void createCandidateInfoUIArea(Composite parent) {

    comboInfos = new ComboViewer(this, SWT.DROP_DOWN);
    comboInfos.getControl().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    comboInfos.setContentProvider(new ListContentProvider());
    comboInfos.setLabelProvider(new ListStringLabelProvider());
    comboInfos.setSorter(new StringViewerSorter());

}

From source file:com.amalto.workbench.widgets.composites.XpathComposite.java

License:Open Source License

@Override
protected void createCandidateInfoUIArea(Composite parent) {
    Composite compSimpleXPath = new Composite(this, SWT.NONE);
    compSimpleXPath.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    compSimpleXPath.setLayout(new GridLayout(2, false));
    comboInfos = new ComboViewer(compSimpleXPath, SWT.DROP_DOWN);
    comboInfos.getControl().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    comboInfos.setContentProvider(new ListContentProvider());
    comboInfos.setLabelProvider(new ListStringLabelProvider());
    comboInfos.setSorter(new StringViewerSorter());
    comboInfos.getCombo().addMouseListener(new MouseAdapter() {

        @Override//  w ww.j ava2s.  c o  m
        public void mouseDown(MouseEvent e) {
            comboInfos.setInput(getItems());
        }
    });
    GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false)
            .applyTo(comboInfos.getControl());
    Button btnSelectXPath = new Button(compSimpleXPath, SWT.NONE);
    btnSelectXPath.setImage(ImageCache.getCreatedImage(EImage.DOTS_BUTTON.getPath()));
    btnSelectXPath.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            SelectXPathDialog dialog = new SelectXPathDialog(
                    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), getDataholder(),
                    getDatamodel(), getConcept(), null);
            if (dialog.open() != Window.OK) {
                return;
            }
            String xpath = dialog.getSelectedXPath();
            if (null != xpath) {
                XpathComposite.this.addInfoToInfoTree(xpath);
            }
        }
    });
    btnSelectXPath.setToolTipText(Messages.SchematronExpressBuilder_selectXPath);
}

From source file:com.amazonaws.eclipse.core.ui.preferences.AwsAccountPreferencePageTab.java

License:Apache License

/**
 * Creates the account selection section.
 *///from  w  w w . j a va  2  s  .c o  m
private Composite createAccountSelector(final Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
    composite.setLayout(new GridLayout(4, false));

    new Label(composite, SWT.READ_ONLY).setText("Default Profile: ");

    accountSelector = new ComboViewer(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
    accountSelector.getCombo().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    // Use a List of AccountInfo objects as the data input for the combo
    // viewer
    accountSelector.setContentProvider(ArrayContentProvider.getInstance());
    accountSelector.setLabelProvider(new LabelProvider() {
        @Override
        public String getText(Object element) {
            if (element instanceof AccountInfo) {
                AccountInfo account = (AccountInfo) element;
                if (account.isDirty()) {
                    return "*" + account.getAccountName();
                } else {
                    return account.getAccountName();
                }
            }
            return super.getText(element);
        }
    });

    AccountInfo currentRegionAccount = accountInfoByIdentifier.get(currentRegionAccountId);
    // In some of the edge-cases, currentRegionAccount could be null.
    // e.g. a specific credential profile account is removed externally, but
    // the data in the preference store is not yet updated.
    if (currentRegionAccount == null) {
        currentRegionAccount = accountInfoByIdentifier.values().iterator().next();
        currentRegionAccountId = currentRegionAccount.getInternalAccountId();
    }

    final List<AccountInfo> allAccounts = new LinkedList<AccountInfo>(accountInfoByIdentifier.values());

    setUpAccountSelectorItems(allAccounts, currentRegionAccount);

    // Add selection listener to the account selector, so that all the
    // account info editors are notified of the newly selected AccountInfo
    // object.
    accountSelector.addSelectionChangedListener(new ISelectionChangedListener() {

        public void selectionChanged(SelectionChangedEvent event) {
            IStructuredSelection selection = (IStructuredSelection) event.getSelection();
            Object selectedObject = selection.getFirstElement();

            if (selectedObject instanceof AccountInfo) {
                AccountInfo accountInfo = (AccountInfo) selectedObject;
                accountChanged(accountInfo);
            }
        }

    });

    final Button addNewAccount = new Button(composite, SWT.PUSH);
    addNewAccount.setText("Add profile");
    deleteAccount = new Button(composite, SWT.PUSH);
    deleteAccount.setText("Remove profile");
    deleteAccount.setEnabled(allAccounts.size() > 1);

    defaultAccountExplanationLabel = new Label(composite, SWT.WRAP);
    defaultAccountExplanationLabel.setText(getDefaultAccountExplanationText());

    parentPrefPage.setItalicFont(defaultAccountExplanationLabel);

    GridData layoutData = new GridData(SWT.FILL, SWT.TOP, true, false);
    layoutData.horizontalSpan = 4;
    layoutData.widthHint = 200;
    defaultAccountExplanationLabel.setLayoutData(layoutData);

    addNewAccount.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            String newAccountId = UUID.randomUUID().toString();
            AccountInfo newAccountInfo = createNewProfileAccountInfo(newAccountId);

            String newAccountName = region == null ? "New Profile" : "New " + region.getName() + " Profile";
            newAccountInfo.setAccountName(newAccountName); // this will mark the AccountInfo object dirty

            accountInfoByIdentifier.put(newAccountId, newAccountInfo);

            setUpAccountSelectorItems(accountInfoByIdentifier.values(), newAccountInfo);

            for (AwsAccountPreferencePageTab tab : parentPrefPage.getAllAccountPreferencePageTabs()) {
                if (tab != AwsAccountPreferencePageTab.this) {
                    tab.refreshAccountSelectorItems();
                }
            }

            parentPrefPage.updatePageValidationOfAllTabs();
        }
    });

    deleteAccount.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            accountInfoToBeDeleted.add(accountInfoByIdentifier.get(currentRegionAccountId));
            accountInfoByIdentifier.remove(currentRegionAccountId);

            // If all the accounts are deleted, create a temporary
            // AccountInfo object
            if (accountInfoByIdentifier.isEmpty()) {
                String newAccountId = UUID.randomUUID().toString();
                AccountInfo newAccountInfo = createNewProfileAccountInfo(newAccountId);

                // Account name : default-region-id
                newAccountInfo.setAccountName(getRegionAccountDefaultName());
                accountInfoByIdentifier.put(newAccountId, newAccountInfo);
            }

            // Use the first AccountInfo as the next selected account
            AccountInfo nextDefaultAccount = accountInfoByIdentifier.values().iterator().next();

            setUpAccountSelectorItems(accountInfoByIdentifier.values(), nextDefaultAccount);

            for (AwsAccountPreferencePageTab tab : parentPrefPage.getAllAccountPreferencePageTabs()) {
                if (tab != AwsAccountPreferencePageTab.this) {
                    tab.refreshAccountSelectorItems();
                }
            }

            parentPrefPage.updatePageValidationOfAllTabs();
        }
    });

    accountSelector.getCombo().addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent arg0) {
            if (accountSelector.getCombo().getItemCount() > 1) {
                deleteAccount.setEnabled(true);
            } else {
                deleteAccount.setEnabled(false);
            }

        }
    });

    return composite;
}

From source file:com.amitinside.e4.rcp.todo.parts.TodoDeletionPart.java

License:Apache License

@PostConstruct
public void createControls(Composite parent) {
    parent.setLayout(new GridLayout(2, false));
    viewer = new ComboViewer(parent, SWT.READ_ONLY);
    viewer.setLabelProvider(new LabelProvider() {
        @Override//from   ww w . ja  va  2s.c  o  m
        public String getText(Object element) {
            Todo todo = (Todo) element;
            return todo.getSummary();
        }
    });
    viewer.setContentProvider(ArrayContentProvider.getInstance());

    List<Todo> todos = model.getTodos();
    updateViewer(todos);

    Button button = new Button(parent, SWT.PUSH);
    button.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            ISelection selection = viewer.getSelection();
            IStructuredSelection sel = (IStructuredSelection) selection;
            if (sel.size() > 0) {
                selectionService.setSelection(sel.getFirstElement());
                // assure that "com.example.e4.rcp.todo.remove" is the ID
                // of the command which deletes todos in your application model
                ParameterizedCommand cmd = commandService.createCommand("com.example.e4.rcp.todo.remove", null);
                handlerService.executeHandler(cmd, ctx);
            }

        }
    });
    button.setText(messages.TodoDeletionPart_0);
}

From source file:com.apicloud.makepackage.ui.PackageAppItemDialog.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    Composite comp = (Composite) super.createDialogArea(parent);
    comp.setLayout(new GridLayout(1, false));

    Composite composite = new Composite(comp, SWT.NONE);
    composite.setLayout(new GridLayout(1, false));
    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    formToolkit.adapt(composite);//from   w  ww  .  java2 s .  c  o  m
    formToolkit.paintBordersFor(composite);

    Composite composite_1 = new Composite(composite, SWT.NONE);
    composite_1.setLayout(new GridLayout(1, false));
    composite_1.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, false, 1, 1));
    formToolkit.adapt(composite_1);
    formToolkit.paintBordersFor(composite_1);

    Composite composite_6 = new Composite(composite_1, SWT.NONE);
    composite_6.setLayout(new GridLayout(2, false));
    composite_6.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
    composite_6.setBounds(0, 0, 64, 64);
    formToolkit.adapt(composite_6);
    formToolkit.paintBordersFor(composite_6);

    Label lblNewLabel_project = new Label(composite_6, SWT.NONE);
    lblNewLabel_project.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    formToolkit.adapt(lblNewLabel_project, true, true);
    lblNewLabel_project.setText(Messages.PackageAppItemDialog_PROJECT_NAME);

    this.list = new ComboViewer(composite_6, SWT.NONE);
    GridData gd_text1 = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_text1.widthHint = 181;
    this.list.getCombo().setLayoutData(gd_text1);
    this.list.setLabelProvider(new ProjectLabelProvider());
    this.list.setContentProvider(new ArrayContentProvider());
    this.list.setInput(projects);
    this.list.getCombo().select(0);
    this.list.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            StructuredSelection ss = (StructuredSelection) list.getSelection();
            IProject p = (IProject) ss.getFirstElement();
            selectProject(p);
        }

    });
    formToolkit.adapt(list.getCombo(), true, true);
    Composite composite_7 = new Composite(composite, SWT.NONE);
    composite_7.setLayout(null);
    GridData gd_composite_7 = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
    gd_composite_7.heightHint = 28;
    composite_7.setLayoutData(gd_composite_7);
    formToolkit.adapt(composite_7);
    formToolkit.paintBordersFor(composite_7);

    Label lblNewLabel_15 = new Label(composite_7, SWT.NONE);
    lblNewLabel_15.setBounds(38, 8, 57, 17);
    formToolkit.adapt(lblNewLabel_15, true, true);
    lblNewLabel_15.setText(Messages.PackageAppItemDialog_PLATMFROM);

    button_iphone = new Button(composite_7, SWT.CHECK);
    button_iphone.setBounds(96, 8, 106, 17);
    button_iphone.setSelection(true);
    button_iphone.setText("IOS                ");
    formToolkit.adapt(button_iphone, true, true);

    button_android = new Button(composite_7, SWT.CHECK);
    button_android.setBounds(212, 8, 106, 17);
    button_android.setSelection(true);
    button_android.setText("Android");
    formToolkit.adapt(button_android, true, true);

    Group grpIde = new Group(composite, SWT.NONE);
    grpIde.setText(Messages.PackageAppItemDialog_PACKAGE_TITLE);
    grpIde.setLayout(new GridLayout(1, false));
    grpIde.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
    formToolkit.adapt(grpIde);
    formToolkit.paintBordersFor(grpIde);

    Label lblNewLabel = new Label(grpIde, SWT.NONE);
    formToolkit.adapt(lblNewLabel, true, true);
    lblNewLabel.setText(Messages.PackageAppItemDialog_MESSAGE_ONE);

    Label lblNewLabel_1 = new Label(grpIde, SWT.NONE);
    formToolkit.adapt(lblNewLabel_1, true, true);
    lblNewLabel_1.setText(Messages.PackageAppItemDialog_MESSAGE_TWO);

    Label lblNewLabel_2 = new Label(grpIde, SWT.NONE);
    formToolkit.adapt(lblNewLabel_2, true, true);
    lblNewLabel_2.setText(Messages.PackageAppItemDialog_MESSAGE_THREE);

    Label lblNewLabel_ = new Label(grpIde, SWT.NONE);
    formToolkit.adapt(lblNewLabel_, true, true);
    lblNewLabel_.setText(Messages.PackageAppItemDialog_MESSAGE_FOUR);

    Link link = new Link(grpIde, SWT.NONE);
    formToolkit.adapt(link, true, true);
    link.setText(Messages.PackageAppItemDialog_MESSAGE_FIVE);
    Label l = new Label(composite, SWT.NONE);
    formToolkit.adapt(l, true, true);
    l.setText("");
    l = new Label(composite, SWT.NONE);
    formToolkit.adapt(l, true, true);
    l.setText("");
    l = new Label(composite, SWT.NONE);
    formToolkit.adapt(l, true, true);
    l.setText("");
    return parent;
}

From source file:com.apicloud.navigator.dialogs.CreateParamDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    setMessage(Messages.CreateParamDialog_INPUT_PARAM_NAME);
    Composite com = new Composite(parent, SWT.NONE);
    com.setLayout(new GridLayout(2, false));
    com.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Label featureLabel = new Label(com, SWT.NONE);
    featureLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    featureLabel.setText("feature"); //$NON-NLS-1$
    this.list = new ComboViewer(com, SWT.NONE);
    this.list.setLabelProvider(new LabelProvider());
    this.list.setContentProvider(new ArrayContentProvider());
    this.list.setInput(config.getFeatures());
    this.list.getCombo().select(0);

    Label paramNameLabel = new Label(com, SWT.NONE);
    paramNameLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    paramNameLabel.setText(Messages.CreateParamDialog_NAME);

    this.paramNameText = new Text(com, SWT.BORDER);
    this.paramNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

    Label paramValueLabel = new Label(com, SWT.NONE);
    paramValueLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    paramValueLabel.setText(Messages.CreateParamDialog_VALUE);

    this.paramValueText = new Text(com, SWT.BORDER);
    this.paramValueText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

    return parent;
}

From source file:com.apicloud.navigator.dialogs.CustomerLoaderDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Composite comp = (Composite) super.createDialogArea(parent);
    comp.setLayout(new GridLayout(1, false));

    Composite composite = new Composite(comp, SWT.NONE);
    composite.setLayout(new GridLayout(1, false));
    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    formToolkit.adapt(composite);//  w ww . j av  a 2s  .  co  m
    formToolkit.paintBordersFor(composite);

    Composite composite_1 = new Composite(composite, SWT.NONE);
    composite_1.setLayout(new GridLayout(1, false));
    composite_1.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, false, 1, 1));
    formToolkit.adapt(composite_1);
    formToolkit.paintBordersFor(composite_1);

    Composite composite_6 = new Composite(composite_1, SWT.NONE);
    composite_6.setLayout(new GridLayout(2, false));
    composite_6.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
    composite_6.setBounds(0, 0, 64, 64);
    formToolkit.adapt(composite_6);
    formToolkit.paintBordersFor(composite_6);

    Label lblNewLabel_project = new Label(composite_6, SWT.NONE);
    lblNewLabel_project.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    formToolkit.adapt(lblNewLabel_project, true, true);
    lblNewLabel_project.setText(Messages.RunSimulatorDialog_PROJECT_NAME);

    this.list = new ComboViewer(composite_6, SWT.READ_ONLY);
    GridData gd_text1 = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_text1.widthHint = 181;
    this.list.getCombo().setLayoutData(gd_text1);
    this.list.setLabelProvider(new ProjectLabelProvider());
    this.list.setContentProvider(new ArrayContentProvider());
    this.list.setInput(projects);
    this.list.getCombo().select(0);
    formToolkit.adapt(list.getCombo(), true, true);

    return parent;
}