public void select(Object item) { if (item != null) fComboViewer.setSelection(new StructuredSelection(item)); else fComboViewer.setSelection(null); }
public void setSelection(T selection) { if (content.contains(selection)) { viewer.setSelection(new StructuredSelection(selection), true); } }
/** * Set a new value * * @param value * the new value */ protected void doSetValue(Object value) { Assert.isTrue(viewer != null); selectedValue = value; if (value == null) { viewer.setSelection(StructuredSelection.EMPTY); } else { viewer.setSelection(new StructuredSelection(value)); } }
/** * Set a new value * * @param value * the new value */ @Override protected void doSetValue(Object value) { Assert.isTrue(viewer != null); selectedValue = value; if (value == null) { viewer.setSelection(StructuredSelection.EMPTY); } else { viewer.setSelection(new StructuredSelection(value)); } }
/** * Set a new value * * @param value * the new value */ @Override protected void doSetValue(Object value) { Assert.isTrue(viewer != null); selectedValue = value; if (value == null) { viewer.setSelection(StructuredSelection.EMPTY); } else { viewer.setSelection(new StructuredSelection(value)); } }
/** * Set the filesystem selection combo box to the specified scheme. * * @param scheme name of scheme, e.g. "rse" * @throws CoreException If scheme is illegal. */ public void setSelectedFileSystem(String scheme) throws CoreException { Iterator<FileSystemElement> fsEltItr = fsElements.iterator(); boolean foundMatch = false; while (fsEltItr.hasNext()) { FileSystemElement fsElt = fsEltItr.next(); if (fsElt.getScheme().equalsIgnoreCase(scheme)) { foundMatch = true; fileSystems.setSelection(new StructuredSelection(fsElt)); break; } } if (!foundMatch) { throw new CoreException(new Status(IStatus.ERROR, ProfileLaunchPlugin.PLUGIN_ID, IStatus.OK, ResourceSelectorWidgetMessages.FileSystemSelectionArea_unrecognized_scheme + scheme, null)); } }
@SuppressWarnings("unchecked") private void selectColorsAndFontsTheme(String colorAndFontThemeId) { if (colorAndFontThemeId == null) { colorAndFontThemeId = currentColorsAndFontsTheme.getId(); } List<ColorsAndFontsTheme> colorsAndFontsThemes = (List<ColorsAndFontsTheme>) colorsAndFontsThemeCombo .getInput(); for (int i = 0; i < colorsAndFontsThemes.size(); i++) { if (colorsAndFontsThemes.get(i).getId().equals(colorAndFontThemeId)) { ISelection selection = new StructuredSelection(colorsAndFontsThemes.get(i)); colorsAndFontsThemeCombo.setSelection(selection); break; } } }
public boolean selectWorkingSets(List<IWorkingSet> workingSets) { Set<IWorkingSet> defaultSets = getWorkingSets(); workingsetComboViewer.setInput(defaultSets); if(workingSets != null && workingSets.size() > 0) { if(workingSets.size() == 1) { IWorkingSet workingSet = workingSets.get(0); if(defaultSets.contains(workingSet)) { workingsetComboViewer.setSelection(new StructuredSelection(workingSet)); } } else { workingsetComboViewer.add(workingSets); workingsetComboViewer.setSelection(new StructuredSelection((Object) workingSets)); } return true; } return false; } }
if (selection == null) selection= (String[]) list.get(0); fDecorationViewer.setSelection(new StructuredSelection((Object) selection), true);
private void revertSelection() { try { viewer.removeSelectionChangedListener(this); SpellingEngineDescriptor desc= EditorsUI.getSpellingService().getActiveSpellingEngineDescriptor(fStore); if (desc != null) viewer.setSelection(new StructuredSelection(desc), true); } finally { viewer.addSelectionChangedListener(this); } } });
private void restoreFromPreferences() { if (fEnablementCheckbox == null) return; boolean enabled= fStore.getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED); fEnablementCheckbox.setSelection(enabled); if (fProviderViewer == null) updateListDependencies(); else { SpellingEngineDescriptor desc= EditorsUI.getSpellingService().getActiveSpellingEngineDescriptor(fStore); if (desc != null) fProviderViewer.setSelection(new StructuredSelection(desc), true); } updateCheckboxDependencies(); } }
private void restoreFromPreferences() { if (fEnablementCheckbox == null) return; boolean enabled= fStore.getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED); fEnablementCheckbox.setSelection(enabled); if (fProviderViewer == null) updateListDependencies(); else { SpellingEngineDescriptor desc= EditorsUI.getSpellingService().getActiveSpellingEngineDescriptor(fStore); if (desc != null) fProviderViewer.setSelection(new StructuredSelection(desc), true); } updateCheckboxDependencies(); } }
private void revertSelection() { try { viewer.removeSelectionChangedListener(this); SpellingEngineDescriptor desc= EditorsUI.getSpellingService().getActiveSpellingEngineDescriptor(fStore); if (desc != null) viewer.setSelection(new StructuredSelection(desc), true); } finally { viewer.addSelectionChangedListener(this); } } });
private void restoreFromPreferences() { boolean enabled= fStore.getBoolean(PreferenceConstants.EDITOR_FOLDING_ENABLED); fFoldingCheckbox.setSelection(enabled); updateCheckboxDependencies(); String id= fStore.getString(PreferenceConstants.EDITOR_FOLDING_PROVIDER); Object provider= fProviderDescriptors.get(id); // Fallback to default if (provider == null) { String message= Messages.format(PreferencesMessages.FoldingConfigurationBlock_warning_providerNotFound_resetToDefault, id); JavaPlugin.log(new Status(IStatus.WARNING, JavaPlugin.getPluginId(), IStatus.OK, message, null)); id= JavaPlugin.getDefault().getPreferenceStore().getDefaultString(PreferenceConstants.EDITOR_FOLDING_PROVIDER); provider= fProviderDescriptors.get(id); Assert.isNotNull(provider); fStore.setToDefault(PreferenceConstants.EDITOR_FOLDING_PROVIDER); } if (fProviderViewer == null) updateListDependencies(); else fProviderViewer.setSelection(new StructuredSelection(provider), true); } }
private void restoreFromPreferences() { boolean enabled= fStore.getBoolean(PreferenceConstants.EDITOR_FOLDING_ENABLED); fFoldingCheckbox.setSelection(enabled); updateCheckboxDependencies(); String id= fStore.getString(PreferenceConstants.EDITOR_FOLDING_PROVIDER); Object provider= fProviderDescriptors.get(id); // Fallback to default if (provider == null) { String message= Messages.format(PreferencesMessages.FoldingConfigurationBlock_warning_providerNotFound_resetToDefault, id); JavaPlugin.log(new Status(IStatus.WARNING, JavaPlugin.getPluginId(), IStatus.OK, message, null)); id= JavaPlugin.getDefault().getPreferenceStore().getDefaultString(PreferenceConstants.EDITOR_FOLDING_PROVIDER); provider= fProviderDescriptors.get(id); Assert.isNotNull(provider); fStore.setToDefault(PreferenceConstants.EDITOR_FOLDING_PROVIDER); } if (fProviderViewer == null) updateListDependencies(); else fProviderViewer.setSelection(new StructuredSelection(provider), true); } }
private void restoreFromPreferences() { boolean enabled= fStore.getBoolean(PreferenceConstants.EDITOR_FOLDING_ENABLED); fFoldingCheckbox.setSelection(enabled); updateCheckboxDependencies(); String id= fStore.getString(PreferenceConstants.EDITOR_FOLDING_PROVIDER); Object provider= fProviderDescriptors.get(id); // Fallback to default if (provider == null) { String message= Messages.format(PreferencesMessages.FoldingConfigurationBlock_warning_providerNotFound_resetToDefault, id); JavaPlugin.log(new Status(IStatus.WARNING, JavaPlugin.getPluginId(), IStatus.OK, message, null)); id= JavaPlugin.getDefault().getPreferenceStore().getDefaultString(PreferenceConstants.EDITOR_FOLDING_PROVIDER); provider= fProviderDescriptors.get(id); Assert.isNotNull(provider); fStore.setToDefault(PreferenceConstants.EDITOR_FOLDING_PROVIDER); } if (fProviderViewer == null) updateListDependencies(); else fProviderViewer.setSelection(new StructuredSelection(provider), true); } }
@Override protected void performDefaults() { if (engine != null) { setColorsAndFontsTheme(currentColorsAndFontsTheme); ((PreferencePageEnhancer) Tweaklets.get(PreferencePageEnhancer.KEY)).performDefaults(); engine.setTheme(defaultTheme, true); if (engine.getActiveTheme() != null) { themeIdCombo.setSelection(new StructuredSelection(engine.getActiveTheme())); } } IPreferenceStore apiStore = PrefUtil.getAPIPreferenceStore(); enableAnimations.setSelection(apiStore.getDefaultBoolean(IWorkbenchPreferenceConstants.ENABLE_ANIMATIONS)); useColoredLabels.setSelection(apiStore.getDefaultBoolean(IWorkbenchPreferenceConstants.USE_COLORED_LABELS)); if (enableMru != null) { enableMru.setSelection(getDefaultMRUValue()); } super.performDefaults(); }
@Override public void widgetSelected(SelectionEvent e) { NewRepositoryWizard wiz = new NewRepositoryWizard(true); if (new WizardDialog(getShell(), wiz).open() == Window.OK) { v.refresh(); selectedRepository = wiz.getCreatedRepository(); v.setSelection(new StructuredSelection(selectedRepository)); updateControls(); } } });
/** * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) */ public void initializeFrom(ILaunchConfiguration configuration) { updateProjectFromConfig(configuration); dettachModificationListeners(); for (TestngTestSelector sel : m_launchSelectors) { sel.initializeFrom(configuration); } int logLevel = ConfigurationHelper.getLogLevel(configuration); m_logLevelCombo.select(logLevel); m_verboseBtn.setSelection(ConfigurationHelper.getVerbose(configuration)); m_debugBtn.setSelection(ConfigurationHelper.getDebug(configuration)); m_protocolComboViewer.setSelection(new StructuredSelection(ConfigurationHelper.getProtocol(configuration))); LaunchType type = ConfigurationHelper.getType(configuration); setType(type); m_classMethods = ConfigurationHelper.getClassMethods(configuration); attachModificationListeners(); }
/** * */ private void fill() { fSchemeCombo.setInput(keyController.getSchemeModel()); fSchemeCombo.setSelection(new StructuredSelection(keyController.getSchemeModel().getSelectedElement())); // Apply context filters keyController.filterContexts(fFilterActionSetContexts, fFilterInternalContexts); fWhenCombo.setInput(keyController.getContextModel()); fFilteredTree.filterCategories(fPatternFilter.isFilteringCategories()); fFilteredTree.getViewer().setInput(keyController.getBindingModel()); }