public IPath getFullPath() { return storage.getFullPath(); } public InputStream getContents() throws CoreException {
@Override public IPath getFullPath() { return storage.getFullPath(); }
@Override public IPath getFullPath() { return storage.getFullPath(); }
public int compareTo(Object o) { KeyReference otherRef= (KeyReference)o; String thisPath= storage.getFullPath().toString(); String otherPath= otherRef.storage.getFullPath().toString(); int result= fgCollator.compare(thisPath, otherPath); if (result != 0) return result; else return offset - otherRef.offset; } }
@Override public String getToolTipText() { File file = fJarEntryFile.getAdapter(File.class); if (file != null) return file.getAbsolutePath(); return fJarEntryFile.getFullPath().toString(); }
protected URI internalGetUri(IStorage storage) { if (storage instanceof IFile) { return URI.createPlatformResourceURI(storage.getFullPath().toString(), true); } return null; }
protected String getResourceName(EObject primaryTarget) { Iterator<Pair<IStorage, IProject>> storages = storage2UriMapper.getStorages(EcoreUtil.getURI(primaryTarget)) .iterator(); return (storages.hasNext()) ? storages.next().getFirst().getFullPath().toString() : null; }
protected URI getURIForStorage(IStorage storage) { final URI uri = storage2uriMapper.getUri(storage); if (uri != null) { return uri; } return URI.createPlatformResourceURI(storage.getFullPath().toString(), true); }
public String text(IStorageEditorInput editorInput) { try { return editorInput.getStorage().getFullPath().lastSegment(); } catch (CoreException e) { LOG.error("Error resolving IStorage from IStorageEditorInput", e); } return null; }
public Object text(IResourceDescription element) { Iterator<Pair<IStorage, IProject>> storages = storage2UriMapper.getStorages(element.getURI()).iterator(); if (storages.hasNext()) { IStorage storage = storages.next().getFirst(); return storage.getFullPath().toString(); } return null; }
/** * @see IEditorInput#getToolTipText() */ public String getToolTipText() { return getStorage().getFullPath().toOSString(); }
protected @Nullable IStorage getGeneratedFileForTraceFile(IStorage traceFile) { if (traceFile instanceof IFile) { IFile file = (IFile) traceFile; String lastSegment = traceFile.getFullPath().lastSegment(); lastSegment = traceFileNameProvider.getJavaFromTrace(lastSegment); return file.getParent().getFile(new Path(lastSegment)); } return null; }
@Override public IStorage call() throws Exception { for (Object resource: packagefragment.getNonJavaResources()) { IStorage fileorjarentry = (IStorage)resource; if (isDialectHelpXMLFile(fileorjarentry)) { logInfo("Help file found: " + fileorjarentry.getName()); dialectfilepaths.add(fileorjarentry.getFullPath()); return fileorjarentry; } } return null; } }));
public void deleteStorage(IStorage storage) throws Exception { IndexReader reader = IndexReader.open(getIndexDir(), false); String filePath = storage.getFullPath().toString(); Term term = Field.FILE.createTerm(filePath); reader.deleteDocuments(term); reader.close(); }
/** * Shows error message in status line if opening the properties file in editor fails. * * @param propertiesFile the propertiesFile * @param editor the editor part */ private static void handleOpenPropertiesFileFailed(IStorage propertiesFile, IEditorPart editor) { showErrorInStatusLine(editor, Messages.format(JavaEditorMessages.Editor_OpenPropertiesFile_error_openEditor_dialogMessage, BasicElementLabels.getPathLabel(propertiesFile.getFullPath(), true))); }
/** * Shows error message in status line if opening the properties file in editor fails. * * @param propertiesFile the propertiesFile * @param editor the editor part */ private static void handleOpenPropertiesFileFailed(IStorage propertiesFile, IEditorPart editor) { showErrorInStatusLine(editor, Messages.format(JavaEditorMessages.Editor_OpenPropertiesFile_error_openEditor_dialogMessage, BasicElementLabels.getPathLabel(propertiesFile.getFullPath(), true))); }
@Override public String getToolTipText() { if (fJarEntryFile instanceof IJarEntryResource) { IJarEntryResource jarEntry= (IJarEntryResource)fJarEntryFile; IPackageFragmentRoot root= jarEntry.getPackageFragmentRoot(); IPath fullPath= root.getPath().append(fJarEntryFile.getFullPath()); return BasicElementLabels.getPathLabel(fullPath, root.isExternal()); } IPath fullPath= fJarEntryFile.getFullPath(); if (fullPath == null) return null; return BasicElementLabels.getPathLabel(fullPath, false); }
private IPath getEditorInputPath() { if (getEditor() == null) return null; IEditorInput input= getEditor().getEditorInput(); if (input instanceof IStorageEditorInput) { try { return ((IStorageEditorInput)input).getStorage().getFullPath(); } catch (CoreException ex) { JavaPlugin.log(ex.getStatus()); } } return null; }
@Override public ImageDescriptor getImageDescriptor() { IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry(); return registry.getImageDescriptor(fJarEntryFile.getFullPath().getFileExtension()); }
protected Resource createResourceFor(IStorage storage) throws CoreException { ResourceSet resourceSet = getResourceSet(storage); URI uri = URI.createPlatformResourceURI(storage.getFullPath().toString(), true); configureResourceSet(resourceSet, uri); URI uriForResource = uri; if (!uri.isPlatform()) { uriForResource = resourceSet.getURIConverter().normalize(uri); } XtextResource resource = (XtextResource) resourceFactory.createResource(uriForResource); resourceSet.getResources().add(resource); resource.setValidationDisabled(isValidationDisabled(storage)); return resource; }