[Pydev-cvs] org.python.pydev/src/org/python/pydev/editor PyEdit.java,1.85,1.86
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2006-03-28 01:34:37
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31721/src/org/python/pydev/editor Modified Files: PyEdit.java Log Message: Index: PyEdit.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PyEdit.java,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** PyEdit.java 21 Mar 2006 23:23:08 -0000 1.85 --- PyEdit.java 28 Mar 2006 01:34:26 -0000 1.86 *************** *** 26,29 **** --- 26,30 ---- import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.action.IAction; + import org.eclipse.jface.action.IStatusLineManager; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.text.Assert; *************** *** 34,37 **** --- 35,40 ---- import org.eclipse.jface.text.source.SourceViewer; import org.eclipse.swt.SWT; + import org.eclipse.ui.IActionBars; + import org.eclipse.ui.IEditorActionBarContributor; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IEditorSite; *************** *** 41,44 **** --- 44,48 ---- import org.eclipse.ui.editors.text.ILocationProvider; import org.eclipse.ui.editors.text.TextFileDocumentProvider; + import org.eclipse.ui.part.EditorActionBarContributor; import org.eclipse.ui.part.FileEditorInput; import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; *************** *** 55,58 **** --- 59,64 ---- import org.python.pydev.core.IPythonNature; import org.python.pydev.core.REF; + import org.python.pydev.editor.actions.OfflineAction; + import org.python.pydev.editor.actions.OfflineActionTarget; import org.python.pydev.editor.actions.PyOpenAction; import org.python.pydev.editor.autoedit.PyAutoIndentStrategy; *************** *** 626,629 **** --- 632,643 ---- enableBrowserLikeLinks(); + + // ---------------------------------------------------------------------------------------- + // Offline action + action= new OfflineAction(resources, "Pyedit.ScriptEngine", this); + action.setActionDefinitionId("org.python.pydev.editor.actions.scriptEngine"); + action.setId("org.python.pydev.editor.actions.scriptEngine"); + setAction("PydevScriptEngine", action); + notifyOnCreateActions(resources); *************** *** 642,654 **** return pythonModel; } /** * @return an outline view */ public Object getAdapter(Class adapter) { ! if (IContentOutlinePage.class.equals(adapter)) return new PyOutlinePage(this); ! else return super.getAdapter(adapter); } --- 656,703 ---- return pythonModel; } + + /** + * Returns the status line manager of this editor. + * @return the status line manager of this editor + * @since 2.0 + * + * copied from superclass, as it is private there... + */ + public IStatusLineManager getStatusLineManager() { + + IEditorActionBarContributor contributor= getEditorSite().getActionBarContributor(); + if (!(contributor instanceof EditorActionBarContributor)) + return null; + + IActionBars actionBars= ((EditorActionBarContributor) contributor).getActionBars(); + if (actionBars == null) + return null; + + return actionBars.getStatusLineManager(); + } /** + * This is the 'offline' action + */ + protected OfflineActionTarget fOfflineActionTarget; + + /** * @return an outline view */ public Object getAdapter(Class adapter) { ! if (OfflineActionTarget.class.equals(adapter)) { ! if (fOfflineActionTarget == null) { ! IStatusLineManager manager= getStatusLineManager(); ! if (manager != null) ! fOfflineActionTarget= (getSourceViewer() == null ? null : new OfflineActionTarget(getSourceViewer(), manager)); ! } ! return fOfflineActionTarget; ! } ! ! if (IContentOutlinePage.class.equals(adapter)){ return new PyOutlinePage(this); ! }else{ return super.getAdapter(adapter); + } } |