/** * Get text content for a class file if possible * * @param classFile * the class file to get content from * @param monitor * @return the text content if successful, or <code>null</code> if unsuccessful, * or an empty string if canceled */ public String getSource(IClassFile classFile, IProgressMonitor monitor) { if (classFile == null) { return null; } return getContent(classFile, classFile.getHandleIdentifier(), IDecompiler.class, monitor); }
public static void saveState(IMemento memento, InternalClassFileEditorInput input) { IClassFile c= input.getClassFile(); memento.putString(KEY, c.getHandleIdentifier()); } }
public static void saveState(IMemento memento, InternalClassFileEditorInput input) { IClassFile c= input.getClassFile(); memento.putString(KEY, c.getHandleIdentifier()); } }
public static void saveState(IMemento memento, InternalClassFileEditorInput input) { IClassFile c= input.getClassFile(); memento.putString(KEY, c.getHandleIdentifier()); } }
private static String getFileURI(IClassFile classFile) { String packageName = classFile.getParent().getElementName(); String jarName = classFile.getParent().getParent().getElementName(); try { return new URI(JDT_SCHEME, "contents", PATH_SEPARATOR + jarName + PATH_SEPARATOR + packageName + PATH_SEPARATOR + classFile.getElementName(), classFile.getHandleIdentifier(), null) .toASCIIString(); } catch (URISyntaxException e) { return null; } }
public static String toUri(IClassFile classFile) { if (JavaLanguageServerPlugin.getPreferencesManager() != null && !JavaLanguageServerPlugin.getPreferencesManager().isClientSupportsClassFileContent()) { return null; } String packageName = classFile.getParent().getElementName(); String jarName = classFile.getParent().getParent().getElementName(); String uriString = null; try { uriString = new URI(JDT_SCHEME, "contents", PATH_SEPARATOR + jarName + PATH_SEPARATOR + packageName + PATH_SEPARATOR + classFile.getElementName(), classFile.getHandleIdentifier(), null).toASCIIString(); } catch (URISyntaxException e) { JavaLanguageServerPlugin.logException("Error generating URI for class ", e); } return uriString; }