Bug 17598 Source->Generate Getter and Setter enabled for read only file
F1 This action is enabled for read-only files. Executing it shows a dialog saying that the file is read-only. The action should be disabled since all other source actions are disabled as well.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
import org.eclipse.jdt.internal.ui.preferences.CodeGenerationPreferencePage;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider;
import org.eclipse.jdt.internal.ui.viewsupport.JavaElementLabels;
/**
 * Create Getter and Setter for selected fields.
 * Will open the parent compilation unit in the editor.
 * The result is unsaved, so the user can decide if the
 * changes are acceptable.
 * 
 * <p>
 * This class may be instantiated; it is not intended to be subclassed.
 * </p>
 *
 * @since 2.0
 */
public class AddGetterSetterAction extends SelectionDispatchAction {
	
	private CompilationUnitEditor fEditor;
	private static final String dialogTitle= ActionMessages.getString("AddGetterSetterAction.error.title"); 
	/**
	 * Creates a new <code>AddGetterSetterAction</code>.
	 * 
	 * @param site the site providing context information for this action
	 */
	public AddGetterSetterAction(IWorkbenchSite site) {
		super(site);
		setText(ActionMessages.getString("AddGetterSetterAction.label")); 
		setDescription(ActionMessages.getString("AddGetterSetterAction.description")); 
		setToolTipText(ActionMessages.getString("AddGetterSetterAction.tooltip"));