Bug 31292 sort members: 2 dialogs if file read-only [code manipulation]
20030206 all other source actions show 1 error dialog if file is read-only this action shows 2
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/SortMembersAction.java
MessageDialog.openInformation(shell, getDialogTitle(), ActionMessages.getString("SortMembersAction.not_applicable")); 
	}
	
	
	private boolean containsRelevantMarkers(IEditorPart editor) {
		IAnnotationModel model= JavaUI.getDocumentProvider().getAnnotationModel(editor.getEditorInput());
		Iterator iterator= model.getAnnotationIterator();
		while (iterator.hasNext()) {
			Object element= iterator.next();
			if (element instanceof IJavaAnnotation) {
				IJavaAnnotation annot= (IJavaAnnotation) element;
				if (annot.isRelevant() && !annot.isTemporary()) {
					AnnotationType type= annot.getAnnotationType();
					return (type == AnnotationType.BOOKMARK || type == AnnotationType.TASK || type == AnnotationType.UNKNOWN);
				}
			}
		}		
		return false;
	}
	
	private void run(Shell shell, ICompilationUnit cu, IEditorPart editor) {
		if (!ActionUtil.isProcessable(getShell(), cu)) {
			return;
		}		
		
		if (containsRelevantMarkers(editor)) {
			if (!MessageDialog.openConfirm(getShell(), getDialogTitle(), ActionMessages.getString("SortMembersAction.containsmarkers"))) { 
				return;
			}
		}