/* (non-Javadoc) * Method declared on Dialog. */ @Override protected void buttonPressed(int buttonId) { if (buttonId == IDialogConstants.OK_ID) { value = Boolean.parseBoolean(combo.getText()); } super.buttonPressed(buttonId); }
/* * Method declared on Dialog. * * The main result is to set the preference field in a particular way, * according to the particular button pressed, but without updating the * underlying preferences node. Thus the effect of this method is to * change the field in the display without making the new value visible * to other fields. For th e new value to take effect it must be later * stored into the preferences node by some oher action (typically the * pressing of an Apply or OK button). * */ protected void buttonPressed(int buttonId) { switch (buttonId) { case COPY_ID: if (!field.isInherited()) break; String value = field.getComboBoxControl().getText(); prefUtils.setField(field, fieldHolder, value); break; case REMOVE_ID: // Can't clear a field that doesn't have a preference stored to start with; // the following is one way to check that. // Why would you do this if there weren't a preference stored? May want to // clear a field that was edited (or otherwise set) locally but not yet stored. if (field.getPreferencesLevel().equals(field.getLevelFromWhichLoaded())) { preferencesService.clearPreferenceAtLevel( field.getPreferencesLevel(), field.getPreferenceName()); } prefUtils.setField(field, fieldHolder); break; // case EMPTY_ID: // prefUtils.setField(field, fieldHolder, field.getEmptyValue()); // break; default: super.buttonPressed(buttonId); break; } close(); }
/* * (non-Javadoc) Method declared on Dialog. */ protected void buttonPressed(int buttonId) { if (buttonId == IDialogConstants.OK_ID) { if (this.absolutePathButton.getSelection()) { this.selectStr = this.pathList.get(0).toString(); } else if (this.anyLocationButton.getSelection()) { this.selectStr = this.pathList.get(1).toString(); } else this.selectStr = xmlPathField.getText(); } super.buttonPressed(buttonId); }
/** {@inheritDoc} */ protected void buttonPressed(final int buttonId) { if (buttonId == IDialogConstants.OK_ID) { fData.setRefactoringAware(true); final RefactoringDescriptorProxy[] descriptors = fHistoryControl.getCheckedDescriptors(); Set set = new HashSet(); IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); for (int index = 0; index < descriptors.length; index++) { final String project = descriptors[index].getProject(); if (project != null && !"".equals(project)) // $NON-NLS-1$ set.add(root.getProject(project)); } fData.setRefactoringProjects((IProject[]) set.toArray(new IProject[set.size()])); fData.setRefactoringDescriptors(descriptors); fData.setExportStructuralOnly(fExportStructural.getSelection()); final IDialogSettings settings = fSettings; if (settings != null) settings.put(SETTING_SORT, fHistoryControl.isSortByProjects()); } super.buttonPressed(buttonId); }