本文整理匯總了Java中org.eclipse.jface.viewers.ComboViewer.addSelectionChangedListener方法的典型用法代碼示例。如果您正苦於以下問題:Java ComboViewer.addSelectionChangedListener方法的具體用法?Java ComboViewer.addSelectionChangedListener怎麽用?Java ComboViewer.addSelectionChangedListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.viewers.ComboViewer
的用法示例。
在下文中一共展示了ComboViewer.addSelectionChangedListener方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addMappingBaseCombo
import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
/**
* Add the mapping base {@link ComboViewer} to the given header {@link Composite}.
*
* @param headerComposite
* the header {@link Composite}
* @return the mapping base {@link ComboViewer}
*/
private ComboViewer addMappingBaseCombo(Composite headerComposite) {
final Label selectMappingBaseLabel = new Label(headerComposite, SWT.NONE);
selectMappingBaseLabel.setToolTipText("Select a mapping base.");
selectMappingBaseLabel.setText("Mapping base:");
final ComboViewer mappingCombo = new ComboViewer(headerComposite, SWT.READ_ONLY);
Combo combo = mappingCombo.getCombo();
combo.setToolTipText("Select the mapping base to use.");
mappingCombo.setContentProvider(new MappingBaseRegistryContentProvider());
mappingCombo.setLabelProvider(new MappingLabelProvider(MappingLabelProvider.SOURCE));
mappingCombo.setComparator(new ViewerComparator());
mappingCombo.setInput(MappingUtils.getMappingRegistry());
mappingCombo.addSelectionChangedListener(new BaseComboSelectionChangedListener());
return mappingCombo;
}
示例2: createGeneratorCombo
import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
private void createGeneratorCombo(Composite container) {
Label lblGenerator = new Label(container, SWT.NONE);
lblGenerator.setText("Generator");
generatorCombo = new ComboViewer(container, SWT.READ_ONLY);
generatorCombo.getCombo().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
generatorCombo.setLabelProvider(new GeneratorDescriptorLabelProvider());
generatorCombo.setContentProvider(new ArrayContentProvider());
List<IGeneratorDescriptor> descriptors = Lists.newArrayList(GeneratorExtensions.getGeneratorDescriptors());
Collections.sort(descriptors, CoreGenerator.generatorOrder);
generatorCombo.setInput(descriptors);
generatorCombo.getCombo().select(0);
generatorCombo.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
refreshInput();
}
});
}
示例3: ContextValueControl
import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
public ContextValueControl(Composite parent) {
super(parent, SWT.NONE);
setLayout(new FillLayout());
viewer = new ComboViewer(this, SWT.READ_ONLY | SWT.FLAT);
viewer.setContentProvider(new ArrayContentProvider());
viewer.setLabelProvider(CONTROL_LABEL_PROVIDER);
viewer.setComparator(new AlphabeticSorter(new ViewerObjectToString() {
@Override
public String getString(Object object) {
return CONTROL_LABEL_PROVIDER.getText(object);
}
}));
viewer.setInput(ContextKey.Base.values());
listener = new ControlSelectionChangedListener();
viewer.addSelectionChangedListener(listener);
}
示例4: ComposeModeControl
import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
public ComposeModeControl(Composite parent) {
super(parent, SWT.NONE);
setLayout(new FillLayout());
viewer = new ComboViewer(this, SWT.READ_ONLY | SWT.FLAT);
viewer.setContentProvider(new ArrayContentProvider());
viewer.setLabelProvider(CONTROL_LABEL_PROVIDER);
viewer.setComparator(new AlphabeticSorter(new ViewerObjectToString() {
@Override
public String getString(Object object) {
return CONTROL_LABEL_PROVIDER.getText(object);
}
}));
viewer.setInput(ComposeMode.values());
listener = new ControlSelectionChangedListener();
viewer.addSelectionChangedListener(listener);
}
示例5: MapChoiceControl
import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
public MapChoiceControl(Composite parent) {
super(parent, SWT.NONE);
setLayout(new FillLayout());
viewer = new ComboViewer(this, SWT.READ_ONLY | SWT.FLAT);
viewer.setContentProvider(new ControlContentProvider());
viewer.setLabelProvider(CONTROL_LABEL_PROVIDER);
viewer.setComparator(new AlphabeticSorter(new ViewerObjectToString() {
@Override
public String getString(Object object) {
return CONTROL_LABEL_PROVIDER.getText(object);
}
}));
listener = new ControlSelectionChangedListener();
viewer.addSelectionChangedListener(listener);
}
示例6: addBehandlungsfallComboSelector
import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
protected void addBehandlungsfallComboSelector(Composite container){
Label lblBehandlungsfall = new Label(container, SWT.NONE);
lblBehandlungsfall.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
lblBehandlungsfall.setText("Behandlungsfall");
comboViewerBehandlungsfall = new ComboViewer(container, SWT.NONE);
comboViewerBehandlungsfall.getCombo().setLayoutData(
new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
comboViewerBehandlungsfall.getCombo().setEnabled(false);
comboViewerBehandlungsfall.setContentProvider(ArrayContentProvider.getInstance());
comboViewerBehandlungsfall.setLabelProvider(new BasePropertyComboLabelProvider());
comboViewerBehandlungsfall.setComparator(new BasePropertyViewerComparator());
comboViewerBehandlungsfall.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event){
IStructuredSelection behandlungsfallSelection =
(IStructuredSelection) event.getSelection();
selectedBehandlungsfallCode =
((BaseProperty) behandlungsfallSelection.getFirstElement()).getCode();
setExecuteOk(true);
}
});
}
示例7: addVersicherungstraegerComboSelector
import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
protected void addVersicherungstraegerComboSelector(Composite container){
Label lblSVT = new Label(container, SWT.NONE);
lblSVT.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
lblSVT.setText("Versicherungsträger");
comboViewerSVT = new ComboViewer(container, SWT.NONE);
comboViewerSVT.getCombo().setLayoutData(
new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
comboViewerSVT.setContentProvider(new ArrayContentProvider());
comboViewerSVT.setLabelProvider(new SvtPropertyComboLabelProvider());
SvtProperty[] sp = GINAStatus.getCurrentSVTList();
if (sp != null)
comboViewerSVT.setInput(sp);
comboViewerSVT.getCombo().setText(AUTOMATISCH_ERMITTELN);
comboViewerSVT.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event){
IStructuredSelection versicherungstraegerSelection =
(IStructuredSelection) event.getSelection();
selectedVersicherungstraegerCode =
((SvtProperty) versicherungstraegerSelection.getFirstElement()).getCode();
}
});
}
示例8: createRepositoryPart
import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
private ComboViewer createRepositoryPart(Composite container, final List<ITeamRepository> repos) {
Label repoLabel= new Label(container, SWT.NONE);
repoLabel.setText("Repository:");
Combo repoCombo= new Combo(container, SWT.SINGLE | SWT.BORDER | SWT.DROP_DOWN | SWT.READ_ONLY);
repoCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
ComboViewer comboViewer= new ComboViewer(repoCombo);
comboViewer.setContentProvider(new ArrayContentProvider());
comboViewer.setLabelProvider(new RepositoryLabelProvider());
comboViewer.setInput(repos);
comboViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
withRepository((ITeamRepository)((IStructuredSelection)event.getSelection()).getFirstElement());
}
});
return comboViewer;
}
示例9: createUniverseDefinitionCombo
import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
private ComboViewer createUniverseDefinitionCombo(Composite parent) {
Label universeDefinitionComboLabel = new Label(parent, SWT.NONE);
universeDefinitionComboLabel.setText(Messages.editVersionWizardPageUniverseDefinitionLabel);
universeDefinitionComboLabel.setLayoutData(new GridData());
ComboViewer result = new ComboViewer(parent, SWT.READ_ONLY);
result.getCombo().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
result.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
if (!selection.isEmpty()) {
ProjectUniverse projectUniverse = (ProjectUniverse) selection.getFirstElement();
String projectId = projectUniverse.id();
VersioningUIPlugin.getDefault().getPreferenceStore().setValue(EDIT_VERSION_SELECTED_UNIVERSE_PREFERENCE, projectId);
}
}
});
return result;
}
示例10: createExistingSection
import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
private void createExistingSection(Composite body) {
Button existingCheck = new Button(body, SWT.RADIO);
existingCheck.setText("Existing database");
existingCheck.setSelection(true);
Controls.onSelect(existingCheck, (e) -> {
setSelection(config.EXISTING_MODE);
});
Composite composite = new Composite(body, SWT.NONE);
UI.gridLayout(composite, 1);
UI.gridData(composite, true, false);
existingViewer = new ComboViewer(composite);
UI.gridData(existingViewer.getControl(), true, false);
existingViewer.setLabelProvider(new DbLabel());
existingViewer.setContentProvider(ArrayContentProvider.getInstance());
existingViewer.addSelectionChangedListener(e -> selectDatabase());
fillExistingViewer();
}
示例11: createComponentViewer
import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
private void createComponentViewer(Composite composite) {
UI.formLabel(composite, toolkit, M.Component);
componentViewer = new ComboViewer(composite);
UI.gridData(componentViewer.getControl(), false, false).widthHint = 250;
componentViewer.setContentProvider(ArrayContentProvider
.getInstance());
componentViewer.setLabelProvider(new ComponentLabel());
componentViewer.setInput(ReportComponent.values());
componentViewer.addSelectionChangedListener((evt) -> {
ReportComponent c = Viewers.getFirst(evt.getSelection());
if (c == null || c == ReportComponent.NONE)
model.componentId = null;
else
model.componentId = c.getId();
editor.setDirty(true);
});
if (model.componentId != null)
componentViewer.setSelection(new StructuredSelection(
ReportComponent.getForId(model.componentId)));
}
示例12: createCurrencyRow
import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
private void createCurrencyRow(Composite body, FormToolkit tk) {
Combo widget = UI.formCombo(body, tk, M.Currency);
currencyCombo = new ComboViewer(widget);
currencyCombo.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object obj) {
if (!(obj instanceof Currency))
return super.getText(obj);
return ((Currency) obj).getName();
}
});
setCurrencyContent(currencyCombo);
currencyCombo.addSelectionChangedListener(e -> {
currency = Viewers.getFirst(e.getSelection());
exchange.currency = currency;
updateCurrencyLabels();
});
UI.filler(body, tk);
}
示例13: createSelectionViewer
import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
private ComboViewer createSelectionViewer(Composite parent, FormToolkit toolkit) {
UI.formLabel(parent, toolkit, M.ReplaceFlow);
ComboViewer viewer = new ComboViewer(new CCombo(parent, SWT.DROP_DOWN));
decorateViewer(viewer);
NameFilter filter = new NameFilter();
viewer.addFilter(filter);
viewer.setInput(usedInExchanges);
UI.gridData(viewer.getCCombo(), true, false).widthHint = 300;
viewer.getCCombo().addKeyListener(new FilterOnKey(viewer, filter, () -> usedInExchanges));
viewer.addSelectionChangedListener((e) -> {
FlowDescriptor selected = Viewers.getFirstSelected(viewer);
if (selected == null || selected.getId() == 0l) {
replacementCandidates = new ArrayList<>();
} else {
replacementCandidates = getReplacementCandidates(selected);
}
replacementViewer.setInput(replacementCandidates);
updateButtons();
});
return viewer;
}
示例14: createProcessViewer
import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
private ComboViewer createProcessViewer(Composite parent, FormToolkit toolkit) {
UI.formLabel(parent, toolkit, M.ReplaceProvider);
ComboViewer viewer = new ComboViewer(new CCombo(parent, SWT.DROP_DOWN));
decorateViewer(viewer);
viewer.setInput(usedInExchanges);
NameFilter filter = new NameFilter();
viewer.addFilter(filter);
UI.gridData(viewer.getCCombo(), true, false).widthHint = 300;
viewer.getCCombo().addKeyListener(new FilterOnKey(viewer, filter, () -> usedInExchanges));
viewer.addSelectionChangedListener((e) -> {
ProcessDescriptor selected = Viewers.getFirstSelected(viewer);
if (selected == null || selected.getId() == 0l) {
productViewer.setInput(new ArrayList<>());
} else {
productViewer.setInput(getProductOutputs(selected));
}
replacementCandidates = new ArrayList<>();
replacementViewer.setInput(replacementCandidates);
updateButtons();
});
return viewer;
}
示例15: createProductViewer
import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
private ComboViewer createProductViewer(Composite parent, FormToolkit toolkit) {
UI.formLabel(parent, toolkit, M.OfProduct);
ComboViewer viewer = new ComboViewer(new Combo(parent, SWT.NONE));
decorateViewer(viewer);
viewer.setLabelProvider(new BaseLabelProvider());
UI.gridData(viewer.getCombo(), true, false).widthHint = 300;
viewer.addSelectionChangedListener((e) -> {
ProcessDescriptor process = Viewers.getFirstSelected(processViewer);
FlowDescriptor product = Viewers.getFirstSelected(productViewer);
if (process == null || process.getId() == 0l || product == null) {
replacementCandidates = new ArrayList<>();
} else {
replacementCandidates = getProviders(product);
}
replacementViewer.setInput(replacementCandidates);
updateButtons();
});
return viewer;
}