/** execute action on the file */ protected void execute(IFile file, IAction action) { String conflictResourceLocalCopy = RegistryCheckInClientUtils.getConflictResourceServerCopy(file.getLocation().toOSString()); IFile conflictFile = file.getWorkspace().getRoot().getFileForLocation(new Path(conflictResourceLocalCopy)); try { IEditorDescriptor defaultEditor = IDE.getEditorDescriptor(file); IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); activePage.openEditor(new FileEditorInput(conflictFile), defaultEditor.getId()); } catch (PartInitException e) { log.error(e); } }
private List<IResource> getResources(WARArtifactLocationNode node) { final IFolder folder = node.getProject().getFolder(node.getPath()); final List<IResource> resources = new ArrayList<IResource>(); try { folder.accept( new IResourceVisitor() { public boolean visit(IResource arg0) throws CoreException { if (folder.getFullPath().toOSString().equals(arg0.getFullPath().toOSString())) { return true; } else { resources.add(arg0); return false; } } }); } catch (CoreException e) { log.error(e); } return resources; }