Lines 113-119
Link Here
|
113 |
private final String path; |
113 |
private final String path; |
114 |
|
114 |
|
115 |
public OverObjects(String path) { |
115 |
public OverObjects(String path) { |
116 |
super(delegates(path)); |
116 |
super(delegates(null, path)); |
117 |
this.path = path; |
117 |
this.path = path; |
118 |
try { |
118 |
try { |
119 |
ModuleSystem ms = Main.getModuleSystem(false); |
119 |
ModuleSystem ms = Main.getModuleSystem(false); |
Lines 135-141
Link Here
|
135 |
} |
135 |
} |
136 |
|
136 |
|
137 |
@SuppressWarnings("deprecation") |
137 |
@SuppressWarnings("deprecation") |
138 |
private static Lookup[] delegates(String path) { |
138 |
private static Lookup[] delegates(Lookup prevFolderLkp, String path) { |
139 |
ClassLoader loader = Lookup.getDefault().lookup(ClassLoader.class); |
139 |
ClassLoader loader = Lookup.getDefault().lookup(ClassLoader.class); |
140 |
LOG.log(Level.FINEST, "lkp loader: {0}", loader); |
140 |
LOG.log(Level.FINEST, "lkp loader: {0}", loader); |
141 |
if (loader == null) { |
141 |
if (loader == null) { |
Lines 157-168
Link Here
|
157 |
} else { |
157 |
} else { |
158 |
s = path; |
158 |
s = path; |
159 |
} |
159 |
} |
160 |
return new Lookup[] {new org.openide.loaders.FolderLookup(DataFolder.findFolder(fo), s).getLookup(), base}; |
160 |
if (prevFolderLkp == null) { |
|
|
161 |
prevFolderLkp = new org.openide.loaders.FolderLookup(DataFolder.findFolder(fo), s).getLookup(); |
162 |
} |
163 |
return new Lookup[] {prevFolderLkp, base}; |
164 |
} |
165 |
|
166 |
Lookup extractFolderLkp() { |
167 |
Lookup[] arr = getLookups(); |
168 |
return arr.length == 2 ? arr[0] : null; |
161 |
} |
169 |
} |
162 |
|
170 |
|
163 |
@Override |
171 |
@Override |
164 |
public void propertyChange(PropertyChangeEvent ev) { |
172 |
public void propertyChange(PropertyChangeEvent ev) { |
165 |
setLookups(delegates(path)); |
173 |
setLookups(delegates(extractFolderLkp(), path)); |
166 |
} |
174 |
} |
167 |
|
175 |
|
168 |
@Override |
176 |
@Override |
Lines 191-197
Link Here
|
191 |
} |
199 |
} |
192 |
private void ch(FileEvent e) { |
200 |
private void ch(FileEvent e) { |
193 |
if ((e.getFile().getPath() + "/").startsWith(path)) { // NOI18N |
201 |
if ((e.getFile().getPath() + "/").startsWith(path)) { // NOI18N |
194 |
setLookups(delegates(path)); |
202 |
setLookups(delegates(extractFolderLkp(), path)); |
195 |
} |
203 |
} |
196 |
} |
204 |
} |
197 |
|
205 |
|