当前位置: 首页>>代码示例>>Java>>正文


Java IMarkerDelta.getKind方法代码示例

本文整理汇总了Java中org.eclipse.core.resources.IMarkerDelta.getKind方法的典型用法代码示例。如果您正苦于以下问题:Java IMarkerDelta.getKind方法的具体用法?Java IMarkerDelta.getKind怎么用?Java IMarkerDelta.getKind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.resources.IMarkerDelta的用法示例。


在下文中一共展示了IMarkerDelta.getKind方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: breakpointChanged

import org.eclipse.core.resources.IMarkerDelta; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.debug.core.IBreakpointListener#breakpointChanged(org.eclipse.debug.core.model.IBreakpoint,
 *      org.eclipse.core.resources.IMarkerDelta)
 */
public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
	if (supportsBreakpoint(breakpoint)) {
		try {
			final URI uri = ((DSLBreakpoint)breakpoint).getURI();
			final IMarker marker = breakpoint.getMarker();
			for (Entry<String, Object> entry : delta.getAttributes().entrySet()) {
				final Object markerValue = marker.getAttribute(entry.getKey());
				final Object deltaValue = entry.getValue();
				if ((markerValue != null && !markerValue.equals(deltaValue)) || (deltaValue != null
						&& !deltaValue.equals(markerValue))) {
					if (delta.getKind() == IResourceDelta.ADDED) {
						factory.getDebugger().handleEvent(new ChangeBreakPointRequest(uri, entry.getKey(),
								(Serializable)deltaValue));
					} else {
						factory.getDebugger().handleEvent(new ChangeBreakPointRequest(uri, entry.getKey(),
								(Serializable)markerValue));
					}
				}
			}
		} catch (CoreException e) {
			Activator.getDefault().error(e);
		}
	}
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:31,代码来源:DSLDebugTargetAdapter.java

示例2: isProblemDelta

