Examples of IEditorInput


Examples of org.eclipse.ui.IEditorInput

    /**
     * @param part
     * @return editor input as IJavaElement
     */
    public static IJavaElement getJavaInput(IEditorPart part) {
        IEditorInput editorInput = part.getEditorInput();
        if (editorInput != null) {
            IJavaElement input = (IJavaElement) editorInput
                .getAdapter(IJavaElement.class);
            return input;
        }
        return null;
    }
View Full Code Here

Examples of org.eclipse.ui.IEditorInput

    public void setActiveEditor(IAction action, IEditorPart targetEditor) {
        editor = targetEditor;
    }

    public void run(IAction action) {
        IEditorInput input = editor.getEditorInput();
        if (input instanceof IFileEditorInput) {
            editor.doSave(null);
            DroolsBuilder.parseResource(((IFileEditorInput) input).getFile());
        }
    }
View Full Code Here

Examples of org.eclipse.ui.IEditorInput

            Object objectToSelect = null;

            if ( part instanceof IEditorPart )
            {
                IEditorPart editor = ( IEditorPart ) part;
                IEditorInput input = editor.getEditorInput();
                if ( input != null && input instanceof EntryEditorInput )
                {
                    EntryEditorInput eei = ( EntryEditorInput ) input;
                    IEntry entry = eei.getResolvedEntry();
                    if ( entry != null )
View Full Code Here

Examples of org.eclipse.ui.IEditorInput

            Object objectToSelect = null;

            if ( part instanceof IEditorPart )
            {
                IEditorPart editor = ( IEditorPart ) part;
                IEditorInput input = editor.getEditorInput();
                if ( input != null && input instanceof EntryEditorInput )
                {
                    EntryEditorInput eei = ( EntryEditorInput ) input;
                    objectToSelect = eei.getInput();
                }
View Full Code Here

Examples of org.eclipse.ui.IEditorInput

        // Saving the editor pages
        saveEditorPages();

        try
        {
            IEditorInput input = getEditorInput();
            String inputClassName = input.getClass().getName();
            boolean success = false;
            if ( input instanceof FileEditorInput )
            // FileEditorInput class is used when the file is opened
            // from a project in the workspace.
            {
                // Saving the ServerConfiguration to disk
                saveConfiguration( ( FileEditorInput ) input, monitor );
                success = true;
            }
            else if ( input instanceof IPathEditorInput )
            {
                // Saving the ServerConfiguration to disk
                saveConfiguration( ( ( IPathEditorInput ) input ).getPath().toOSString() );
                success = true;
            }
            else if ( inputClassName.equals( "org.eclipse.ui.internal.editors.text.JavaFileEditorInput" ) //$NON-NLS-1$
                || inputClassName.equals( "org.eclipse.ui.ide.FileStoreEditorInput" ) ) //$NON-NLS-1$
            // The class 'org.eclipse.ui.internal.editors.text.JavaFileEditorInput'
            // is used when opening a file from the menu File > Open... in Eclipse 3.2.x
            // The class 'org.eclipse.ui.ide.FileStoreEditorInput' is used when
            // opening a file from the menu File > Open... in Eclipse 3.3.x
            {
                // Saving the ServerConfiguration to disk
                saveConfiguration( input.getToolTipText() );
                success = true;
            }
            else if ( input instanceof NonExistingServerConfigurationInput )
            {
                // The 'ServerConfigurationEditorInput' class is used when a
View Full Code Here

Examples of org.eclipse.ui.IEditorInput

            return false;
        }

        try
        {
            IEditorInput otherInput = editorRef.getEditorInput();
            if ( !( otherInput instanceof EntryEditorInput ) )
            {
                return false;
            }
            EntryEditorInput otherEntryEditorInput = ( EntryEditorInput ) otherInput;
View Full Code Here

Examples of org.eclipse.ui.IEditorInput

        formEditor.getEditModel().saveChangesTo(document);
    }

    private IDocument getDocument() {
        IDocumentProvider docProvider = getDocumentProvider();
        IEditorInput input = getEditorInput();
        return new IDocumentWrapper(docProvider.getDocument(input));
    }
View Full Code Here

Examples of org.eclipse.ui.IEditorInput

            }
        }
    }

    public void launch(IEditorPart editor, String mode) {
        IEditorInput input = editor.getEditorInput();
        IJavaElement element = (IJavaElement) input.getAdapter(IJavaElement.class);
        if (element != null) {
            IJavaProject jproject = element.getJavaProject();
            if (jproject != null) {
                launch(jproject.getProject().getFullPath(), mode);
            }
View Full Code Here

Examples of org.eclipse.ui.IEditorInput

    protected void loadContent() {
        if (displayJob != null && displayJob.getState() != Job.NONE)
            displayJob.cancel();

        if (zipEntry != null && !zipEntry.isDirectory()) {
            IEditorInput input = editor.getEditorInput();
            final Display display = text.getDisplay();
            final URI uri = URIHelper.retrieveFileURI(input);

            if (uri != null) {
                displayJob = new Job("Load zip content") {
View Full Code Here

Examples of org.eclipse.ui.IEditorInput

    }

    public void refresh() {
        URI uri = null;
        try {
            IEditorInput input = getEditorInput();
            if (input instanceof IFileEditorInput) {
                uri = ((IFileEditorInput) input).getFile().getLocationURI();
            } else if (input instanceof IURIEditorInput) {
                uri = ((IURIEditorInput) input).getURI();
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.