Index: loaders/src/org/openide/text/DataEditorSupport.java =================================================================== RCS file: /cvs/openide/loaders/src/org/openide/text/DataEditorSupport.java,v retrieving revision 1.4 diff -u -r1.4 DataEditorSupport.java --- loaders/src/org/openide/text/DataEditorSupport.java 16 Apr 2003 08:39:56 -0000 1.4 +++ loaders/src/org/openide/text/DataEditorSupport.java 16 Apr 2003 09:08:25 -0000 @@ -51,7 +51,7 @@ * @param env environment to pass to */ public DataEditorSupport (DataObject obj, CloneableEditorSupport.Env env) { - super (env); + super (env, org.openide.util.lookup.Lookups.singleton (obj)); this.obj = obj; } @@ -271,14 +271,6 @@ return env instanceof Env && ((Env)env).getFileImpl().isReadOnly(); } - /** Getter for data object associated with this - * data object. - */ - final org.openide.util.Lookup getDataObjectHack () { - // PENDING-JST: Not effective - return org.openide.util.lookup.Lookups.singleton (obj); - } - /** Needed for EditorSupport */ final DataObject getDataObjectHack2 () { return obj; Index: src/org/openide/text/CloneableEditorSupport.java =================================================================== RCS file: /cvs/openide/src/org/openide/text/CloneableEditorSupport.java,v retrieving revision 1.85 diff -u -r1.85 CloneableEditorSupport.java --- src/org/openide/text/CloneableEditorSupport.java 16 Apr 2003 08:39:57 -0000 1.85 +++ src/org/openide/text/CloneableEditorSupport.java 16 Apr 2003 09:08:28 -0000 @@ -52,6 +52,7 @@ import org.openide.util.TaskListener; //import org.openide.util.actions.SystemAction; import org.openide.util.RequestProcessor; +import org.openide.util.Lookup; import org.openide.util.NbBundle; import org.openide.util.UserQuestionException; import org.openide.text.EnhancedChangeEvent; @@ -159,15 +160,30 @@ /** Support for property change listeners*/ private PropertyChangeSupport propertyChangeSupport; + /** context of this editor support */ + private Lookup lookup; + /** Creates new CloneableEditorSupport attached to given environment. * * @param env environment that is source of all actions around the * data object */ public CloneableEditorSupport(Env env) { - super (env); + this (env, org.openide.util.Lookup.EMPTY); } + /** Creates new CloneableEditorSupport attached to given environment. + * + * @param env environment that is source of all actions around the + * data object + * @param l the context that will be passed to each Line produced + * by this support's Line.Set. The line will return it from Line.getLookup + * call + */ + public CloneableEditorSupport(Env env, Lookup l) { + super (env); + this.lookup = l; + } // // abstract messages section // @@ -1100,8 +1116,8 @@ /** Getter for context associated with this * data object. */ - org.openide.util.Lookup getDataObjectHack () { - return org.openide.util.Lookup.EMPTY; + final org.openide.util.Lookup getLookup () { + return lookup; } Index: src/org/openide/text/EditorSupportLineSet.java =================================================================== RCS file: /cvs/openide/src/org/openide/text/EditorSupportLineSet.java,v retrieving revision 1.32 diff -u -r1.32 EditorSupportLineSet.java --- src/org/openide/text/EditorSupportLineSet.java 2 Apr 2003 09:46:48 -0000 1.32 +++ src/org/openide/text/EditorSupportLineSet.java 16 Apr 2003 09:08:28 -0000 @@ -52,7 +52,7 @@ support.getPositionManager (), offset, Position.Bias.Forward ); // PENDING-JST: Support shall provide some kind of context - return new SupportLine (support.getDataObjectHack (), ref, support); + return new SupportLine (support.getLookup (), ref, support); } /** Line for my work. @@ -160,7 +160,7 @@ PositionRef ref = new PositionRef (support.getPositionManager (), line, 0, Position.Bias.Forward); // obj can be null, sorry... - org.openide.util.Lookup obj = support.getDataObjectHack (); + org.openide.util.Lookup obj = support.getLookup (); return this.registerLine(new SupportLine(obj, ref, support)); }