import org.eclipse.core.resources.IMarkerDelta; //导入方法依赖的package包/类
private boolean isProblemDelta(IResourceDelta delta) {
	if ((delta.getFlags() & IResourceDelta.MARKERS) == 0) {
		return false;
	}
	for (IMarkerDelta markerDelta : delta.getMarkerDeltas()) {
		if (markerDelta.isSubtypeOf(IMarker.PROBLEM)) {

			// Detect added/removed problem markers
			int kind = markerDelta.getKind();
			if (kind == IResourceDelta.ADDED || kind == IResourceDelta.REMOVED) {
				return true;
			}

			// Detect changes in problem marker severity
			int oldSeverity = markerDelta.getAttribute(IMarker.SEVERITY, -1);
			int newSeverity = markerDelta.getMarker().getAttribute(IMarker.SEVERITY, -1);
			if (newSeverity != oldSeverity) {
				return true;
			}
		}
	}
	return false;
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:24,代码来源:ProblemManager.java

示例3: dispatchMarkerDelta

import org.eclipse.core.resources.IMarkerDelta; //导入方法依赖的package包/类
protected void dispatchMarkerDelta(final IMarkerDelta iMarkerDelta, final String elementID) {
	switch (iMarkerDelta.getKind()) {
		case IResourceDelta.ADDED :
			addSCTIssue(iMarkerDelta, elementID);
			break;
		case IResourceDelta.REMOVED :
			removeSCTIssue(iMarkerDelta, elementID);
			break;
		case IResourceDelta.CHANGED :
			removeSCTIssue(iMarkerDelta, elementID);
			addSCTIssue(iMarkerDelta, elementID);
			break;
		default :
			break;
	}
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:17,代码来源:DefaultResourceChangeToIssueProcessor.java

示例4: isErrorDelta

import org.eclipse.core.resources.IMarkerDelta; //导入方法依赖的package包/类
private boolean isErrorDelta(IResourceDelta delta) {
    if ((delta.getFlags() & IResourceDelta.MARKERS) != 0) {
        IMarkerDelta[] markerDeltas = delta.getMarkerDeltas();
        for (int i = 0; i < markerDeltas.length; i++) {
            IMarkerDelta iMarkerDelta = markerDeltas[i];
            if (iMarkerDelta.isSubtypeOf(IMarker.PROBLEM)) {
                int kind = iMarkerDelta.getKind();
                if (kind == IResourceDelta.ADDED || kind == IResourceDelta.REMOVED) {
                    return true;
                }
                int severity = iMarkerDelta.getAttribute(IMarker.SEVERITY, -1);
                int newSeverity = iMarkerDelta.getMarker().getAttribute(IMarker.SEVERITY, -1);
                if (newSeverity != severity) {
                    return true;
                }
            }
        }
    }
    return false;
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:21,代码来源:ProblemMarkerManager.java

示例5: update

import org.eclipse.core.resources.IMarkerDelta; //导入方法依赖的package包/类
/**
 * Updates this model to the given marker deltas.
 * 
 * @param markerDeltas
 *            the array of marker deltas
 */
protected void update(IMarkerDelta[] markerDeltas)
{
	if (markerDeltas.length == 0)
	{
		return;
	}

	for (IMarkerDelta delta : markerDeltas)
	{
		switch (delta.getKind())
		{
			case IResourceDelta.ADDED:
				addMarkerAnnotation(delta.getMarker());
				break;
			case IResourceDelta.REMOVED:
				removeMarkerAnnotation(delta.getMarker());
				break;
			case IResourceDelta.CHANGED:
				modifyMarkerAnnotation(delta.getMarker());
				break;
			default:
				break;
		}
	}
	fireModelChanged();
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:33,代码来源:ExternalFileAnnotationModel.java

示例6: resourceChanged

import org.eclipse.core.resources.IMarkerDelta; //导入方法依赖的package包/类
@Override
public void resourceChanged(IResourceChangeEvent event) {
	if (planAdvisorMember == null) {
		// if PlanAdvisor.cleanup() has been called
		return;
	}
	IMarkerDelta[] markerDeltas = event.findMarkerDeltas(null, true);
	List<MarkerViolation> violations = new ArrayList<MarkerViolation>();
	boolean needUpdate = false;
	for (IMarkerDelta markerDelta : markerDeltas) {
		IResource resource = markerDelta.getResource();
		if (resource == null || !resource.exists() || !this.project.equals(resource.getProject())) {
			continue;
		}
		if ((markerDelta.getKind() == IResourceDelta.ADDED) ||
			(markerDelta.getKind() == IResourceDelta.CHANGED)) {
			IMarker marker = markerDelta.getMarker();
			if (!isViolationMarker(marker) && filter(marker)) {
				violations.add(new MarkerViolation(this, marker));
			}
		}
		if (markerDelta.getKind() == IResourceDelta.REMOVED) {
			needUpdate = true;
		}
	}
	if (!violations.isEmpty() || needUpdate) {
		List<Notification> notifications = Collections.<Notification>singletonList(new MarkerNotification(violations));
		if (planAdvisorMember != null) {
			planAdvisorMember.enqueue(notifications);
		}
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:33,代码来源:MarkerPlanAdvisor.java

示例7: resourceChanged

import org.eclipse.core.resources.IMarkerDelta; //导入方法依赖的package包/类
public void resourceChanged(IResourceChangeEvent event) {

        boolean postBuild = event.getType() == IResourceChangeEvent.POST_BUILD;
        boolean accepted = false;

        /*
         * 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) {
                System.out.println("resource change for: " + deltaInfo);
            }

            accepted |= refreshJob.addToQueue(deltaInfo);
        }

        if (!accepted) {
            return;
        }

        if (postBuild) {
            scheduleRefreshJob(SHORT_DELAY);
        } else {
            // After some time do updates anyways
            scheduleRefreshJob(LONG_DELAY);
        }
    }
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:35,代码来源:ResourceChangeListener.java

示例8: resourceChanged

import org.eclipse.core.resources.IMarkerDelta; //导入方法依赖的package包/类
@Override
public void resourceChanged(IResourceChangeEvent event) {
	IResourceDelta delta = event.getDelta();
	if(delta == null) {
		return;
	}
	
	IResource res = delta.getResource();
	if(res instanceof IWorkspaceRoot && (delta.getFlags() & IResourceDelta.MARKERS) != 0) {
		
		IMarkerDelta[] markerDeltas = delta.getMarkerDeltas();
		for (IMarkerDelta markerDelta : markerDeltas) {
			int kind = markerDelta.getKind();
			
			if(markerDelta.isSubtypeOf(CBREAKPOINT_MARKER_TYPE)) {
				
				if (kind == IResourceDelta.ADDED) {
					addMarkerAnnotation(markerDelta.getMarker());
				}
				
				if (kind == IResourceDelta.REMOVED) {
					removeMarkerAnnotation(markerDelta.getMarker());
				}
				
				if (kind == IResourceDelta.CHANGED) {
					updateMarkerAnnotation(markerDelta.getMarker());
				}
				
			}
		}
	}
}
 
开发者ID:GoClipse,项目名称:goclipse,代码行数:33,代码来源:ExternalBreakpointWatcher.java

示例9: visit

import org.eclipse.core.resources.IMarkerDelta; //导入方法依赖的package包/类
public boolean visit(IResourceDelta delta) {
  IResource res = delta.getResource();
  switch (delta.getKind()) {
    case IResourceDelta.ADDED:
      System.out.print("Resource ");
      System.out.print(res.getFullPath());
      System.out.println(" was added.");
      break;
    case IResourceDelta.REMOVED:
      System.out.print("Resource ");
      System.out.print(res.getFullPath());
      System.out.println(" was removed.");
      break;
    case IResourceDelta.CHANGED:
      System.out.print("Resource ");
      System.out.print(delta.getFullPath());
      System.out.println(" has changed.");
      int flags = delta.getFlags();
      if ((flags & IResourceDelta.CONTENT) != 0) {
        System.out.println("--> Content Change");
      }
      if ((flags & IResourceDelta.REPLACED) != 0) {
        System.out.println("--> Content Replaced");
      }
      if ((flags & IResourceDelta.MARKERS) != 0) {
        System.out.println("--> Marker Change");
        IMarkerDelta[] markers = delta.getMarkerDeltas();
        // if interested in markers, check these deltas
        for (IMarkerDelta iMarkerDelta : markers) {
          System.out.println(iMarkerDelta.getAttribute(IMarker.CHAR_START));
          switch (iMarkerDelta.getKind()) {
            case IResourceDelta.ADDED:
              System.out.println("Added");
              break;
            case IResourceDelta.REMOVED:
              System.out.println("Removed");
              break;
            case IResourceDelta.CHANGED:
              System.out.println("Changed");
              break;
          }
        }
      }
      break;
  }
  return true; // visit the children
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:48,代码来源:ResourceDeltaPrinter.java

示例10: breakpointChanged

import org.eclipse.core.resources.IMarkerDelta; //导入方法依赖的package包/类
@Override
public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
	if (delta == null) {//Ignore non marker events which come from BfBreakpoint.setInstalled
		return;
	}
	if (this.isTerminated()) {
		return;
	}
	try {
		if (breakpoint instanceof BfWatchpoint) {
			BfWatchpoint wp = (BfWatchpoint) breakpoint;
			if (wp.isEnabled() && DebugPlugin.getDefault().getBreakpointManager().isEnabled()) {
				this.process.getInterpreter().addWatchpoint(wp);
			}
			else {
				this.process.getInterpreter().removeWatchpoint(wp);
			}
			return;
		}
		BfBreakpoint bp = this.getValidBreakpoint(breakpoint);
		if (bp == null) {
			return;
		}
		if (delta.getKind() != IResourceDelta.CHANGED) {
			DbgActivator.getDefault().logError("Unexpected marker delta: " + delta, null);
			return;
		}
	
		int newLocation = bp.getCharStart();
		int oldLocation = delta.getAttribute(IMarker.CHAR_START, newLocation);
		
		if (bp.isEnabled() && DebugPlugin.getDefault().getBreakpointManager().isEnabled()) {
			if (!this.installedBreakpoints.contains(breakpoint)) {
				this.process.getInterpreter().addBreakpoint(newLocation);
				this.addInstalledBreakpoint(bp);
			}
			else if (newLocation != oldLocation) {
				this.process.getInterpreter().removeBreakpoint(oldLocation);
				this.process.getInterpreter().addBreakpoint(newLocation);
			}
		}
		else {
			this.process.getInterpreter().removeBreakpoint(oldLocation);
			this.removeInstalledBreakpoint(bp);
		}
	}
	catch (CoreException ex) {
		DbgActivator.getDefault().logError("Breakpoint could not be added", ex);
	}
	
}
 
开发者ID:RichardBirenheide,项目名称:brainfuck,代码行数:52,代码来源:BfDebugTarget.java

示例11: resourceChanged

import org.eclipse.core.resources.IMarkerDelta; //导入方法依赖的package包/类
@Override
public void resourceChanged(IResourceChangeEvent event) {
	IResource resource = CommonUtils.getAdapter(timeline, IResource.class);
	if (resource == null) {
		return;
	}
	Resource eResource = model.eResource();
	if (eResource == null) {
		return;
	}
	String uriFragment = eResource.getURIFragment(model);
	URI modelFragmentURI = URI.createURI(uriFragment.toString());
	boolean refresh = false;
	final boolean includeSubTypes = true;
	IMarkerDelta[] markerDeltas = event.findMarkerDeltas(IMarker.MARKER, includeSubTypes);
	for (IMarkerDelta delta : markerDeltas) {
		IResource markerResource = delta.getResource();
		if (CommonUtils.equals(resource, markerResource)) {
			try {
				Object attribute = null;
				if(delta.getKind() == IResourceDelta.REMOVED) {
					// get the old value of location, since the new value doesn't exist (marker deleted)
					attribute = delta.getAttribute(IMarker.LOCATION);
				} else {
					IMarker marker = delta.getMarker();
					attribute = marker.getAttribute(IMarker.LOCATION);
				}
				if (attribute != null) {
					String foreignFragment = attribute.toString();
					if (foreignFragment.startsWith(modelFragmentURI.toString())) {
						refresh = true;
						break;
					}
				}
			} catch (CoreException e) {
				String message = e.getMessage();
				if (!message.contains("Marker id") || !message.contains(" not found.")) {
					LogUtil.warn(e);
				}
			}
		}
	}		
	if (refresh) {
		WidgetUtils.runInDisplayThread(timeline.getControl(), new Runnable() {
			@Override
			public void run() {
				updateTitleVisual();
			}
		});
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:52,代码来源:TreeTimelineHeaderRowEditPart.java


注:本文中的org.eclipse.core.resources.IMarkerDelta.getKind方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。