/** @return the currently selected theme or null if there are no themes */ private ITheme getSelectedTheme() { return (ITheme) (themeIdCombo.getStructuredSelection().getFirstElement()); }
public Object getSelection() { return fComboViewer.getStructuredSelection().getFirstElement(); } }
private ColorsAndFontsTheme getSelectedColorsAndFontsTheme() { return (ColorsAndFontsTheme) colorsAndFontsThemeCombo.getStructuredSelection().getFirstElement(); }
@Override public void widgetSelected(SelectionEvent event) { IStructuredSelection selection = viewer.getStructuredSelection(); if (selection.isEmpty()) { selectedValue = null; } else { selectedValue = selection.getFirstElement(); } } });
/** * Return the selected file system. * @return FileSystemElement or <code>null</code> if nothing * is selected. */ public FileSystemElement getSelectedFileSystem() { IStructuredSelection selection = fileSystems.getStructuredSelection(); if (selection.size() == 1) { return ((FileSystemElement) selection.getFirstElement()); } return null; }
private void scanImages() { if (repository != null) { repository.cancel(); } // reset UI components mUIJob.reset(); lblPath.setText(""); //$NON-NLS-1$ lblPlugin.setText(""); //$NON-NLS-1$ lblWidth.setText(""); //$NON-NLS-1$ lblHeight.setText(""); //$NON-NLS-1$ txtReference.setText(""); //$NON-NLS-1$ // first dispose controls for (final Control control : imageComposite.getChildren()) { control.dispose(); } // then dispose images used in controls disposeImages(); // set maximum image counter maxImages = spinMaxImages.getSelection(); imageIndex = 0; // initialize scan job IStructuredSelection ssel = sourceCombo.getStructuredSelection(); if (!ssel.isEmpty()) { repository = (AbstractRepository) ssel.getFirstElement(); repository.schedule(); } }
/** * Applies the currently selected value and deactiavates the cell editor */ void applyEditorValueAndDeactivate() { // must set the selection before getting value IStructuredSelection selection = viewer.getStructuredSelection(); if (selection.isEmpty()) { selectedValue = null; } else { selectedValue = selection.getFirstElement(); } Object newValue = doGetValue(); markDirty(); boolean isValid = isCorrect(newValue); setValueValid(isValid); if (!isValid) { MessageFormat.format(getErrorMessage(), selectedValue); } fireApplyEditorValue(); deactivate(); }