Java Code Examples for org.eclipse.nebula.widgets.tablecombo.TableCombo#setShowFontWithinSelection()
The following examples show how to use
org.eclipse.nebula.widgets.tablecombo.TableCombo#setShowFontWithinSelection() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TableComboExampleTab.java From nebula with Eclipse Public License 2.0 | 5 votes |
/** * {@inheritDoc} */ public Control createControl(Composite parent) { // set the style. int style = SWT.BORDER | SWT.READ_ONLY; if ( borderStyle.getSelection() ) { style |= SWT.BORDER; } if ( readOnlyStyle.getSelection() ) { style |= SWT.READ_ONLY; } if ( flatStyle.getSelection() ) { style |= SWT.FLAT; } // create table combo instance. tableCombo = new TableCombo(parent, style); // set options. tableCombo.setShowTableLines(showGrid.getSelection()); tableCombo.setShowTableHeader(showHeader.getSelection()); tableCombo.setDisplayColumnIndex(columnIndexToDisplayWhenSelected.getSelection() - 1); tableCombo.setShowImageWithinSelection(showImageInSelection.getSelection()); tableCombo.setShowColorWithinSelection(showCustomFontInSelection.getSelection()); tableCombo.setShowFontWithinSelection(showCustomFontInSelection.getSelection()); tableCombo.setClosePopupAfterSelection(closePopupAfterSelection.getSelection()); tableCombo.setTableWidthPercentage(tableWidthPct.getSelection()); tableCombo.setVisibleItemCount(numOfRowsDisplayed.getSelection()); // load the model and data. loadData(loadModel(), tableCombo); return tableCombo; }
Example 2
Source File: QAInstalPage.java From translationstudio8 with GNU General Public License v2.0 | 5 votes |
private void createTableCombo(TableComboViewer tCmbViewer){ TableCombo tableCombo = tCmbViewer.getTableCombo(); tableCombo.setShowTableLines(false); tableCombo.setShowTableHeader(false); tableCombo.setDisplayColumnIndex(-1); tableCombo.setShowImageWithinSelection(true); tableCombo.setShowColorWithinSelection(false); tableCombo.setShowFontWithinSelection(false); tableCombo.setVisibleItemCount(2); GridDataFactory.swtDefaults().hint(100, SWT.DEFAULT).applyTo(tableCombo); tCmbViewer.setLabelProvider(new QATipsLabelProvider()); tCmbViewer.setContentProvider(new ArrayContentProvider()); tCmbViewer.setInput(CONSTANT_COMBOVALUE); }
Example 3
Source File: ProjectSettingLanguagePage.java From translationstudio8 with GNU General Public License v2.0 | 5 votes |
/** * Create contents of the preference page. * @param parent */ @Override public Control createContents(Composite parent) { Composite container = new Composite(parent, SWT.NULL); container.setLayout(new GridLayout(1, false)); // source language control Group sourceLanguageGrp = new Group(container, SWT.NONE); sourceLanguageGrp.setLayout(new GridLayout(1, false)); sourceLanguageGrp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); sourceLanguageGrp.setText(Messages.getString("projectsetting.ProjectSettingLanguagePage.sourceLanguageGrp")); srcLangComboViewer = new TableComboViewer(sourceLanguageGrp, SWT.READ_ONLY | SWT.BORDER); TableCombo tableCombo = srcLangComboViewer.getTableCombo(); // set options. tableCombo.setShowTableLines(false); tableCombo.setShowTableHeader(false); tableCombo.setDisplayColumnIndex(-1); tableCombo.setShowImageWithinSelection(true); tableCombo.setShowColorWithinSelection(false); tableCombo.setShowFontWithinSelection(false); tableCombo.setVisibleItemCount(20); srcLangComboViewer.getTableCombo().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); srcLangComboViewer.setLabelProvider(new LanguageLabelProvider()); srcLangComboViewer.setContentProvider(new ArrayContentProvider()); srcLangComboViewer.setInput(languages); srcLangComboViewer.setComparer(elementComparer); initDataBindings(); // end source language // target language control Group targetLanguageGrp = new Group(container, SWT.NONE); targetLanguageGrp.setLayout(new GridLayout(3, false)); targetLanguageGrp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1)); targetLanguageGrp.setText(Messages.getString("projectsetting.ProjectSettingLanguagePage.targetLanguageGrp")); targetLangControl.createControl(targetLanguageGrp); parent.computeSize(SWT.DEFAULT, SWT.DEFAULT); return container; }
Example 4
Source File: QAInstalPage.java From tmxeditor8 with GNU General Public License v2.0 | 5 votes |
private void createTableCombo(TableComboViewer tCmbViewer){ TableCombo tableCombo = tCmbViewer.getTableCombo(); tableCombo.setShowTableLines(false); tableCombo.setShowTableHeader(false); tableCombo.setDisplayColumnIndex(-1); tableCombo.setShowImageWithinSelection(true); tableCombo.setShowColorWithinSelection(false); tableCombo.setShowFontWithinSelection(false); tableCombo.setVisibleItemCount(2); GridDataFactory.swtDefaults().hint(100, SWT.DEFAULT).applyTo(tableCombo); tCmbViewer.setLabelProvider(new QATipsLabelProvider()); tCmbViewer.setContentProvider(new ArrayContentProvider()); tCmbViewer.setInput(CONSTANT_COMBOVALUE); }
Example 5
Source File: ProjectSettingLanguagePage.java From tmxeditor8 with GNU General Public License v2.0 | 5 votes |
/** * Create contents of the preference page. * @param parent */ @Override public Control createContents(Composite parent) { Composite container = new Composite(parent, SWT.NULL); container.setLayout(new GridLayout(1, false)); // source language control Group sourceLanguageGrp = new Group(container, SWT.NONE); sourceLanguageGrp.setLayout(new GridLayout(1, false)); sourceLanguageGrp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); sourceLanguageGrp.setText(Messages.getString("projectsetting.ProjectSettingLanguagePage.sourceLanguageGrp")); srcLangComboViewer = new TableComboViewer(sourceLanguageGrp, SWT.READ_ONLY | SWT.BORDER); TableCombo tableCombo = srcLangComboViewer.getTableCombo(); // set options. tableCombo.setShowTableLines(false); tableCombo.setShowTableHeader(false); tableCombo.setDisplayColumnIndex(-1); tableCombo.setShowImageWithinSelection(true); tableCombo.setShowColorWithinSelection(false); tableCombo.setShowFontWithinSelection(false); tableCombo.setVisibleItemCount(20); srcLangComboViewer.getTableCombo().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); srcLangComboViewer.setLabelProvider(new LanguageLabelProvider()); srcLangComboViewer.setContentProvider(new ArrayContentProvider()); srcLangComboViewer.setInput(languages); srcLangComboViewer.setComparer(elementComparer); initDataBindings(); // end source language // target language control Group targetLanguageGrp = new Group(container, SWT.NONE); targetLanguageGrp.setLayout(new GridLayout(3, false)); targetLanguageGrp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1)); targetLanguageGrp.setText(Messages.getString("projectsetting.ProjectSettingLanguagePage.targetLanguageGrp")); targetLangControl.createControl(targetLanguageGrp); parent.computeSize(SWT.DEFAULT, SWT.DEFAULT); return container; }
Example 6
Source File: NewProjectWizardLanguagePage.java From translationstudio8 with GNU General Public License v2.0 | 4 votes |
/** * Create contents of the wizard. * @param parent */ public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); container.setLayout(new GridLayout(1, false)); // source language control Group sourceLanguageGrp = new Group(container, SWT.NONE); sourceLanguageGrp.setLayout(new GridLayout(1, false)); sourceLanguageGrp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); sourceLanguageGrp.setText(Messages.getString("wizard.NewProjectWizardLanguagePage.sourceLanguageGrp")); srcLangComboViewer = new TableComboViewer(sourceLanguageGrp, SWT.READ_ONLY | SWT.BORDER); TableCombo tableCombo = srcLangComboViewer.getTableCombo(); // set options. tableCombo.setShowTableLines(false); tableCombo.setShowTableHeader(false); tableCombo.setDisplayColumnIndex(-1); tableCombo.setShowImageWithinSelection(true); tableCombo.setShowColorWithinSelection(false); tableCombo.setShowFontWithinSelection(false); tableCombo.setVisibleItemCount(20); srcLangComboViewer.getTableCombo().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); srcLangComboViewer.setLabelProvider(new LanguageLabelProvider()); srcLangComboViewer.setContentProvider(new ArrayContentProvider()); srcLangComboViewer.setInput(languages); srcLangComboViewer.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { IStructuredSelection selection = (IStructuredSelection) event.getSelection(); srcLanguage = (Language) selection.getFirstElement(); validator.update(); } }); // initialization remember value String rmSrcLangCode = ps.getString(IPreferenceConstants.NEW_PROJECT_SRC_LANG); if (rmSrcLangCode != null && !rmSrcLangCode.equals("")) { for (Language srcLang : languages) { if (srcLang.getCode().equals(rmSrcLangCode)) { srcLangComboViewer.setSelection(new StructuredSelection(srcLang)); break; } } } // end source language // target language control Group targetLanguageGrp = new Group(container, SWT.NONE); targetLanguageGrp.setLayout(new GridLayout(3, false)); targetLanguageGrp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1)); targetLanguageGrp.setText(Messages.getString("wizard.NewProjectWizardLanguagePage.targetLanguageGrp")); targetLangControl.createControl(targetLanguageGrp); // end Target language setControl(container); validator.update(); }
Example 7
Source File: NewProjectWizardLanguagePage.java From tmxeditor8 with GNU General Public License v2.0 | 4 votes |
/** * Create contents of the wizard. * @param parent */ public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); container.setLayout(new GridLayout(1, false)); // source language control Group sourceLanguageGrp = new Group(container, SWT.NONE); sourceLanguageGrp.setLayout(new GridLayout(1, false)); sourceLanguageGrp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); sourceLanguageGrp.setText(Messages.getString("wizard.NewProjectWizardLanguagePage.sourceLanguageGrp")); srcLangComboViewer = new TableComboViewer(sourceLanguageGrp, SWT.READ_ONLY | SWT.BORDER); TableCombo tableCombo = srcLangComboViewer.getTableCombo(); // set options. tableCombo.setShowTableLines(false); tableCombo.setShowTableHeader(false); tableCombo.setDisplayColumnIndex(-1); tableCombo.setShowImageWithinSelection(true); tableCombo.setShowColorWithinSelection(false); tableCombo.setShowFontWithinSelection(false); tableCombo.setVisibleItemCount(20); srcLangComboViewer.getTableCombo().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); srcLangComboViewer.setLabelProvider(new LanguageLabelProvider()); srcLangComboViewer.setContentProvider(new ArrayContentProvider()); srcLangComboViewer.setInput(languages); srcLangComboViewer.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { IStructuredSelection selection = (IStructuredSelection) event.getSelection(); srcLanguage = (Language) selection.getFirstElement(); validator.update(); } }); // initialization remember value String rmSrcLangCode = ps.getString(IPreferenceConstants.NEW_PROJECT_SRC_LANG); if (rmSrcLangCode != null && !rmSrcLangCode.equals("")) { for (Language srcLang : languages) { if (srcLang.getCode().equals(rmSrcLangCode)) { srcLangComboViewer.setSelection(new StructuredSelection(srcLang)); break; } } } // end source language // target language control Group targetLanguageGrp = new Group(container, SWT.NONE); targetLanguageGrp.setLayout(new GridLayout(3, false)); targetLanguageGrp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1)); targetLanguageGrp.setText(Messages.getString("wizard.NewProjectWizardLanguagePage.targetLanguageGrp")); targetLangControl.createControl(targetLanguageGrp); // end Target language setControl(container); validator.update(); }
Example 8
Source File: PatientAddressPage.java From elexis-3-core with Eclipse Public License 1.0 | 4 votes |
@Override protected Control createContents(Composite parent){ init(); Composite comp = new Composite(parent, SWT.None); comp.setLayout(new GridLayout(2, false)); Label lblNewLabel = new Label(comp, SWT.NONE); lblNewLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); lblNewLabel.setText("Strasse"); textStrasse = new Text(comp, SWT.BORDER); textStrasse.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); textStrasse.setTextLimit(80); Label lblPostleitzahl = new Label(comp, SWT.NONE); lblPostleitzahl.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); lblPostleitzahl.setText("Postleitzahl"); textPostleitzahl = new Text(comp, SWT.BORDER); textPostleitzahl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); textPostleitzahl.setTextLimit(6); Label lblOrtschaft = new Label(comp, SWT.NONE); lblOrtschaft.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); lblOrtschaft.setText("Ortschaft"); textOrtschaft = new Text(comp, SWT.BORDER); textOrtschaft.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); textOrtschaft.setTextLimit(50); Label lblLand = new Label(comp, SWT.NONE); lblLand.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); lblLand.setText("Land"); countryComboViewer = new TableComboViewer(comp); TableCombo tableCombo = countryComboViewer.getTableCombo(); tableCombo.setTableWidthPercentage(90); tableCombo.setShowFontWithinSelection(false); tableCombo.setShowColorWithinSelection(false); tableCombo.setShowTableLines(false); tableCombo.setShowTableHeader(false); tableCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); countryComboViewer.setLabelProvider(new CountryComboLabelProvider()); countryComboViewer.setContentProvider(new ArrayContentProvider()); Country[] items = new Country[] { Country.CH, Country.LI, Country.AT, Country.DE, Country.FR, Country.IT }; countryComboViewer.setInput(items); super.setTitle(pat.getLabel()); textStrasse.setText(pat.getStreet()); textPostleitzahl.setText(pat.getZip()); textOrtschaft.setText(pat.getCity()); countryComboViewer.setSelection(new StructuredSelection(pat.getCountry())); setUnlocked(LocalLockServiceHolder.get().isLocked(pat)); return comp; }