This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 32937
Collapse All | Expand All

(-)loaders/src/org/openide/text/DataEditorSupport.java (-9 / +1 lines)
Lines 51-57 Link Here
51
    * @param env environment to pass to 
51
    * @param env environment to pass to 
52
    */
52
    */
53
    public DataEditorSupport (DataObject obj, CloneableEditorSupport.Env env) {
53
    public DataEditorSupport (DataObject obj, CloneableEditorSupport.Env env) {
54
        super (env);
54
        super (env, org.openide.util.lookup.Lookups.singleton (obj));
55
        this.obj = obj;
55
        this.obj = obj;
56
    }
56
    }
57
    
57
    
Lines 271-284 Link Here
271
        return env instanceof Env && ((Env)env).getFileImpl().isReadOnly();
271
        return env instanceof Env && ((Env)env).getFileImpl().isReadOnly();
272
    }
272
    }
273
    
273
    
274
    /** Getter for data object associated with this 
275
    * data object.
276
    */
277
    final org.openide.util.Lookup getDataObjectHack () {
278
        // PENDING-JST: Not effective
279
        return org.openide.util.lookup.Lookups.singleton (obj);
280
    }
281
282
    /** Needed for EditorSupport */
274
    /** Needed for EditorSupport */
283
    final DataObject getDataObjectHack2 () {
275
    final DataObject getDataObjectHack2 () {
284
        return obj;
276
        return obj;
(-)src/org/openide/text/CloneableEditorSupport.java (-3 / +19 lines)
Lines 52-57 Link Here
52
import org.openide.util.TaskListener;
52
import org.openide.util.TaskListener;
53
//import org.openide.util.actions.SystemAction;
53
//import org.openide.util.actions.SystemAction;
54
import org.openide.util.RequestProcessor;
54
import org.openide.util.RequestProcessor;
55
import org.openide.util.Lookup;
55
import org.openide.util.NbBundle;
56
import org.openide.util.NbBundle;
56
import org.openide.util.UserQuestionException;
57
import org.openide.util.UserQuestionException;
57
import org.openide.text.EnhancedChangeEvent;
58
import org.openide.text.EnhancedChangeEvent;
Lines 159-173 Link Here
159
    /** Support for property change listeners*/
160
    /** Support for property change listeners*/
160
    private PropertyChangeSupport propertyChangeSupport;
161
    private PropertyChangeSupport propertyChangeSupport;
161
    
162
    
163
    /** context of this editor support */
164
    private Lookup lookup;
165
    
162
    /** Creates new CloneableEditorSupport attached to given environment.
166
    /** Creates new CloneableEditorSupport attached to given environment.
163
    *
167
    *
164
    * @param env environment that is source of all actions around the 
168
    * @param env environment that is source of all actions around the 
165
    *    data object
169
    *    data object
166
    */
170
    */
167
    public CloneableEditorSupport(Env env) {
171
    public CloneableEditorSupport(Env env) {
168
        super (env);
172
        this (env, org.openide.util.Lookup.EMPTY);
169
    }
173
    }
170
    
174
    
175
    /** Creates new CloneableEditorSupport attached to given environment.
176
    *
177
    * @param env environment that is source of all actions around the 
178
    *    data object
179
    * @param l the context that will be passed to each Line produced
180
    *    by this support's Line.Set. The line will return it from Line.getLookup
181
    *    call
182
    */
183
    public CloneableEditorSupport(Env env, Lookup l) {
184
        super (env);
185
        this.lookup = l;
186
    }
171
    //
187
    //
172
    // abstract messages section
188
    // abstract messages section
173
    //
189
    //
Lines 1100-1107 Link Here
1100
    /** Getter for context associated with this 
1116
    /** Getter for context associated with this 
1101
    * data object.
1117
    * data object.
1102
    */
1118
    */
1103
    org.openide.util.Lookup getDataObjectHack () {
1119
    final org.openide.util.Lookup getLookup () {
1104
        return org.openide.util.Lookup.EMPTY;
1120
        return lookup;
1105
    }
1121
    }
1106
1122
1107
1123
(-)src/org/openide/text/EditorSupportLineSet.java (-2 / +2 lines)
Lines 52-58 Link Here
52
                              support.getPositionManager (), offset, Position.Bias.Forward
52
                              support.getPositionManager (), offset, Position.Bias.Forward
53
                          );
53
                          );
54
        // PENDING-JST: Support shall provide some kind of context
54
        // PENDING-JST: Support shall provide some kind of context
55
        return new SupportLine (support.getDataObjectHack (), ref, support);
55
        return new SupportLine (support.getLookup (), ref, support);
56
    }
56
    }
57
57
58
    /** Line for my work.
58
    /** Line for my work.
Lines 160-166 Link Here
160
            PositionRef ref = new PositionRef (support.getPositionManager (), line, 0, Position.Bias.Forward);
160
            PositionRef ref = new PositionRef (support.getPositionManager (), line, 0, Position.Bias.Forward);
161
161
162
            // obj can be null, sorry...
162
            // obj can be null, sorry...
163
            org.openide.util.Lookup obj = support.getDataObjectHack ();
163
            org.openide.util.Lookup obj = support.getLookup ();
164
            
164
            
165
            return this.registerLine(new SupportLine(obj, ref, support));
165
            return this.registerLine(new SupportLine(obj, ref, support));
166
        }
166
        }

Return to bug 32937