Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IMarker


    {
        assert attributes != null;

        try
        {
            IMarker marker = resource.createMarker(type);
            marker.setAttributes(attributes);
        }
        catch (CoreException e)
        {
            // should not happen
            log.log(StatusFactory.createError(pluginId, "unable to create marker", e));
View Full Code Here


   * based upon the properties of the underlying marker.
   */
  protected void initialize() {
   
    fImageType= NO_IMAGE;
    IMarker marker= getMarker();

    if (MarkerUtilities.isMarkerType(marker, IBreakpoint.BREAKPOINT_MARKER)) {

      if (fPresentation == null)
        fPresentation= DebugUITools.newDebugModelPresentation();

      setImage(null); // see bug 32469
      setLayer(4);
      fImageType= BREAKPOINT_IMAGE;

      fType= AnnotationType.UNKNOWN;

    } else {

      fType= AnnotationType.UNKNOWN;
      if (marker.exists()) {
        try {

          if (marker.isSubtypeOf(Constants.PROBLEM_MARKER)) {
            int severity= marker.getAttribute(IMarker.SEVERITY, -1);
            switch (severity) {
              case IMarker.SEVERITY_ERROR:
                fType= AnnotationType.ERROR;
                break;
              case IMarker.SEVERITY_WARNING:
                fType= AnnotationType.WARNING;
                break;
            }
          } else if (marker.isSubtypeOf(IMarker.TASK))
            fType= AnnotationType.TASK;
            else if (marker.isSubtypeOf(IMarker.BOOKMARK))
            fType= AnnotationType.BOOKMARK;
            else if (marker.isSubtypeOf(IMarker.TEXT))
            fType=AnnotationType.OCCURRENCE;

        } catch(CoreException e) {
          //PerlDebugPlugin.log(e);
        }
View Full Code Here

 
  /*
   * @see IJavaAnnotation#getMessage()
   */
  public String getMessage() {
    IMarker marker= getMarker();
    if (marker == null || !marker.exists())
      return ""; //$NON-NLS-1$
    else
      return marker.getAttribute(IMarker.MESSAGE, ""); //$NON-NLS-1$
  }
View Full Code Here

   */
  public Image getImage(Display display) {
    if (fImageType == BREAKPOINT_IMAGE) {
      Image result= super.getImage(display);
      if (result == null) {
        IMarker marker= getMarker();
        if (marker != null && marker.exists()) {
          result= fPresentation.getImage(getMarker());
          setImage(result);
        }
      }
      return result;
View Full Code Here

  public static List getMarkersForLine(IResource resource, int aLine) {
    List markers = new ArrayList();
    try {
      IMarker[] allMarkers = resource.findMarkers(null, true, IResource.DEPTH_ONE);
      for(int i = 0; i < allMarkers.length; i++) {
        IMarker marker = allMarkers[i];
                Integer lineNr = (Integer) marker.getAttribute(IMarker.LINE_NUMBER);
        if(lineNr != null && lineNr.intValue() == aLine) {
          markers.add(marker);
        }
      }
    } catch (Exception e) {
View Full Code Here

         * gather all marker changes from the delta. be sure to do this in the
         * calling thread, as the delta is destroyed when this method returns
         */
        IMarkerDelta[] markerDeltas = event.findMarkerDeltas(FindBugsMarker.NAME, true);
        for (IMarkerDelta mdelta : markerDeltas) {
            IMarker marker = mdelta.getMarker();
            if (marker == null) {
                continue;
            }
            DeltaInfo deltaInfo = new DeltaInfo(marker, mdelta.getKind());
            if (BugContentProvider.DEBUG) {
View Full Code Here

    public void selectionChanged(IWorkbenchPart thePart, ISelection theSelection) {
        if (thePart == handler || !handler.isVisible()) {
            return;
        }
        IMarker marker = MarkerUtil.getMarkerFromSingleSelection(theSelection);
        // only handle a null if it's from the bug explorer. this way if the
        // user
        // selects a bug pattern or other "folder" in the tree, the annotation
        // view
        // and the property view are cleared. BUT if the user clicks into
View Full Code Here

                    || adaptableObject instanceof DetectorFactory || adaptableObject instanceof Plugin
                    || adaptableObject instanceof BugInstance.XmlProps || adaptableObject instanceof BugGroup
                    || adaptableObject instanceof BugAnnotation) {
                return new PropertySource(adaptableObject);
            }
            IMarker marker = Util.getAdapter(IMarker.class, adaptableObject);
            if (!MarkerUtil.isFindBugsMarker(marker)) {
                return null;
            }
            return new MarkerPropertySource(marker);
        }
View Full Code Here

                return imageRegistry.get(prio.iconName());
            }

        }
        if (element instanceof IMarker) {
            IMarker marker = (IMarker) element;
            if (!marker.exists()) {
                return null;
            }
        }
        return wbProvider.getImage(element);
    }
View Full Code Here

                str += " - " + cloudName;
            }
            return str;
        }
        if (element instanceof IMarker) {
            IMarker marker = (IMarker) element;
            if (!marker.exists()) {
                return null;
            }
        }
        if (element instanceof IStructuredSelection) {
            return getDescriptionAndBugCount(((IStructuredSelection) element).toArray());
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.IMarker

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.