Package org.eclipse.ui

Examples of org.eclipse.ui.IEditorInput


    protected Collection<IProject> getProjects() {

        final TextEditor editor = getEditor();
        if (editor != null) {
            final IEditorInput editorInput = editor.getEditorInput();
            if (editorInput instanceof IFileEditorInput) {
                final IFileEditorInput input = (IFileEditorInput) editorInput;
                final IFile file = input.getFile();
                final IProject project = file.getProject();
                return Lists.newArrayList(project);
View Full Code Here


        }
        final IDocumentProvider provider = fEditor.getDocumentProvider();
        if (provider == null) {
            return;
        }
        final IEditorInput input = fEditor.getEditorInput();
        if (input == null) {
            return;
        }
        fCachedDocument = provider.getDocument(input);
        if (fCachedDocument == null) {
View Full Code Here

    public IErlModule getModule() {
        return null;
    }

    private IFile getFile() {
        final IEditorInput editorInput = getEditorInput();
        if (editorInput instanceof IFileEditorInput) {
            final IFileEditorInput input = (IFileEditorInput) editorInput;
            return input.getFile();
        }
        return null;
View Full Code Here

        }
        return false;
    }

    private Object computeInput() {
        final IEditorInput editorInput = editor.getEditorInput();
        if (editorInput instanceof IFileEditorInput) {
            final IFile file = ((IFileEditorInput) editorInput).getFile();
            return ErlModelCore.create(file);
        }
        return null;
View Full Code Here

                if (module.equals(editor.getModule())) {
                    return editorPart;
                }
            }
        }
        final IEditorInput input = getEditorInput(inputElement);
        if (input != null) {
            for (final IEditorPart editorPart : allErlangEditors) {
                if (editorPart.getEditorInput().equals(input)) {
                    return editorPart;
                }
View Full Code Here

     *
     * @return the IEditorPart or null if wrong element type or opening failed
     */
    public static IEditorPart openInEditor(final Object inputElement,
            final boolean activate) throws PartInitException {
        final IEditorInput input = getEditorInput(inputElement);
        if (input == null) {
            return null;
        }
        final IEditorPart editorPart = openInEditor(input,
                getEditorID(input, inputElement), activate);
View Full Code Here

    public static IErlElement getActiveEditorErlangInput() {
        final IWorkbenchPage page = ErlideUIPlugin.getActivePage();
        if (page != null) {
            final IEditorPart part = page.getActiveEditor();
            if (part != null) {
                final IEditorInput editorInput = part.getEditorInput();
                if (editorInput != null) {
                    return (IErlElement) editorInput.getAdapter(IErlElement.class);
                    // return JavaUI.getEditorInputJavaElement(editorInput);
                }
            }
        }
        return null;
View Full Code Here

      Object _xblockexpression = null;
      {
        if ((element instanceof ISourceReference)) {
          final ISourceRange range = ((ISourceReference)element).getSourceRange();
          IDocumentProvider _documentProvider = editor.getDocumentProvider();
          IEditorInput _editorInput = editor.getEditorInput();
          IDocument _document = _documentProvider.getDocument(_editorInput);
          int _offset = range.getOffset();
          int _length = range.getLength();
          final String elementText = _document.get(_offset, _length);
          String _name = openResult.getName();
View Full Code Here

            module = model.findModule(moduleName);
        } catch (final ErlModelException e) {
            ErlLogger.error(e);
            return;
        }
        IEditorInput input = null;
        input = EditorUtility.getEditorInput(module);
        if (input != null) {
            final String editorId = EditorUtility.getEditorID(input, module);
            if (editorId != null) {
                try {
View Full Code Here

     *            editor, where the text is selected
     * @throws WranglerException
     */
    public ErlTextMemberSelection(final ITextSelection selection, final ITextEditor editor)
            throws WranglerException {
        final IEditorInput input = editor.getEditorInput();
        if (!(input instanceof IFileEditorInput)) {
            throw new WranglerException("Can not refactor external modules!");
        }
        document = editor.getDocumentProvider().getDocument(input);
        final IFileEditorInput fileInput = (IFileEditorInput) input;
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IEditorInput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.