|
Eclipse Platform Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IMarker
Markers are a general mechanism for associating notes and meta-data with resources.
Markers themselves are handles in the same way as IResources
are handles. Instances of IMarker
do not hold the attributes
themselves but rather uniquely refer to the attribute container. As such,
their state may change underneath the handle with no warning to the holder
of the handle.
Each marker has:
"org.eclipse.core.resources.taskmarker"
), The resources plug-in defines five standard types:
org.eclipse.core.resources.marker
org.eclipse.core.resources.taskmarker
org.eclipse.core.resources.problemmarker
org.eclipse.core.resources.bookmark
org.eclipse.core.resources.textmarker
org.eclipse.core.resources.markers
) into which other
plug-ins can install marker type declaration extensions.
Marker types are declared within a multiple inheritance type system.
New markers are defined in the plugin.xml
file of the
declaring plug-in. A valid declaration contains elements as defined by
the extension point DTD:
All markers declared as persistent
are saved when the
workspace is saved, except those explicitly set as transient (the
TRANSIENT
attribute is set as true
). A plug-in
which defines a persistent marker is not directly involved in saving and
restoring the marker. Markers are not under version and configuration
management, and cannot be shared via VCM repositories.
This interface is not intended to be implemented by developers.
Markers implement the IAdaptable
interface;
extensions are managed by the platform's adapter manager.
Field Summary | |
---|---|
static java.lang.String |
BOOKMARK
Bookmark marker type. |
static java.lang.String |
CHAR_END
Character end marker attribute. |
static java.lang.String |
CHAR_START
Character start marker attribute. |
static java.lang.String |
DONE
Done marker attribute. |
static java.lang.String |
LINE_NUMBER
Line number marker attribute. |
static java.lang.String |
LOCATION
Location marker attribute. |
static java.lang.String |
MARKER
Base marker type. |
static java.lang.String |
MESSAGE
Message marker attribute. |
static java.lang.String |
PRIORITY
Priority marker attribute. |
static int |
PRIORITY_HIGH
High priority constant (value 2). |
static int |
PRIORITY_LOW
Low priority constant (value 0). |
static int |
PRIORITY_NORMAL
Normal priority constant (value 1). |
static java.lang.String |
PROBLEM
Problem marker type. |
static java.lang.String |
SEVERITY
Severity marker attribute. |
static int |
SEVERITY_ERROR
Error severity constant (value 2) indicating an error state. |
static int |
SEVERITY_INFO
Info severity constant (value 0) indicating information only. |
static int |
SEVERITY_WARNING
Warning severity constant (value 1) indicating a warning. |
static java.lang.String |
TASK
Task marker type. |
static java.lang.String |
TEXT
Text marker type. |
static java.lang.String |
TRANSIENT
Transient marker attribute. |
static java.lang.String |
USER_EDITABLE
User editable marker attribute. |
Method Summary | |
---|---|
void |
delete()
Deletes this marker from its associated resource. |
boolean |
equals(java.lang.Object object)
Tests this marker for equality with the given object. |
boolean |
exists()
Returns whether this marker exists in the workspace. |
java.lang.Object |
getAttribute(java.lang.String attributeName)
Returns the attribute with the given name. |
boolean |
getAttribute(java.lang.String attributeName,
boolean defaultValue)
Returns the boolean-valued attribute with the given name. |
int |
getAttribute(java.lang.String attributeName,
int defaultValue)
Returns the integer-valued attribute with the given name. |
java.lang.String |
getAttribute(java.lang.String attributeName,
java.lang.String defaultValue)
Returns the string-valued attribute with the given name. |
java.util.Map |
getAttributes()
Returns a map with all the attributes for the marker. |
java.lang.Object[] |
getAttributes(java.lang.String[] attributeNames)
Returns the attributes with the given names. |
long |
getCreationTime()
Returns the time at which this marker was created. |
long |
getId()
Returns the id of the marker. |
IResource |
getResource()
Returns the resource with which this marker is associated. |
java.lang.String |
getType()
Returns the type of this marker. |
boolean |
isSubtypeOf(java.lang.String superType)
Returns whether the type of this marker is considered to be a sub-type of the given marker type. |
void |
setAttribute(java.lang.String attributeName,
boolean value)
Sets the boolean-valued attribute with the given name. |
void |
setAttribute(java.lang.String attributeName,
int value)
Sets the integer-valued attribute with the given name. |
void |
setAttribute(java.lang.String attributeName,
java.lang.Object value)
Sets the attribute with the given name. |
void |
setAttributes(java.util.Map attributes)
Sets the attributes for this marker to be the ones contained in the given table. |
void |
setAttributes(java.lang.String[] attributeNames,
java.lang.Object[] values)
Sets the given attribute key-value pairs on this marker. |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
---|
getAdapter |
Field Detail |
---|
static final java.lang.String MARKER
getType()
,
Constant Field Valuesstatic final java.lang.String TASK
getType()
,
Constant Field Valuesstatic final java.lang.String PROBLEM
getType()
,
Constant Field Valuesstatic final java.lang.String TEXT
getType()
,
Constant Field Valuesstatic final java.lang.String BOOKMARK
getType()
,
Constant Field Valuesstatic final java.lang.String SEVERITY
SEVERITY_ERROR
,
SEVERITY_WARNING
,
SEVERITY_INFO
,
getAttribute(String, int)
,
Constant Field Valuesstatic final java.lang.String MESSAGE
getAttribute(String, String)
,
Constant Field Valuesstatic final java.lang.String LOCATION
getAttribute(String, String)
,
Constant Field Valuesstatic final java.lang.String PRIORITY
PRIORITY_HIGH
,
PRIORITY_NORMAL
,
PRIORITY_LOW
,
getAttribute(String, int)
,
Constant Field Valuesstatic final java.lang.String DONE
getAttribute(String, String)
,
Constant Field Valuesstatic final java.lang.String CHAR_START
getAttribute(String, String)
,
Constant Field Valuesstatic final java.lang.String CHAR_END
getAttribute(String, String)
,
Constant Field Valuesstatic final java.lang.String LINE_NUMBER
getAttribute(String, String)
,
Constant Field Valuesstatic final java.lang.String TRANSIENT
getAttribute(String, String)
,
Constant Field Valuesstatic final java.lang.String USER_EDITABLE
true
. Note that the value of this attribute
is to be used by the UI as a suggestion and its value will NOT be
interpreted by Core in any manner and will not be enforced by Core
when performing any operations on markers.
getAttribute(String, String)
,
Constant Field Valuesstatic final int PRIORITY_HIGH
getAttribute(String, int)
,
Constant Field Valuesstatic final int PRIORITY_NORMAL
getAttribute(String, int)
,
Constant Field Valuesstatic final int PRIORITY_LOW
getAttribute(String, int)
,
Constant Field Valuesstatic final int SEVERITY_ERROR
getAttribute(String, int)
,
Constant Field Valuesstatic final int SEVERITY_WARNING
getAttribute(String, int)
,
Constant Field Valuesstatic final int SEVERITY_INFO
getAttribute(String, int)
,
Constant Field ValuesMethod Detail |
---|
void delete() throws CoreException
CoreException
- if this marker could not be deleted. Reasons include:
IResourceChangeEvent
for more details.IResourceRuleFactory.markerRule(IResource)
boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- the other object
boolean exists()
true
if this marker exists, otherwise
false
java.lang.Object getAttribute(java.lang.String attributeName) throws CoreException
String
, Integer
,
or Boolean
.
Returns null
if the attribute is undefined.
attributeName
- the name of the attribute
null
if the attribute is undefined.
CoreException
- if this method fails. Reasons include:
int getAttribute(java.lang.String attributeName, int defaultValue)
attributeName
- the name of the attributedefaultValue
- the value to use if no value is found
java.lang.String getAttribute(java.lang.String attributeName, java.lang.String defaultValue)
attributeName
- the name of the attributedefaultValue
- the value to use if no value is found
boolean getAttribute(java.lang.String attributeName, boolean defaultValue)
attributeName
- the name of the attributedefaultValue
- the value to use if no value is found
java.util.Map getAttributes() throws CoreException
null
is returned.
String
value type : String
, Integer
, or
Boolean
) or null
.
CoreException
- if this method fails. Reasons include:
java.lang.Object[] getAttributes(java.lang.String[] attributeNames) throws CoreException
null
or an instance of one
of the following classes: String
, Integer
,
or Boolean
.
attributeNames
- the names of the attributes
CoreException
- if this method fails. Reasons include:
long getCreationTime() throws CoreException
0L
if the creation time is not known (this can occur in workspaces created using v2.0 or earlier).
CoreException
- if this method fails. Reasons include:
long getId()
IResource.findMarker(long)
IResource getResource()
java.lang.String getType() throws CoreException
null
.
CoreException
- if this method fails. Reasons include:
boolean isSubtypeOf(java.lang.String superType) throws CoreException
true
if the marker's type
is the same as (or a sub-type of) the given type.
CoreException
- if this method fails. Reasons include:
void setAttribute(java.lang.String attributeName, int value) throws CoreException
This method changes resources; these changes will be reported in a subsequent resource change event, including an indication that this marker has been modified.
attributeName
- the name of the attributevalue
- the value
CoreException
- if this method fails. Reasons include:
IResourceChangeEvent
for more details.IResourceRuleFactory.markerRule(IResource)
void setAttribute(java.lang.String attributeName, java.lang.Object value) throws CoreException
null
or
an instance of one of the following classes:
String
, Integer
, or Boolean
.
If the value is null
, the attribute is considered to be undefined.
This method changes resources; these changes will be reported in a subsequent resource change event, including an indication that this marker has been modified.
attributeName
- the name of the attributevalue
- the value, or null
if the attribute is to be undefined
CoreException
- if this method fails. Reasons include:
IResourceChangeEvent
for more details.IResourceRuleFactory.markerRule(IResource)
void setAttribute(java.lang.String attributeName, boolean value) throws CoreException
This method changes resources; these changes will be reported in a subsequent resource change event, including an indication that this marker has been modified.
attributeName
- the name of the attributevalue
- the value
CoreException
- if this method fails. Reasons include:
IResourceChangeEvent
for more details.IResourceRuleFactory.markerRule(IResource)
void setAttributes(java.lang.String[] attributeNames, java.lang.Object[] values) throws CoreException
null
or an instance of
one of the following classes: String
,
Integer
, or Boolean
.
If a value is null
, the new value of the
attribute is considered to be undefined.
This method changes resources; these changes will be reported in a subsequent resource change event, including an indication that this marker has been modified.
attributeNames
- an array of attribute namesvalues
- an array of attribute values
CoreException
- if this method fails. Reasons include:
IResourceChangeEvent
for more details.IResourceRuleFactory.markerRule(IResource)
void setAttributes(java.util.Map attributes) throws CoreException
String
, Integer
, or Boolean
.
Attributes previously set on the marker but not included in the given map
are considered to be removals. Setting the given map to be null
is equivalent to removing all marker attributes.
This method changes resources; these changes will be reported in a subsequent resource change event, including an indication that this marker has been modified.
attributes
- a map of attribute names to attribute values
(key type : String
value type : String
,
Integer
, or Boolean
) or null
CoreException
- if this method fails. Reasons include:
IResourceChangeEvent
for more details.IResourceRuleFactory.markerRule(IResource)
|
Eclipse Platform Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.