|
Lines 13-18
Link Here
|
| 13 |
import org.eclipse.core.resources.IMarker; |
13 |
import org.eclipse.core.resources.IMarker; |
| 14 |
import org.eclipse.core.resources.IResource; |
14 |
import org.eclipse.core.resources.IResource; |
| 15 |
import org.eclipse.core.runtime.CoreException; |
15 |
import org.eclipse.core.runtime.CoreException; |
|
|
16 |
import org.eclipse.core.runtime.IAdaptable; |
| 16 |
|
17 |
|
| 17 |
/** |
18 |
/** |
| 18 |
* This is a concrete class that stores the same type of information as the IMarkers |
19 |
* This is a concrete class that stores the same type of information as the IMarkers |
|
Lines 21-27
Link Here
|
| 21 |
* in the problems view). This marker class stores the fields in the most efficient form |
22 |
* in the problems view). This marker class stores the fields in the most efficient form |
| 22 |
* for sorting and display, but necessarily removes some generality from IMarker. |
23 |
* for sorting and display, but necessarily removes some generality from IMarker. |
| 23 |
*/ |
24 |
*/ |
| 24 |
public class ConcreteMarker { |
25 |
public class ConcreteMarker implements IAdaptable { |
| 25 |
|
26 |
|
| 26 |
private String description; |
27 |
private String description; |
| 27 |
private String resourceName; |
28 |
private String resourceName; |
|
Lines 97-100
Link Here
|
| 97 |
public int hashCode() { |
98 |
public int hashCode() { |
| 98 |
return getMarker().hashCode(); |
99 |
return getMarker().hashCode(); |
| 99 |
} |
100 |
} |
|
|
101 |
|
| 102 |
|
| 103 |
/* (non-Javadoc) |
| 104 |
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) |
| 105 |
*/ |
| 106 |
public Object getAdapter(Class adapter) { |
| 107 |
|
| 108 |
// should adapt to IMarker to allow object contributions (bug 65464) |
| 109 |
if(IMarker.class == adapter) |
| 110 |
return getMarker(); |
| 111 |
|
| 112 |
return null; |
| 113 |
} |
| 100 |
} |
114 |
} |