當前位置: 首頁>>代碼示例>>Java>>正文


Java IResourceDelta.getMarkerDeltas方法代碼示例

本文整理匯總了Java中org.eclipse.core.resources.IResourceDelta.getMarkerDeltas方法的典型用法代碼示例。如果您正苦於以下問題:Java IResourceDelta.getMarkerDeltas方法的具體用法?Java IResourceDelta.getMarkerDeltas怎麽用?Java IResourceDelta.getMarkerDeltas使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.core.resources.IResourceDelta的用法示例。


在下文中一共展示了IResourceDelta.getMarkerDeltas方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isProblemDelta

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的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

示例2: isErrorDelta

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
private boolean isErrorDelta(IResourceDelta delta)
{
	if ((delta.getFlags() & IResourceDelta.MARKERS) != 0)
	{
		IMarkerDelta[] markerDeltas = delta.getMarkerDeltas();
		for (int i = 0; i < markerDeltas.length; i++)
		{
			if (markerDeltas[i].isSubtypeOf(IMarker.PROBLEM))
			{
				int kind = markerDeltas[i].getKind();
				if (kind == IResourceDelta.ADDED || kind == IResourceDelta.REMOVED)
				{
					return true;
				}
				int severity = markerDeltas[i].getAttribute(IMarker.SEVERITY, -1);
				int newSeverity = markerDeltas[i].getMarker().getAttribute(IMarker.SEVERITY, -1);
				if (newSeverity != severity)
				{
					return true;
				}
			}
		}
	}
	return false;
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:26,代碼來源:ProblemMarkerManager.java

示例3: visit

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
/**
 * Update the BibtextEntryView when markers change.
 */
public boolean visit(IResourceDelta delta) throws CoreException {
	if(delta == null) {
		return false;
	}

	IMarkerDelta[] markerDeltas = delta.getMarkerDeltas();

	if(markerDeltas.length > 0){
		Display.getDefault().asyncExec(new Runnable() {
			public void run() {
				refreshAction.run();
			}
		});
	}
	return true;
}
 
開發者ID:sebastiangoetz,項目名稱:slr-toolkit,代碼行數:20,代碼來源:BibtexEntryView.java

示例4: getSortedMarkerDelta

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
private IMarkerDelta[] getSortedMarkerDelta(final IResourceDelta delta) {
	IMarkerDelta[] markerDeltas = delta.getMarkerDeltas();
	//sort IResourceDelta.CHANGED > IResourceDelta.REMOVED > IResourceDelta.ADDED 
	Arrays.sort(markerDeltas, new Comparator<IMarkerDelta>(){
		@Override
		public int compare(IMarkerDelta o1, IMarkerDelta o2) {
			return -((Integer)o1.getKind()).compareTo(o2.getKind());
		}
	});

	return markerDeltas;
}
 
開發者ID:Yakindu,項目名稱:statecharts,代碼行數:13,代碼來源:DefaultResourceChangeToIssueProcessor.java

示例5: visit

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的package包/類
@Override
public boolean visit(final IResourceDelta delta) {
	final 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.");
			final 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");
				final IMarkerDelta[] markers = delta.getMarkerDeltas();
				// if interested in markers, check these deltas
			}
			break;
	}
	return true; // visit the children
}
 
開發者ID:gama-platform,項目名稱:gama,代碼行數:35,代碼來源:ResourceChangeReporter.java

示例6: visit

import org.eclipse.core.resources.IResourceDelta; //導入方法依賴的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


注:本文中的org.eclipse.core.resources.IResourceDelta.getMarkerDeltas方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。