本文整理匯總了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;
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
}
}
}