org.eclipse.ui.views.markers.MarkerItem Java Examples

The following examples show how to use org.eclipse.ui.views.markers.MarkerItem. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GamlDescriptionMarkerField.java    From gama with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void update(final ViewerCell cell) {
	final MarkerItem item = (MarkerItem) cell.getElement();
	Image image = null;
	if (item.getMarker() == null) {
		image = GamlMarkerImageProvider.getImage(item.getAttributeValue(IMarker.MESSAGE, "")).image();
	} else {
		try {
			if (item.getMarker().isSubtypeOf(IMarker.TASK)) {
				image = GamlMarkerImageProvider.getImage(-1).image();
			} else {
				image = GamlMarkerImageProvider
						.getImage(item.getMarker().getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING))
						.image();
			}
		} catch (final CoreException e) {
			// e.printStackTrace();
		}
	}

	cell.setText(getValue(item));
	cell.setImage(image);
}
 
Example #2
Source File: TestabilityResourceMarkerField.java    From testability-explorer with Apache License 2.0 5 votes vote down vote up
@Override
public String getValue(MarkerItem item) {
  IMarker marker = item.getMarker();
  if (marker != null) {
    IResource resource = marker.getResource();
    String name = resource.getName();
    return name;
  }
  return null;
}
 
Example #3
Source File: Resolved.java    From git-appraise-eclipse with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public String getValue(MarkerItem item) {
  String result =
      item.getAttributeValue(ReviewMarkerAttributes.REVIEW_RESOLVED_MARKER_ATTRIBUTE, "");
  if ("true".equals(result)) {
    return "yes";
  }
  return "";
}
 
Example #4
Source File: DateTime.java    From git-appraise-eclipse with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public String getValue(MarkerItem item) {
  String value =
      item.getAttributeValue(ReviewMarkerAttributes.REVIEW_DATETIME_MARKER_ATTRIBUTE, "");
  if (!value.isEmpty()) {
    DateFormat df = DateFormat.getDateTimeInstance();
    return df.format(Long.parseLong(value));
  }
  return "Unknown";
}
 
Example #5
Source File: TestabilityDescriptionMarkerField.java    From testability-explorer with Apache License 2.0 4 votes vote down vote up
@Override
public String getValue(MarkerItem item) {
  return item.getAttributeValue(IMarker.MESSAGE, "");
}
 
Example #6
Source File: TestabilityLineNumberMarkerField.java    From testability-explorer with Apache License 2.0 4 votes vote down vote up
@Override
public String getValue(MarkerItem item) {
  return item.getAttributeValue(IMarker.LINE_NUMBER, "");
}
 
Example #7
Source File: TestabilityIssueTypeMarkerField.java    From testability-explorer with Apache License 2.0 4 votes vote down vote up
@Override
public String getValue(MarkerItem item) {
  return item.getAttributeValue(TestabilityConstants.ISSUE_TYPE, "");
}
 
Example #8
Source File: TestabilityPathMarkerField.java    From testability-explorer with Apache License 2.0 4 votes vote down vote up
@Override
public String getValue(MarkerItem item) {
  return item.getPath();
}
 
Example #9
Source File: Author.java    From git-appraise-eclipse with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public String getValue(MarkerItem item) {
  return item.getAttributeValue(ReviewMarkerAttributes.REVIEW_AUTHOR_MARKER_ATTRIBUTE, "Unknown");
}