Package org.eclipse.ui

Examples of org.eclipse.ui.IReusableEditor


     */
    public boolean setInput(IEditorInput input) {

        if (part != null) {
            if (part instanceof IReusableEditor) {
                IReusableEditor editor = (IReusableEditor) part;
      
                expectingInputChange = true;
               
                editor.setInput(input);
               
                // If the editor never fired a PROP_INPUT event, log the fact that we've discovered
                // a buggy editor and fire the event for free. Firing the event for free isn't required
                // and cannot be relied on (it only works if the input change was triggered by this
                // method, and there are definitely other cases where events will still be lost),
                // but older versions of the workbench did this so we fire it here in the spirit
                // of playing nice.
                if (expectingInputChange) {

                    // Log the fact that this editor is broken
                    reportMalfunction("Editor is not firing a PROP_INPUT event in response to IReusableEditor.setInput(...)"); //$NON-NLS-1$
                   
                    // Fire the property for free (can't be relied on since there are other ways the input
                    // can change, but we do it here to be consistent with older versions of the workbench)
                    firePropertyChange(IWorkbenchPartConstants.PROP_INPUT);
                }
               
                return editor.getEditorInput() == input;

            } else {
                // Can't change the input if the editor already exists and isn't an IReusableEditor
                return false;
            }
View Full Code Here


    if(openNewEditor == OpenNewEditorMode.NEVER) {
      if(currentEditor.getEditorInput().equals(newInput)) {
        setEditorSelection(currentEditor, sourceRange);
        return currentEditor;
      } else if(currentEditor instanceof IReusableEditor) {
        IReusableEditor reusableEditor = (IReusableEditor) currentEditor;
        reusableEditor.setInput(newInput);
        setEditorSelection(currentEditor, sourceRange);
        return currentEditor;
      } else {
        return openEditor(currentEditor, editorId, newInput, sourceRange, OpenNewEditorMode.ALWAYS);
      }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IReusableEditor

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.