DiffHeaderFormat getSelectedHeaderFormat() { IStructuredSelection selection = (IStructuredSelection) formatCombo .getSelection(); return (DiffHeaderFormat) selection.getFirstElement(); } }
/** * @return initial branch selected (includes refs/heads prefix). */ public Ref getInitialBranch() { IStructuredSelection selection = (IStructuredSelection)initialBranch.getSelection(); return (Ref)selection.getFirstElement(); }
protected void updateConfiguration() { if(addToWorkingSetButton.getSelection()) { IStructuredSelection selection = (IStructuredSelection) workingsetComboViewer.getSelection(); Object o = selection.getFirstElement(); if(o != null) { workingSets.clear(); if(o instanceof IWorkingSet) { workingSets.add((IWorkingSet) o); } else if(o instanceof List<?>) { @SuppressWarnings("unchecked") List<IWorkingSet> l = (List<IWorkingSet>) o; workingSets.addAll(l); } } } }
@Override public void widgetSelected(SelectionEvent event) { ISelection selection = viewer.getSelection(); if (selection.isEmpty()) { selectedValue = null; } else { selectedValue = ((IStructuredSelection) selection) .getFirstElement(); } } });
public void widgetSelected(SelectionEvent event) { ISelection selection = viewer.getSelection(); if (selection.isEmpty()) { selectedValue = null; } else { selectedValue = ((IStructuredSelection) selection) .getFirstElement(); } } });
public void selectionChanged(SelectionChangedEvent event) { if (mapping != null) { IStructuredSelection selection = (IStructuredSelection)transferType.getSelection(); CDOTransferType type = (CDOTransferType)selection.getFirstElement(); mapping.setTransferType(type); } } });
/** * Return the selected configuration. * @return FileSystemConfiguration or <code>null</code> if nothing * is selected. */ public FileSystemConfiguration getSelectedConfiguration() { ISelection selection = fileSystems.getSelection(); if (selection instanceof IStructuredSelection) { IStructuredSelection structured = (IStructuredSelection) selection; if (structured.size() == 1) { return (FileSystemConfiguration) structured.getFirstElement(); } } return null; }
@Override public void widgetSelected(SelectionEvent e) { selectedRepository = null; IStructuredSelection sel = (IStructuredSelection) v .getSelection(); setRepository((Repository) sel.getFirstElement()); updateControls(); } });
public void widgetSelected(SelectionEvent e) { ListItem item= getSelectedItem(); final boolean value= fShowInTextCheckBox.getSelection(); if (value) { // enable whatever is in the combo String[] decoration= (String[]) ((IStructuredSelection) fDecorationViewer.getSelection()).getFirstElement(); if (HIGHLIGHT.equals(decoration)) getPreferenceStore().setValue(item.highlightKey, true); else getPreferenceStore().setValue(item.textKey, true); } else { // disable both getPreferenceStore().setValue(item.textKey, false); getPreferenceStore().setValue(item.highlightKey, false); } getPreferenceStore().setValue(item.textKey, value); updateDecorationViewer(item, false); } });
/** * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ public void performApply(ILaunchConfigurationWorkingCopy configuration) { ConfigurationHelper.updateLaunchConfiguration(configuration, new ConfigurationHelper.LaunchInfo(m_projectText.getText(), m_typeOfTestRun, StringUtils.stringToList(m_classSelector.getText().trim()), StringUtils.stringToList(m_packageSelector.getText().trim()), m_classMethods, m_groupSelector.getValueMap(), m_suiteSelector.getText(), m_logLevelCombo.getText(), m_verboseBtn.getSelection(), m_debugBtn.getSelection(), (Protocols) ((StructuredSelection) m_protocolComboViewer.getSelection()).getFirstElement()) ); }
public void selectionChanged(SelectionChangedEvent event) { String[] decoration= (String[]) ((IStructuredSelection) fDecorationViewer.getSelection()).getFirstElement(); ListItem item= getSelectedItem(); if (fShowInTextCheckBox.getSelection()) { if (HIGHLIGHT.equals(decoration)) { getPreferenceStore().setValue(item.highlightKey, true); getPreferenceStore().setValue(item.textKey, false); getPreferenceStore().setValue(item.textStyleKey, AnnotationPreference.STYLE_NONE); } else { getPreferenceStore().setValue(item.highlightKey, false); getPreferenceStore().setValue(item.textKey, true); getPreferenceStore().setValue(item.textStyleKey, decoration[1]); } } } });
@Override public void widgetSelected(SelectionEvent e) { ListItem item= getSelectedItem(); final boolean value= fShowInTextCheckBox.getSelection(); if (value) { // enable whatever is in the combo String[] decoration= (String[]) ((IStructuredSelection) fDecorationViewer.getSelection()).getFirstElement(); if (HIGHLIGHT.equals(decoration)) getPreferenceStore().setValue(item.highlightKey, true); else getPreferenceStore().setValue(item.textKey, true); } else { // disable both getPreferenceStore().setValue(item.textKey, false); getPreferenceStore().setValue(item.highlightKey, false); } getPreferenceStore().setValue(item.textKey, value); updateDecorationViewer(item, false); } });
@Override public void selectionChanged(SelectionChangedEvent event) { String[] decoration= (String[]) ((IStructuredSelection) fDecorationViewer.getSelection()).getFirstElement(); ListItem item= getSelectedItem(); if (fShowInTextCheckBox.getSelection()) { if (HIGHLIGHT.equals(decoration)) { getPreferenceStore().setValue(item.highlightKey, true); getPreferenceStore().setValue(item.textKey, false); getPreferenceStore().setValue(item.textStyleKey, AnnotationPreference.STYLE_NONE); } else { getPreferenceStore().setValue(item.highlightKey, false); getPreferenceStore().setValue(item.textKey, true); getPreferenceStore().setValue(item.textStyleKey, decoration[1]); } } } });
public void widgetSelected(SelectionEvent e) { ListItem item= getSelectedItem(); final boolean value= fShowInTextCheckBox.getSelection(); if (value) { // enable whatever is in the combo String[] decoration= (String[]) ((IStructuredSelection) fDecorationViewer.getSelection()).getFirstElement(); if (HIGHLIGHT.equals(decoration)) fStore.setValue(item.highlightKey, true); else fStore.setValue(item.textKey, true); } else { // disable both if (item.textKey != null) fStore.setValue(item.textKey, false); if (item.highlightKey != null) fStore.setValue(item.highlightKey, false); } fStore.setValue(item.textKey, value); updateDecorationViewer(item, false); fAnnotationTypeViewer.refresh(item); } });
@Override public void widgetSelected(SelectionEvent e) { ListItem item= getSelectedItem(); final boolean value= fShowInTextCheckBox.getSelection(); if (value) { // enable whatever is in the combo String[] decoration= (String[]) ((IStructuredSelection) fDecorationViewer.getSelection()).getFirstElement(); if (HIGHLIGHT.equals(decoration)) fStore.setValue(item.highlightKey, true); else fStore.setValue(item.textKey, true); } else { // disable both if (item.textKey != null) fStore.setValue(item.textKey, false); if (item.highlightKey != null) fStore.setValue(item.highlightKey, false); } fStore.setValue(item.textKey, value); updateDecorationViewer(item, false); fAnnotationTypeViewer.refresh(item); } });
public void selectionChanged(SelectionChangedEvent event) { String[] decoration= (String[]) ((IStructuredSelection) fDecorationViewer.getSelection()).getFirstElement(); ListItem item= getSelectedItem(); if (fShowInTextCheckBox.getSelection()) { if (HIGHLIGHT.equals(decoration)) { fStore.setValue(item.highlightKey, true); if (item.textKey != null) { fStore.setValue(item.textKey, false); if (item.textStyleKey != null) fStore.setValue(item.textStyleKey, AnnotationPreference.STYLE_NONE); } } else { if (item.highlightKey != null) fStore.setValue(item.highlightKey, false); if (item.textKey != null) { fStore.setValue(item.textKey, true); if (item.textStyleKey != null) fStore.setValue(item.textStyleKey, decoration[1]); } } } fAnnotationTypeViewer.refresh(item); } });
@Override public void selectionChanged(SelectionChangedEvent event) { String[] decoration= (String[]) ((IStructuredSelection) fDecorationViewer.getSelection()).getFirstElement(); ListItem item= getSelectedItem(); if (fShowInTextCheckBox.getSelection()) { if (HIGHLIGHT.equals(decoration)) { fStore.setValue(item.highlightKey, true); if (item.textKey != null) { fStore.setValue(item.textKey, false); if (item.textStyleKey != null) fStore.setValue(item.textStyleKey, AnnotationPreference.STYLE_NONE); } } else { if (item.highlightKey != null) fStore.setValue(item.highlightKey, false); if (item.textKey != null) { fStore.setValue(item.textKey, true); if (item.textStyleKey != null) fStore.setValue(item.textStyleKey, decoration[1]); } } } fAnnotationTypeViewer.refresh(item); } });
/** * Applies the currently selected value and deactiavates the cell editor */ void applyEditorValueAndDeactivate() { // must set the selection before getting value ISelection selection = viewer.getSelection(); if (selection.isEmpty()) { selectedValue = null; } else { selectedValue = ((IStructuredSelection) selection) .getFirstElement(); } Object newValue = doGetValue(); markDirty(); boolean isValid = isCorrect(newValue); setValueValid(isValid); if (!isValid) { MessageFormat.format(getErrorMessage(), new Object[] { selectedValue }); } fireApplyEditorValue(); deactivate(); }
/** * Applies the currently selected value and deactiavates the cell editor */ void applyEditorValueAndDeactivate() { // must set the selection before getting value ISelection selection = viewer.getSelection(); if (selection.isEmpty()) { selectedValue = null; } else { selectedValue = ((IStructuredSelection) selection) .getFirstElement(); } Object newValue = doGetValue(); markDirty(); boolean isValid = isCorrect(newValue); setValueValid(isValid); if (!isValid) { MessageFormat.format(getErrorMessage(), new Object[] { selectedValue }); } fireApplyEditorValue(); deactivate(); }
/** Sets the focus to the table component. */ public void setVisible(boolean visible) { super.setVisible(visible); if(visible) { ArchetypeManager archetypeManager = MavenPluginActivator.getDefault().getArchetypeManager(); String catalogId = dialogSettings.get(KEY_CATALOG); catalogFactory = null; if(catalogId != null && !catalogId.equals(ALL_CATALOGS)) { catalogFactory = archetypeManager.getArchetypeCatalogFactory(catalogId); } if(catalogsComboViewer.getSelection().isEmpty()) { catalogsComboViewer .setSelection(new StructuredSelection(catalogFactory == null ? ALL_CATALOGS : catalogFactory)); } viewer.getTable().setFocus(); Archetype selected = getArchetype(); if(selected != null) { viewer.reveal(selected); } } else { if(job != null) { job.cancel(); job = null; } } }