KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > text > PDEMarkerAnnotationModel


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.ui.editor.text;
12
13 import org.eclipse.core.resources.IMarker;
14 import org.eclipse.core.resources.IResource;
15 import org.eclipse.jface.text.quickassist.IQuickFixableAnnotation;
16 import org.eclipse.ui.texteditor.MarkerAnnotation;
17 import org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel;
18
19 public class PDEMarkerAnnotationModel extends ResourceMarkerAnnotationModel {
20
21     class PDEMarkerAnnotation extends MarkerAnnotation implements IQuickFixableAnnotation {
22         boolean quickFixableState;
23         boolean isQuickFixable;
24         public PDEMarkerAnnotation(IMarker marker) {
25             super(marker);
26         }
27
28         public void setQuickFixable(boolean state) {
29             isQuickFixable = state;
30             quickFixableState = true;
31         }
32
33         public boolean isQuickFixableStateSet() {
34             return quickFixableState;
35         }
36
37         public boolean isQuickFixable() {
38             return isQuickFixable;
39         }
40         
41     }
42     
43     public PDEMarkerAnnotationModel(IResource resource) {
44         super(resource);
45     }
46     
47     protected MarkerAnnotation createMarkerAnnotation(IMarker marker) {
48         return new PDEMarkerAnnotation(marker);
49     }
50 }
51
Popular Tags