Bug 42143 Dialogs for source actions do not use dialog font [dialogs]
select a cu in package explorer context menu "Source": "Override/Implement methods..." "Generate Getters and Setters..." "Generate Delegate methods..." "Add constructor from superclass..." "Generate constructor using fields..."
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateNewConstructorUsingFieldsAction.java
this(editor.getEditorSite());
		fEditor= editor;
		setEnabled(checkEnabledEditor());
	}
	
	/* (non-Javadoc)
	 * Method declared on SelectionDispatchAction
	 */
	public void selectionChanged(IStructuredSelection selection) {
		try {
			setEnabled(canEnable(selection));
		} catch (JavaModelException e) {
			
			if (JavaModelUtil.filterNotPresentException(e))
				JavaPlugin.log(e);
			setEnabled(false);
		}
	}
	private boolean canEnable(IStructuredSelection selection) throws JavaModelException {
		if (getSelectedFields(selection) != null)
			return true;
		if ((selection.size() == 1) && (selection.getFirstElement() instanceof IType)) {
			IType type= (IType) selection.getFirstElement();
			return type.getCompilationUnit() != null && type.isClass();
			
		}
		if ((selection.size() == 1) && (selection.getFirstElement() instanceof ICompilationUnit))
			return true;
		return false;
	}