List of usage examples for org.eclipse.jface.viewers ComboViewer ComboViewer
public ComboViewer(Composite parent, int style)
From source file:com.mobilesorcery.sdk.ui.internal.launch.MoSyncLaunchParamsTab.java
License:Open Source License
private void createConfigurationEditor(Composite control) { configurationGroup = new Group(control, SWT.NONE); configurationGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); configurationGroup.setText("&Configuration"); configurationGroup.setLayout(new GridLayout(1, false)); changeConfiguration = new Button(configurationGroup, SWT.CHECK); changeConfiguration.setText(isDebugMode() ? "&Automatically switch to this configuration before debugging" : "&Automatically switch to this configuration before launching"); changeConfiguration.addSelectionListener(listener); configurations = new ComboViewer(configurationGroup, SWT.READ_ONLY | SWT.BORDER); configurations.getCombo().addSelectionListener(listener); }
From source file:com.mobilesorcery.sdk.ui.internal.properties.BuildSettingsPropertyPage.java
License:Open Source License
protected void fillPlaceHolder(Composite placeHolder) { main = new Composite(placeHolder, SWT.NONE); main.setLayout(new GridLayout(1, false)); Group projectType = new Group(main, SWT.NONE); projectType.setLayout(new GridLayout(2, false)); projectType.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); projectType.setText("Project &Type"); applicationProjectType = new Button(projectType, SWT.RADIO); applicationProjectType.setText("&Application"); libraryProjectType = new Button(projectType, SWT.RADIO); libraryProjectType.setText("&Library"); Group buildStrategy = new Group(main, SWT.NONE); buildStrategy.setLayout(new GridLayout(2, false)); buildStrategy.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); buildStrategy.setText("Incremental Build Strateg&y"); Label incrementalBuildStrategyLabel = new Label(buildStrategy, SWT.NONE); incrementalBuildStrategyLabel.setText("Incremental Build Strategy To Use:"); incrementalBuildStrategy = new Combo(buildStrategy, SWT.READ_ONLY); incrementalBuildStrategy.setItems(INCREMENTAL_BUILD_STRATEGY_OPTIONS); incrementalBuildStrategy.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false)); boolean hasConfigurations = getProject().areBuildConfigurationsSupported(); Group configurationsGroup = null; if (hasConfigurations) { configurationsGroup = new Group(main, SWT.NONE); configurationsGroup.setLayout(new GridLayout(1, false)); configurationsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); configurationsGroup.setText("Build Configuration"); Composite configurationsComposite = new Composite(configurationsGroup, SWT.NONE); configurationsComposite.setLayout(new GridLayout(2, true)); configurationsComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Label configurationsLabel = new Label(configurationsComposite, SWT.NONE); configurationsLabel.setText("Configuratio&n:"); buildConfigurations = new ComboViewer(configurationsComposite, SWT.READ_ONLY); buildConfigurations.setContentProvider(new BuildConfigurationsContentProvider(getProject())); buildConfigurations.setLabelProvider(new BuildConfigurationsLabelProvider(getProject())); buildConfigurations.setInput(getProject()); buildConfigurations.getControl().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); buildConfigurationListener = new BuildConfigurationChangedListener(); buildConfigurations.addSelectionChangedListener(buildConfigurationListener); }/*from www . j a v a 2s . co m*/ Composite configurationParent = hasConfigurations ? configurationsGroup : main; TabFolder tabs = new TabFolder(configurationParent, SWT.NONE); tabs.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); createTabs(tabs); listener = new UpdateListener(this); applicationProjectType.addListener(SWT.Selection, listener); libraryProjectType.addListener(SWT.Selection, listener); applicationProjectType.addListener(SWT.Selection, listener); additionalIncludePathsText.addListener(SWT.Modify, listener); additionalLibrariesText.addListener(SWT.Modify, listener); additionalLibraryPathsText.addListener(SWT.Modify, listener); libOutputPath.addListener(SWT.Modify, listener); appOutputPath.addListener(SWT.Modify, listener); stackSize.addListener(SWT.Modify, listener); heapSize.addListener(SWT.Modify, listener); dataSize.addListener(SWT.Modify, listener); version.addListener(SWT.Modify, listener); appName.addListener(SWT.Modify, listener); changeConfiguration(getProject().getActiveBuildConfiguration()); if (getProject().areBuildConfigurationsSupported()) { IBuildConfiguration cfg = getProject().getActiveBuildConfiguration(); if (cfg != null) { buildConfigurationListener.setActive(false); buildConfigurations.setSelection(new StructuredSelection(cfg.getId())); buildConfigurationListener.setActive(true); } } initUI(); placeHolder.layout(); }
From source file:com.mobilesorcery.sdk.ui.targetphone.internal.EditDeviceListDialog.java
License:Open Source License
@Override public Control createDialogArea(Composite parent) { getShell().setText("Select Preferred Profile"); ITargetPhone initialTargetPhone = this.initialTargetPhone == null ? TargetPhonePlugin.getDefault().getCurrentlySelectedPhone() : this.initialTargetPhone; Composite main = (Composite) super.createDialogArea(parent); Composite contents = new Composite(main, SWT.NONE); contents.setLayout(new GridLayout(1, false)); if (!fixedDevice) { deviceList = new ComboViewer(contents, SWT.BORDER | SWT.READ_ONLY); deviceList.setContentProvider(new ArrayContentProvider()); deviceList.setLabelProvider(new TargetDeviceLabelProvider()); deviceList.addSelectionChangedListener(new ISelectionChangedListener() { @Override//from www .j av a2s.c o m public void selectionChanged(SelectionChangedEvent event) { updateFilter(); updateUI(null, false); } }); deviceList.getCombo().setLayoutData(new GridData(UIUtils.getDefaultFieldSize(), SWT.DEFAULT)); Link clear = new Link(contents, SWT.NONE); clear.setText("<a>Clear History</a>"); clear.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false)); clear.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event event) { clearDeviceList(getShell()); updateUI(null, true); } }); } Label instructions = new Label(contents, SWT.NONE | SWT.WRAP); String instructionMsg = "Click to select new target profile"; instructions.setText(instructionMsg); if (getProfileManagerType() == MoSyncTool.LEGACY_PROFILE_TYPE) { Note note = new Note(contents, SWT.NONE); note.setText( "NOTE:\nThe selected project uses a (legacy) device based profile database.\nThis is why this list looks different than for platform based profile databases."); note.setLayoutData(new GridData(UIUtils.getDefaultFieldSize(), SWT.DEFAULT)); } preferredProfile = new TreeViewer(contents, SWT.SINGLE | SWT.BORDER); ProfileLabelProvider labelProvider = new ProfileLabelProvider(SWT.NONE); labelProvider.setTargetProfileProvider(new ITargetProfileProvider() { @Override public IProfile getTargetProfile() { return getCurrentPreferredProfile(); } }); preferredProfile.setLabelProvider(labelProvider); final ProfileContentProvider contentProvider = new ProfileContentProvider(); preferredProfile.setContentProvider(contentProvider); preferredProfile.getControl() .setLayoutData(new GridData(UIUtils.getDefaultFieldSize(), UIUtils.getDefaultListHeight())); preferredProfile.addDoubleClickListener(new IDoubleClickListener() { @Override public void doubleClick(DoubleClickEvent event) { selectNewProfile(event.getSelection()); okPressed(); } }); preferredProfile.addSelectionChangedListener(new ISelectionChangedListener() { @Override public void selectionChanged(SelectionChangedEvent event) { selectNewProfile(event.getSelection()); } }); updateFilter(); updateUI(initialTargetPhone, true); return contents; }
From source file:com.motorolamobility.studio.android.certmanager.ui.wizards.CreateKeystorePage.java
License:Apache License
/** * @param mainComposite// w w w .j a va2 s . c o m */ private void createKeystoreTypeSection(Composite parent) { Label keystoreTypeLabel = new Label(parent, SWT.NONE); keystoreTypeLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1)); keystoreTypeLabel.setText(CertificateManagerNLS.CreateKeystorePage_KeystoreType); keystoreTypeComboViewer = new ComboViewer(parent, SWT.READ_ONLY); keystoreTypeComboViewer.getCombo().setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false, 1, 1)); keystoreTypeComboViewer.setContentProvider(new IStructuredContentProvider() { @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { //do nothing } @Override public void dispose() { //do nothing } @SuppressWarnings("unchecked") @Override public Object[] getElements(Object inputElement) { return ((List<String>) inputElement).toArray(); } }); keystoreTypeComboViewer.setLabelProvider(new ILabelProvider() { @Override public void removeListener(ILabelProviderListener listener) { //do nothing } @Override public boolean isLabelProperty(Object element, String property) { return false; } @Override public void dispose() { //do nothing } @Override public void addListener(ILabelProviderListener listener) { //do nothing } @Override public String getText(Object element) { return (String) element; } @Override public Image getImage(Object element) { return null; } }); keystoreTypeComboViewer.setInput(KeyStoreManager.getInstance().getAvailableTypes()); keystoreTypeComboViewer.getCombo().addSelectionListener(new SelectionAdapter() { /* (non-Javadoc) * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent) */ @Override public void widgetSelected(SelectionEvent e) { useTypeAsExtensionCheckBox.setEnabled(true); useTypeAsExtensionCheckBox.setSelection(useTypeAsExtensionCheckBoxPreviousState); if (useTypeAsExtensionCheckBox.getSelection()) { setKeystoreFilenameExtension(); } } }); for (int i = 0; i < keystoreTypeComboViewer.getCombo().getItemCount(); i++) { if (keystoreTypeComboViewer.getCombo().getItem(i) .compareToIgnoreCase(KeyStoreManager.getInstance().getDefaultType()) == 0) { keystoreTypeComboViewer.getCombo().select(i); } } keystoreTypeComboViewer.getCombo().addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { if (useTypeAsExtensionCheckBox != null) { useTypeAsExtensionCheckBox.setEnabled(false); useTypeAsExtensionCheckBox.setSelection(false); } } }); //fill the third column with a blank label Label separator2 = new Label(parent, SWT.NONE); separator2.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1)); }
From source file:com.motorolamobility.studio.android.certmanager.ui.wizards.ImportKeystorePage.java
License:Apache License
private void createKeystoreTypeSection(Composite parent) { Label keystoreTypeLabel = new Label(parent, SWT.NONE); keystoreTypeLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1)); keystoreTypeLabel.setText(CertificateManagerNLS.CreateKeystorePage_KeystoreType); keystoreType = new ComboViewer(parent, SWT.READ_ONLY); keystoreType.getCombo().setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false, 1, 1)); keystoreType.setContentProvider(new IStructuredContentProvider() { @Override//w w w .j a v a 2 s .co m public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { //do nothing } @Override public void dispose() { //do nothing } @SuppressWarnings("unchecked") @Override public Object[] getElements(Object inputElement) { return ((List<String>) inputElement).toArray(); } }); keystoreType.setLabelProvider(new ILabelProvider() { @Override public void removeListener(ILabelProviderListener listener) { //do nothing } @Override public boolean isLabelProperty(Object element, String property) { return false; } @Override public void dispose() { //do nothing } @Override public void addListener(ILabelProviderListener listener) { //do nothing } @Override public String getText(Object element) { return (String) element; } @Override public Image getImage(Object element) { return null; } }); keystoreType.setInput(KeyStoreManager.getInstance().getAvailableTypes()); for (int i = 0; i < keystoreType.getCombo().getItemCount(); i++) { if (keystoreType.getCombo().getItem(i) .compareToIgnoreCase(KeyStoreManager.getInstance().getDefaultType()) == 0) { keystoreType.getCombo().select(i); } } keystoreType.getCombo().addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { validatePage(); } }); //fill the third column with a blank label Label separator2 = new Label(parent, SWT.NONE); separator2.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1)); }
From source file:com.mountainminds.eclemma.internal.ui.wizards.SessionExportPage1.java
License:Open Source License
private void createExportOptionsGroup(Composite parent) { parent.setLayout(new GridLayout(3, false)); new Label(parent, SWT.NONE).setText(UIMessages.ExportReportPage1Format_label); formatcombo = new ComboViewer(parent, SWT.READ_ONLY); formatcombo.setContentProvider(new ArrayContentProvider()); formatcombo.setLabelProvider(new LabelProvider() { @Override// ww w. j a v a 2s . com public String getText(Object element) { return ((ExportFormat) element).getLabel(); } }); formatcombo.setInput(ExportFormat.values()); formatcombo.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { IPath path = Path.fromOSString(destinationcombo.getText()); path = path.removeFileExtension(); final ExportFormat format = getExportFormat(); if (!format.isFolderOutput()) { path = path.addFileExtension(format.getFileExtension()); } destinationcombo.setText(path.toOSString()); } }); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; formatcombo.getControl().setLayoutData(gd); new Label(parent, SWT.NONE).setText(UIMessages.ExportReportPage1Destination_label); destinationcombo = new Combo(parent, SWT.BORDER); destinationcombo.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { update(); } }); gd = new GridData(GridData.FILL_HORIZONTAL); gd.widthHint = convertHorizontalDLUsToPixels(120); destinationcombo.setLayoutData(gd); Button browsebutton = new Button(parent, SWT.NONE); browsebutton.setText(UIMessages.BrowseAction_label); setButtonLayoutData(browsebutton); browsebutton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { if (getExportFormat().isFolderOutput()) { openFolderDialog(); } else { openFileDialog(); } } }); update(); }
From source file:com.myeclipsedev.gdt.eclipse.ui.internal.wizard.WebComponentExportPage.java
License:Open Source License
private void createLogLevelControl(Composite parent) { new Label(parent, SWT.None).setText("Log level:"); logLevelComboViewer = new ComboViewer(parent, SWT.READ_ONLY); logLevelComboViewer.setContentProvider(new ArrayContentProvider()); logLevelComboViewer.setLabelProvider(new DefaultComboLabelProvider()); logLevelComboViewer.setInput(GWTLaunchAttributes.LOG_LEVELS); }
From source file:com.myeclipsedev.gdt.eclipse.ui.internal.wizard.WebComponentExportPage.java
License:Open Source License
private void createOutputStyleControl(Composite parent) { new Label(parent, SWT.None).setText("Output style:"); outputStyleComboViewer = new ComboViewer(parent, SWT.READ_ONLY); outputStyleComboViewer.setContentProvider(new ArrayContentProvider()); outputStyleComboViewer.setLabelProvider(new DefaultComboLabelProvider()); outputStyleComboViewer.setInput(GWTLaunchAttributes.OUTPUT_STYLES); }
From source file:com.netxforge.netxstudio.callflow.screens.protocols.NewEditProtocol.java
License:Open Source License
private void buildUI() { setLayout(new FillLayout(SWT.HORIZONTAL)); // Readonlyness. boolean readonly = ScreenUtil.isReadOnlyOperation(this.getOperation()); int widgetStyle = readonly ? SWT.READ_ONLY : SWT.NONE; frmNewProtocol = toolkit.createForm(this); frmNewProtocol.setSeparatorVisible(true); toolkit.paintBordersFor(frmNewProtocol); frmNewProtocol.setText(this.getOperationText() + "Protocol"); ColumnLayout cl = new ColumnLayout(); cl.maxNumColumns = 1;/* www .j a v a 2s .co m*/ frmNewProtocol.getBody().setLayout(cl); Section sctnMappings = toolkit.createSection(frmNewProtocol.getBody(), Section.EXPANDED | Section.TITLE_BAR); toolkit.paintBordersFor(sctnMappings); sctnMappings.setText("Info"); Composite composite_1 = toolkit.createComposite(sctnMappings, SWT.NONE); toolkit.paintBordersFor(composite_1); sctnMappings.setClient(composite_1); composite_1.setLayout(new GridLayout(4, false)); Label lblName = toolkit.createLabel(composite_1, "Name:", SWT.NONE); lblName.setAlignment(SWT.RIGHT); GridData gd_lblName = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1); gd_lblName.widthHint = 70; lblName.setLayoutData(gd_lblName); txtName = toolkit.createText(composite_1, "New Text", widgetStyle); txtName.setText(""); GridData gd_txtName = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); gd_txtName.widthHint = 150; txtName.setLayoutData(gd_txtName); new Label(composite_1, SWT.NONE); new Label(composite_1, SWT.NONE); Label lblDescription = toolkit.createLabel(composite_1, "Description:", SWT.NONE); lblDescription.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); lblDescription.setAlignment(SWT.RIGHT); txtDescription = toolkit.createText(composite_1, "New Text", SWT.WRAP | SWT.MULTI | widgetStyle); txtDescription.setText(""); GridData gd_txtNewText = new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1); gd_txtNewText.heightHint = 89; txtDescription.setLayoutData(gd_txtNewText); Section sctnProtocol = toolkit.createSection(frmNewProtocol.getBody(), Section.TWISTIE | Section.TITLE_BAR); toolkit.paintBordersFor(sctnProtocol); sctnProtocol.setText("Details"); sctnProtocol.setExpanded(true); Composite composite = toolkit.createComposite(sctnProtocol, SWT.NONE); toolkit.paintBordersFor(composite); sctnProtocol.setClient(composite); composite.setLayout(new GridLayout(2, false)); Label lblOSI = toolkit.createLabel(composite, "OSI:", SWT.NONE); GridData gd_lblOSI = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1); gd_lblOSI.widthHint = 70; lblOSI.setLayoutData(gd_lblOSI); lblOSI.setAlignment(SWT.RIGHT); cmbLevelViewer = new ComboViewer(composite, widgetStyle); Combo cmbOSI = cmbLevelViewer.getCombo(); GridData gd_cmbOSI = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1); gd_cmbOSI.widthHint = 200; cmbOSI.setLayoutData(gd_cmbOSI); toolkit.paintBordersFor(cmbOSI); if (readonly) { cmbOSI.setEnabled(false); } Label lblSpecification = toolkit.createLabel(composite, "Specification:", SWT.NONE); lblSpecification.setAlignment(SWT.RIGHT); txtSpecification = toolkit.createText(composite, "New Text", widgetStyle); txtSpecification.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); txtSpecification.setText(""); }
From source file:com.netxforge.netxstudio.screens.f2.details.NewEditEquipment.java
License:Open Source License
private void buildInfoSection() { Section scnInfo = toolkit.createSection(this, Section.EXPANDED | Section.TITLE_BAR); toolkit.paintBordersFor(scnInfo);/* w ww. ja va2s . c o m*/ scnInfo.setText("Info"); Composite composite = toolkit.createComposite(scnInfo, SWT.NONE); toolkit.paintBordersFor(composite); scnInfo.setClient(composite); composite.setLayout(new GridLayout(2, false)); Label lblCode = toolkit.createLabel(composite, "Code:", SWT.NONE); lblCode.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); txtCode = toolkit.createText(composite, "New Text", SWT.NONE | widgetStyle); txtCode.setText(""); txtCode.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1)); Label lblDescription = toolkit.createLabel(composite, "Description:", SWT.NONE); lblDescription.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false, 1, 1)); lblDescription.setAlignment(SWT.RIGHT); txtDescription = toolkit.createText(composite, "New Text", SWT.BORDER | SWT.WRAP | SWT.MULTI | widgetStyle); txtDescription.setText(""); GridData gd_text = new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1); gd_text.heightHint = 62; gd_text.widthHint = 200; txtDescription.setLayoutData(gd_text); Label lblExpansion = toolkit.createLabel(composite, "Expansion:", SWT.NONE); lblExpansion.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); cmbViewerExpansionDuration = new ComboViewer(composite, widgetStyle); Combo cmbExpansionDuration = cmbViewerExpansionDuration.getCombo(); cmbExpansionDuration.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1)); toolkit.paintBordersFor(cmbExpansionDuration); if (readOnly) { cmbExpansionDuration.setEnabled(false); } }