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


Java IFile.equals方法代碼示例

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


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

示例1: visit

import org.eclipse.core.resources.IFile; //導入方法依賴的package包/類
@Override
public boolean visit(IResourceDelta delta) throws CoreException
{
	IResource resource = delta.getResource();
	if( resource.isDerived() )
	{
		return false;
	}
	if( resource.getType() == IResource.FILE )
	{
		IFile file = (IFile) resource;
		IProject project = resource.getProject();
		if( file.equals(JPFProject.getManifest(project)) )
		{
			manifestChanged = true;
			return false;
		}
	}
	return true;
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:21,代碼來源:JPFManifestBuilder.java

示例2: handleFileDelta

import org.eclipse.core.resources.IFile; //導入方法依賴的package包/類
/**
 * Reacts to changes in files of interest to PDE
 */
@Override
protected void handleFileDelta(IResourceDelta delta)
{
	IFile file = (IFile) delta.getResource();
	IProject project = file.getProject();
	if( file.equals(JPFProject.getManifest(project)) )
	{
		handleBundleManifestDelta(file, delta);
	}
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:14,代碼來源:WorkspacePluginModelManager.java

示例3: closeEditor

import org.eclipse.core.resources.IFile; //導入方法依賴的package包/類
/**
 * Close the edited file, if any ...
 * 
 * @throws PartInitException
 */
public static void closeEditor(IFile file, IWorkbenchWindow aww) throws PartInitException {
	if (aww == null) {
		aww = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
	}
	IEditorReference[] references = aww.getActivePage().getEditorReferences();
	for (int i = 0; i < references.length; i++) {
		IEditorReference reference = references[i];
		IFile f = reference.getEditorInput().getAdapter(IFile.class);

		if (file.equals(f)) {
			reference.getPage().closeEditors(new IEditorReference[] { reference }, false);
		}
	}
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:20,代碼來源:ResourceManager.java

示例4: doIt

import org.eclipse.core.resources.IFile; //導入方法依賴的package包/類
private void doIt() {
	GraphSelection gs = GraphSelectionManager.ME.getSelection();
	ISelection selection = gs.getCurrentSelection();
	if (selection instanceof IStructuredSelection) {
		IStructuredSelection sel = (IStructuredSelection) selection;
		if (sel.getFirstElement() instanceof SharedVertexPart) {
			SharedVertexPart vp = (SharedVertexPart) sel.getFirstElement();
			SharedVertex sv = (SharedVertex) vp.getModel();
			String sharedName = sv.getSharedName();
			IProject project = sv.getGraph().getProject();
			IWorkbenchWindow ww = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
			IWorkbenchPage page = ww.getActivePage();
			List<IFile> files = null;
			IContainer container = null;
			if (onlyProject) {
				container = project;
			} else {
				container = org.gw4e.eclipse.facade.ResourceManager.getWorkspaceRoot();
			}
			try {
				files = GraphWalkerFacade.getSharedGraphModels(sharedName, container);
			} catch (Exception ex) {
				org.gw4e.eclipse.facade.ResourceManager.logException(ex,
						"Error while looking for shared context");
			}
			for (IFile iFile : files) {
				try {
					if (iFile.equals(sv.getGraph().getFile()))
						continue;
					if (iFile.getFileExtension().equalsIgnoreCase(Constant.GRAPHML_FILE)
							&& !PreferenceManager.openSharedGraphmlFile())
						continue;
					page.openEditor(new FileEditorInput(iFile),
							org.gw4e.eclipse.preferences.PreferenceManager.getGW4EEditorName());
				} catch (PartInitException exception) {
					ResourceManager.logException(exception, "Unable to open " + iFile);
				}
			}
		}
	}
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:42,代碼來源:VertexFigure.java


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