Bug 24212 [Tasks view] Support read-only tasks in Task list
JDT has now support for generating tasks from source, e.g. //TODO will add a task and show it in the task list. Such tasks can only be edited and changed in the source code. For this reason we would like to have support in the task list for such non-modifiable tasks. For example, we could add a marker attribute "read-only" and if this attribute is set then menu actions to delete or change the task will be disabled.
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/tasklist/MarkerUtil.java
}
/**
 * Returns the text for the line and location column given the line number and location text.
 */
public static String getLineAndLocation(int lineNumber, String location) {
	if (lineNumber == -1) {
		if (location.equals("")) {
			return "";
		}
		else {
			return location;
		}
	}
	else {
		if (location.equals("")) {
			return line.format(new Object[] { Integer.toString(lineNumber) });
		}
		else {
			return lineAndLocation.format(new Object[] { Integer.toString(lineNumber), location });
		}
	}
}
/**
 * Returns the line number of the given marker.
 */
public static int getLineNumber(IMarker marker) {
	return marker.getAttribute(IMarker.LINE_NUMBER, -1);
}
/**
 * Returns the text for the location field.