/** * @param classFileWithSource * @throws JavaModelException * */ public ClassFileSourceStorage(IClassFile classFileWithSource) throws JavaModelException { this.classFile = classFileWithSource; this.source = classFile.getSource(); }
@Override protected boolean setDocumentContent(IDocument document, IEditorInput editorInput, String encoding) throws CoreException { if (editorInput instanceof IClassFileEditorInput) { IClassFile classFile= ((IClassFileEditorInput) editorInput).getClassFile(); String source= classFile.getSource(); if (source == null) source= ""; //$NON-NLS-1$ document.set(source); return true; } return super.setDocumentContent(document, editorInput, encoding); }
@Override protected boolean setDocumentContent(IDocument document, IEditorInput editorInput, String encoding) throws CoreException { if (editorInput instanceof IClassFileEditorInput) { IClassFile classFile= ((IClassFileEditorInput) editorInput).getClassFile(); String source= classFile.getSource(); if (source == null) source= ""; //$NON-NLS-1$ document.set(source); return true; } return super.setDocumentContent(document, editorInput, encoding); }
protected boolean setDocumentContent(IDocument document, IEditorInput editorInput, String encoding) throws CoreException { if (editorInput instanceof IClassFileEditorInput) { IClassFile classFile= ((IClassFileEditorInput) editorInput).getClassFile(); String source= classFile.getSource(); if (source == null) source= ""; //$NON-NLS-1$ document.set(source); return true; } return super.setDocumentContent(document, editorInput, encoding); }
CompletionEngine engine = new CompletionEngine(environment, requestor, project.getOptions(true), project, owner, monitor); String source = getClassFile().getSource(); if (source != null && insertion > -1 && insertion < source.length()) {
CompletionEngine engine = new CompletionEngine(environment, requestor, project.getOptions(true), project, owner, monitor); String source = getClassFile().getSource(); if (source != null && insertion > -1 && insertion < source.length()) {
CompletionEngine engine = new CompletionEngine(environment, requestor, project.getOptions(true), project, owner, monitor); String source = getClassFile().getSource(); if (source != null && insertion > -1 && insertion < source.length()) {
/** * Runs the stub generation on the specified class file. * * @param file * the class file * @param parent * the parent store * @param monitor * the progress monitor to use * @throws CoreException * if an error occurs */ protected void run(final IClassFile file, final IFileStore parent, final IProgressMonitor monitor) throws CoreException { try { monitor.beginTask(getOperationLabel(), 2); final IType type= file.getType(); if (type.isAnonymous() || type.isLocal() || type.isMember()) return; final String source= file.getSource(); createCompilationUnit(parent, type.getElementName() + ".java", source != null ? source : "", monitor); //$NON-NLS-1$ //$NON-NLS-2$ } finally { monitor.done(); } } }
CompletionEngine engine = new CompletionEngine(environment, requestor, project.getOptions(true), project, owner, monitor); String source = getClassFile().getSource(); if (source != null && insertion > -1 && insertion < source.length()) {
CompletionEngine engine = new CompletionEngine(environment, requestor, project.getOptions(true), project, owner, monitor); String source = getClassFile().getSource(); if (source != null && insertion > -1 && insertion < source.length()) {
/** * Runs the stub generation on the specified class file. * * @param file * the class file * @param parent * the parent store * @param monitor * the progress monitor to use * @throws CoreException * if an error occurs */ @Override protected void run(final IClassFile file, final IFileStore parent, final IProgressMonitor monitor) throws CoreException { try { monitor.beginTask(getOperationLabel(), 2); final IType type= file.getType(); if (type.isAnonymous() || type.isLocal() || type.isMember()) return; final String source= file.getSource(); createCompilationUnit(parent, type.getElementName() + JavaModelUtil.DEFAULT_CU_SUFFIX, source != null ? source : "", monitor); //$NON-NLS-1$ } finally { monitor.done(); } } }
/** * Runs the stub generation on the specified class file. * * @param file * the class file * @param parent * the parent store * @param monitor * the progress monitor to use * @throws CoreException * if an error occurs */ @Override protected void run(final IClassFile file, final IFileStore parent, final IProgressMonitor monitor) throws CoreException { try { monitor.beginTask(getOperationLabel(), 2); final String source= file.getSource(); if (file instanceof IModularClassFile) { createCompilationUnit(parent, JavaModelUtil.MODULE_INFO_JAVA, source != null ? source : "", monitor); //$NON-NLS-1$ } else { final IType type= ((IOrdinaryClassFile) file).getType(); if (type.isAnonymous() || type.isLocal() || type.isMember()) return; createCompilationUnit(parent, type.getElementName() + JavaModelUtil.DEFAULT_CU_SUFFIX, source != null ? source : "", monitor); //$NON-NLS-1$ } } finally { monitor.done(); } } }
if (cu == null || classFile.getSource() == null) return null;
if (cu == null || classFile.getSource() == null) return null;
IClassFile classFile = type.getClassFile(); if (classFile != null) { source = classFile.getSource();