本文整理匯總了Java中org.eclipse.core.resources.IContainer.equals方法的典型用法代碼示例。如果您正苦於以下問題:Java IContainer.equals方法的具體用法?Java IContainer.equals怎麽用?Java IContainer.equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.core.resources.IContainer
的用法示例。
在下文中一共展示了IContainer.equals方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: fix
import org.eclipse.core.resources.IContainer; //導入方法依賴的package包/類
private void fix(IMarker marker,IWorkbenchWindow ww,IProgressMonitor monitor) {
IResource resource = marker.getResource();
if (resource instanceof IFile) {
try {
IFile file = (IFile) resource;
buildFile = BuildPolicyManager.createBuildPoliciesFile(file,monitor);
marker.delete();
// remove all markers with this problem. The above
// resolution fixes also all others of the same type
IProject project = file.getProject();
IMarker[] markers = project.findMarkers(GW4EBuilder.MARKER_TYPE, true, IResource.DEPTH_INFINITE);
IContainer container = file.getParent();
for (int i = 0; i < markers.length; i++) {
IMarker m = markers[i];
IResource r = m.getResource();
if (r instanceof IFile) {
IFile f = (IFile) resource;
IContainer c = f.getParent();
if (c.equals(container) && m.exists()) {
Object attr = m.getAttribute(IJavaModelMarker.ID);
Integer pbid = (Integer) attr;
if (pbid == null)
continue;
if (pbid.equals(GW4EParser.MISSING_BUILD_POLICIES_FILE)) {
m.delete();
}
}
}
}
Display.getDefault().syncExec(new Runnable () {
@Override
public void run() {
JDTManager.openEditor(buildFile, ww);
ResourceManager.touchFolderResources(file);
}
});
} catch (Exception e) {
ResourceManager.logException(e);
}
}
}