本文整理汇总了Java中org.eclipse.jface.viewers.ComboViewer.setInput方法的典型用法代码示例。如果您正苦于以下问题:Java ComboViewer.setInput方法的具体用法?Java ComboViewer.setInput怎么用?Java ComboViewer.setInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.viewers.ComboViewer
的用法示例。
在下文中一共展示了ComboViewer.setInput方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRuntimeField
import org.eclipse.jface.viewers.ComboViewer; //导入方法依赖的package包/类
@Override
protected void createRuntimeField(Composite composite) {
Label runtimeLabel = new Label(composite, SWT.LEAD);
runtimeLabel.setText(Messages.getString("app.engine.standard.project.runtimetype")); //$NON-NLS-1$
runtimeField = new ComboViewer(composite, SWT.READ_ONLY);
runtimeField.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
return ((AppEngineRuntime) element).getLabel();
}
});
runtimeField.setContentProvider(ArrayContentProvider.getInstance());
runtimeField.setInput(AppEngineRuntime.STANDARD_RUNTIMES);
runtimeField.setSelection(new StructuredSelection(DEFAULT_RUNTIME), true);
runtimeField.addPostSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
revalidate();
}
});
}
示例2: create
import org.eclipse.jface.viewers.ComboViewer; //导入方法依赖的package包/类
private void create(Composite parent) {
displayExecutor = DisplayExecutor.create(parent.getDisplay());
comboViewer = new ComboViewer(parent, SWT.READ_ONLY | SWT.DROP_DOWN);
comboViewer.setComparator(new ViewerComparator());
comboViewer.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
if (element instanceof GcpProject) {
GcpProject project = (GcpProject) element;
return project.getName() + " (" + project.getId() + ")";
}
return super.getText(element);
}
});
comboViewer.setContentProvider(ArrayContentProvider.getInstance());
comboViewer.setInput(EMPTY_PROJECTS);
parent.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent event) {
cancelFetch();
}
});
fetch();
}
示例3: createEmbeddedTypeScriptField
import org.eclipse.jface.viewers.ComboViewer; //导入方法依赖的package包/类
private void createEmbeddedTypeScriptField(Composite parent, ITypeScriptRepository[] repositories) {
useEmbeddedTsRuntimeButton = new Button(parent, SWT.RADIO);
useEmbeddedTsRuntimeButton
.setText(TypeScriptUIMessages.WizardNewTypeScriptProjectCreationPage_useEmbeddedTsRuntime_label);
useEmbeddedTsRuntimeButton.addListener(SWT.Selection, this);
useEmbeddedTsRuntimeButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
updateTsRuntimeMode();
}
});
embeddedTsRuntime = new Combo(parent, SWT.READ_ONLY);
embeddedTsRuntime.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
ComboViewer viewer = new ComboViewer(embeddedTsRuntime);
viewer.setContentProvider(ArrayContentProvider.getInstance());
viewer.setLabelProvider(new TypeScriptRepositoryLabelProvider());
viewer.setInput(repositories);
}
示例4: createEmbeddedTslintField
import org.eclipse.jface.viewers.ComboViewer; //导入方法依赖的package包/类
private void createEmbeddedTslintField(Composite parent) {
useEmbeddedTslintRuntimeButton = new Button(parent, SWT.RADIO);
useEmbeddedTslintRuntimeButton.setText(TypeScriptUIMessages.TSLintWizardPage_useEmbeddedTslintRuntime_label);
useEmbeddedTslintRuntimeButton.addListener(SWT.Selection, this);
useEmbeddedTslintRuntimeButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
updateTslintRuntimeMode();
}
});
embeddedTslintRuntime = new Combo(parent, SWT.READ_ONLY);
embeddedTslintRuntime.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
ComboViewer viewer = new ComboViewer(embeddedTslintRuntime);
viewer.setContentProvider(ArrayContentProvider.getInstance());
viewer.setLabelProvider(new TypeScriptRepositoryLabelProvider(true, false));
List<ITypeScriptRepository> repositories = Arrays
.stream(TypeScriptCorePlugin.getTypeScriptRepositoryManager().getRepositories())
.filter(r -> r.getTslintFile() != null).collect(Collectors.toList());
viewer.setInput(repositories);
}
示例5: 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;
}
示例6: 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();
}
});
}
示例7: 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();
}
});
}
示例8: addProblemTypeRow
import org.eclipse.jface.viewers.ComboViewer; //导入方法依赖的package包/类
private void addProblemTypeRow(Composite categoryProblemsPanel, IGdtProblemType problemType) {
GridData problemLabelLayout = new GridData(SWT.FILL, SWT.CENTER, true, false);
Label problemLabel = new Label(categoryProblemsPanel, SWT.NONE);
problemLabel.setLayoutData(problemLabelLayout);
problemLabel.setText(problemType.getDescription());
ComboViewer severityCombo = new ComboViewer(categoryProblemsPanel, SWT.READ_ONLY);
GridData severityComboLayout = new GridData(SWT.FILL, SWT.CENTER, false, false);
severityCombo.getCombo().setLayoutData(severityComboLayout);
severityCombo.setContentProvider(new ArrayContentProvider());
severityCombo.setLabelProvider(severityLabelProvider);
severityCombo.setSorter(severityViewerSorter);
severityCombo.setInput(GdtProblemSeverity.values());
// Save the association between the problem type and this combo
problemSeverityCombos.put(problemType, severityCombo);
}
示例9: 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);
}
示例10: 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);
}
示例11: setClass
import org.eclipse.jface.viewers.ComboViewer; //导入方法依赖的package包/类
void setClass(final IType type,
final Button classButton,
final ComboViewer methodComboViewer) {
try {
classButton.setText(type.getFullyQualifiedName());
final List<IMethod> methods = new ArrayList<>(Arrays.asList(type.getMethods()));
for (final Iterator<IMethod> iter = methods.iterator(); iter.hasNext();) {
if (!valid(iter.next())) {
iter.remove();
}
}
methodComboViewer.setInput(methods.toArray());
if (!methods.isEmpty()) {
methodComboViewer.setSelection(new StructuredSelection(methods.get(0)));
}
this.type = type;
getButton(IDialogConstants.OK_ID).setEnabled(true);
} catch (final JavaModelException e) {
Activator.error(e);
}
}
示例12: 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;
}
示例13: bindUniverseDefinition
import org.eclipse.jface.viewers.ComboViewer; //导入方法依赖的package包/类
private void bindUniverseDefinition(ComboViewer universeDefinitionCombo) {
universeDefinitionCombo.setContentProvider(new ArrayContentProvider());
universeDefinitionCombo.setLabelProvider(new ProjectUniverseLabelProvider());
universeDefinitionCombo.setComparator(new ViewerComparator());
Set<ProjectUniverse> projectUniverses = getProjectUniverses();
universeDefinitionCombo.setInput(projectUniverses);
IObservableValue selectedUniverseDefinition = ViewerProperties.singleSelection().observe(universeDefinitionCombo);
IObservableValue universeDefinition = BeansObservables.observeValue(editVersionModel, EditVersionModel.PN_PROJECT_UNIVERSE);
dbc.bindValue(selectedUniverseDefinition, universeDefinition);
ProjectUniverse projectUniverse = findUniverse(projectUniverses, getUniverseId());
if (projectUniverse == null) {
projectUniverse = findUniverse(projectUniverses, UniverseDefinitions.ALL_WORKSPACE_PROJECTS_UNIVERSE_ID);
}
/* We simply use the first element in the list as the initial selection. */
if (0 < universeDefinitionCombo.getCombo().getItemCount()) {
universeDefinitionCombo.setSelection(new StructuredSelection(projectUniverse));
}
}
示例14: 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;
}
示例15: 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)));
}