Lines 43-88
Link Here
|
43 |
*/ |
43 |
*/ |
44 |
package org.netbeans.modules.refactoring.java.ui; |
44 |
package org.netbeans.modules.refactoring.java.ui; |
45 |
|
45 |
|
46 |
import com.sun.source.tree.ExpressionTree; |
|
|
47 |
import com.sun.source.util.TreePath; |
48 |
import java.awt.BorderLayout; |
46 |
import java.awt.BorderLayout; |
49 |
import java.awt.Component; |
47 |
import java.awt.Component; |
50 |
import java.awt.event.ActionEvent; |
|
|
51 |
import java.beans.BeanInfo; |
52 |
import java.io.IOException; |
48 |
import java.io.IOException; |
53 |
import java.net.MalformedURLException; |
|
|
54 |
import java.net.URL; |
55 |
import java.util.Arrays; |
49 |
import java.util.Arrays; |
56 |
import java.util.LinkedList; |
|
|
57 |
import java.util.List; |
50 |
import java.util.List; |
58 |
import java.util.Set; |
51 |
import java.util.concurrent.atomic.AtomicBoolean; |
59 |
import java.util.prefs.BackingStoreException; |
|
|
60 |
import java.util.prefs.Preferences; |
61 |
import javax.lang.model.element.Element; |
52 |
import javax.lang.model.element.Element; |
62 |
import javax.lang.model.element.ElementKind; |
53 |
import javax.lang.model.element.ElementKind; |
63 |
import javax.lang.model.element.Modifier; |
54 |
import javax.lang.model.element.Modifier; |
64 |
import javax.swing.*; |
55 |
import javax.swing.*; |
65 |
import javax.swing.event.ChangeListener; |
56 |
import javax.swing.event.ChangeListener; |
66 |
import javax.swing.plaf.UIResource; |
|
|
67 |
import org.netbeans.api.fileinfo.NonRecursiveFolder; |
68 |
import org.netbeans.api.java.project.JavaProjectConstants; |
69 |
import org.netbeans.api.java.source.*; |
57 |
import org.netbeans.api.java.source.*; |
70 |
import org.netbeans.api.java.source.JavaSource.Phase; |
58 |
import org.netbeans.api.java.source.JavaSource.Phase; |
71 |
import org.netbeans.api.project.*; |
|
|
72 |
import org.netbeans.modules.refactoring.api.Scope; |
59 |
import org.netbeans.modules.refactoring.api.Scope; |
73 |
import org.netbeans.modules.refactoring.java.Pair; |
60 |
import org.netbeans.modules.refactoring.java.Pair; |
74 |
import org.netbeans.modules.refactoring.java.RefactoringModule; |
|
|
75 |
import org.netbeans.modules.refactoring.java.api.ui.JavaScopeBuilder; |
76 |
import org.netbeans.modules.refactoring.spi.ui.CustomRefactoringPanel; |
61 |
import org.netbeans.modules.refactoring.spi.ui.CustomRefactoringPanel; |
77 |
import org.openide.filesystems.FileObject; |
62 |
import org.openide.filesystems.FileObject; |
78 |
import org.openide.filesystems.FileStateInvalidException; |
|
|
79 |
import org.openide.filesystems.URLMapper; |
80 |
import org.openide.loaders.DataObject; |
81 |
import org.openide.loaders.DataObjectNotFoundException; |
82 |
import org.openide.util.Exceptions; |
83 |
import org.openide.util.ImageUtilities; |
84 |
import org.openide.util.NbBundle; |
63 |
import org.openide.util.NbBundle; |
85 |
import org.openide.util.NbPreferences; |
64 |
import org.openide.util.NbPreferences; |
|
|
65 |
import org.openide.util.lookup.Lookups; |
86 |
|
66 |
|
87 |
|
67 |
|
88 |
/** |
68 |
/** |
Lines 91-104
Link Here
|
91 |
*/ |
71 |
*/ |
92 |
public class WhereUsedPanel extends JPanel implements CustomRefactoringPanel { |
72 |
public class WhereUsedPanel extends JPanel implements CustomRefactoringPanel { |
93 |
|
73 |
|
94 |
private static final String PREF_SCOPE = "FindUsages-Scope"; |
|
|
95 |
private static final String PACKAGE = "org/netbeans/spi/java/project/support/ui/package.gif"; // NOI18N |
96 |
private final transient TreePathHandle element; |
74 |
private final transient TreePathHandle element; |
97 |
private final transient ChangeListener parent; |
75 |
private final transient ChangeListener parent; |
98 |
// private static final int MAX_NAME = 50; |
|
|
99 |
private static final int SCOPE_COMBOBOX_COLUMNS = 14; |
100 |
public static final String ELLIPSIS = "\u2026"; //NOI18N |
101 |
private Scope customScope; |
102 |
private boolean enableScope; |
76 |
private boolean enableScope; |
103 |
|
77 |
|
104 |
private final WhereUsedInnerPanel panel; |
78 |
private final WhereUsedInnerPanel panel; |
Lines 111-117
Link Here
|
111 |
this.enableScope = true; |
85 |
this.enableScope = true; |
112 |
this.panel = panel; |
86 |
this.panel = panel; |
113 |
initComponents(); |
87 |
initComponents(); |
114 |
btnCustomScope.setAction(new ScopeAction(scope)); |
|
|
115 |
} |
88 |
} |
116 |
|
89 |
|
117 |
public static WhereUsedPanel create(String name, TreePathHandle e, ElementKind kind, List<Pair<Pair<String, Icon>, TreePathHandle>> classes, ChangeListener parent) { |
90 |
public static WhereUsedPanel create(String name, TreePathHandle e, ElementKind kind, List<Pair<Pair<String, Icon>, TreePathHandle>> classes, ChangeListener parent) { |
Lines 145-182
Link Here
|
145 |
|
118 |
|
146 |
public Scope getCustomScope() { |
119 |
public Scope getCustomScope() { |
147 |
FileObject file = WhereUsedPanel.this.element.getFileObject(); |
120 |
FileObject file = WhereUsedPanel.this.element.getFileObject(); |
148 |
Scope value = null; |
|
|
149 |
|
121 |
|
150 |
if(!enableScope) { |
122 |
if(!enableScope) { |
151 |
return Scope.create(null, null, Arrays.asList(file)); |
123 |
return Scope.create(null, null, Arrays.asList(file)); |
152 |
} |
124 |
} |
153 |
|
125 |
|
154 |
switch (scope.getSelectedIndex()) { |
126 |
return scope.getSelectedScope(); |
155 |
case 1: |
|
|
156 |
value = Scope.create(Arrays.asList(projectSources), null, null); |
157 |
break; |
158 |
case 2: |
159 |
NonRecursiveFolder nonRecursiveFolder = new NonRecursiveFolder() { |
160 |
@Override |
161 |
public FileObject getFolder() { |
162 |
return packageFolder; |
163 |
} |
164 |
}; |
165 |
value = Scope.create(null, Arrays.asList(nonRecursiveFolder), null); |
166 |
break; |
167 |
case 3: |
168 |
value = Scope.create(null, null, Arrays.asList(file)); |
169 |
break; |
170 |
case 4: |
171 |
value = WhereUsedPanel.this.customScope; |
172 |
break; |
173 |
} |
174 |
return value; |
175 |
} |
127 |
} |
176 |
|
128 |
|
177 |
private boolean initialized = false; |
129 |
private boolean initialized = false; |
178 |
private FileObject packageFolder = null; |
|
|
179 |
private FileObject[] projectSources = null; |
180 |
|
130 |
|
181 |
String getMethodDeclaringClass() { |
131 |
String getMethodDeclaringClass() { |
182 |
if(panel instanceof WhereUsedPanelMethod) { |
132 |
if(panel instanceof WhereUsedPanelMethod) { |
Lines 192-198
Link Here
|
192 |
return; |
142 |
return; |
193 |
} |
143 |
} |
194 |
JavaSource source = JavaSource.forFileObject(element.getFileObject()); |
144 |
JavaSource source = JavaSource.forFileObject(element.getFileObject()); |
195 |
final Project p = FileOwnerQuery.getOwner(element.getFileObject()); |
|
|
196 |
CancellableTask<CompilationController> task =new CancellableTask<CompilationController>() { |
145 |
CancellableTask<CompilationController> task =new CancellableTask<CompilationController>() { |
197 |
@Override |
146 |
@Override |
198 |
public void cancel() { |
147 |
public void cancel() { |
Lines 206-255
Link Here
|
206 |
final Element element = WhereUsedPanel.this.element.resolveElement(info); |
155 |
final Element element = WhereUsedPanel.this.element.resolveElement(info); |
207 |
panel.initialize(element, info); |
156 |
panel.initialize(element, info); |
208 |
|
157 |
|
209 |
TreePath path = WhereUsedPanel.this.element.resolve(info); |
|
|
210 |
final ExpressionTree packageName1 = path.getCompilationUnit().getPackageName(); |
211 |
final String packageName = packageName1 == null? "<default package>" : packageName1.toString(); //NOI18N |
212 |
if(packageName1 == null) { |
213 |
packageFolder = info.getClasspathInfo().getClassPath(ClasspathInfo.PathKind.SOURCE).findOwnerRoot(WhereUsedPanel.this.element.getFileObject()); |
214 |
} else { |
215 |
packageFolder = info.getClasspathInfo().getClassPath(ClasspathInfo.PathKind.SOURCE).findResource(packageName.replaceAll("\\.", "/")); //NOI18N |
216 |
} |
217 |
|
218 |
final JLabel customScope; |
219 |
final JLabel currentFile; |
220 |
final JLabel currentPackage; |
221 |
final JLabel currentProject; |
222 |
final JLabel allProjects; |
223 |
if (p != null) { |
224 |
ProjectInformation pi = ProjectUtils.getInformation(FileOwnerQuery.getOwner(WhereUsedPanel.this.element.getFileObject())); |
225 |
|
226 |
SourceGroup[] sources = ProjectUtils.getSources(pi.getProject()).getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA); |
227 |
projectSources = new FileObject[sources.length]; |
228 |
for (int i = 0; i < sources.length; i++) { |
229 |
projectSources[i] = sources[i].getRootFolder(); |
230 |
} |
231 |
|
232 |
DataObject currentFileDo = null; |
233 |
try { |
234 |
currentFileDo = DataObject.find(WhereUsedPanel.this.element.getFileObject()); |
235 |
} catch (DataObjectNotFoundException ex) { |
236 |
} // Not important, only for Icon. |
237 |
customScope = new JLabel(NbBundle.getMessage(WhereUsedPanel.class, "LBL_CustomScope"), pi.getIcon(), SwingConstants.LEFT); //NOI18N |
238 |
currentFile = new JLabel(NbBundle.getMessage(WhereUsedPanel.class, "LBL_CurrentFile", WhereUsedPanel.this.element.getFileObject().getNameExt()), currentFileDo != null ? new ImageIcon(currentFileDo.getNodeDelegate().getIcon(BeanInfo.ICON_COLOR_16x16)) : pi.getIcon(), SwingConstants.LEFT); //NOI18N |
239 |
currentPackage = new JLabel(NbBundle.getMessage(WhereUsedPanel.class, "LBL_CurrentPackage", packageName), ImageUtilities.loadImageIcon(PACKAGE, false), SwingConstants.LEFT); //NOI18N |
240 |
currentProject = new JLabel(NbBundle.getMessage(WhereUsedPanel.class, "LBL_CurrentProject", pi.getDisplayName()), pi.getIcon(), SwingConstants.LEFT); //NOI18N |
241 |
allProjects = new JLabel(NbBundle.getMessage(WhereUsedPanel.class, "LBL_AllProjects"), pi.getIcon(), SwingConstants.LEFT); //NOI18N |
242 |
} else { |
243 |
customScope = null; |
244 |
currentFile = null; |
245 |
currentPackage = null; |
246 |
currentProject = null; |
247 |
allProjects = null; |
248 |
} |
249 |
|
250 |
if((element.getKind().equals(ElementKind.LOCAL_VARIABLE) || element.getKind().equals(ElementKind.PARAMETER)) |
158 |
if((element.getKind().equals(ElementKind.LOCAL_VARIABLE) || element.getKind().equals(ElementKind.PARAMETER)) |
251 |
|| element.getModifiers().contains(Modifier.PRIVATE)) { |
159 |
|| element.getModifiers().contains(Modifier.PRIVATE)) { |
252 |
enableScope = false; |
160 |
enableScope = false; |
|
|
161 |
} else { |
162 |
enableScope = scope.initialize(Lookups.fixed(WhereUsedPanel.this.element.getFileObject(), WhereUsedPanel.this.element.resolve(info)), new AtomicBoolean()); |
253 |
} |
163 |
} |
254 |
|
164 |
|
255 |
SwingUtilities.invokeLater(new Runnable() { |
165 |
SwingUtilities.invokeLater(new Runnable() { |
Lines 258-280
Link Here
|
258 |
innerPanel.removeAll(); |
168 |
innerPanel.removeAll(); |
259 |
innerPanel.add(panel, BorderLayout.CENTER); |
169 |
innerPanel.add(panel, BorderLayout.CENTER); |
260 |
panel.setVisible(true); |
170 |
panel.setVisible(true); |
261 |
|
171 |
scope.setVisible(enableScope); |
262 |
if(enableScope && currentProject!=null) { |
|
|
263 |
scope.setModel(new DefaultComboBoxModel(new Object[]{allProjects, currentProject, currentPackage, currentFile, customScope })); |
264 |
int defaultItem = (Integer) RefactoringModule.getOption("whereUsed.scope", 0); // NOI18N |
265 |
WhereUsedPanel.this.customScope = readScope(); |
266 |
if(defaultItem == 4 && WhereUsedPanel.this.customScope !=null && |
267 |
WhereUsedPanel.this.customScope.getFiles().isEmpty() && |
268 |
WhereUsedPanel.this.customScope.getFolders().isEmpty() && |
269 |
WhereUsedPanel.this.customScope.getSourceRoots().isEmpty()) { |
270 |
scope.setSelectedIndex(0); |
271 |
} else { |
272 |
scope.setSelectedIndex(defaultItem); |
273 |
} |
274 |
scope.setRenderer(new JLabelRenderer()); |
275 |
} else { |
276 |
scopePanel.setVisible(false); |
277 |
} |
278 |
} |
172 |
} |
279 |
}); |
173 |
}); |
280 |
}}; |
174 |
}}; |
Lines 285-426
Link Here
|
285 |
} |
179 |
} |
286 |
initialized = true; |
180 |
initialized = true; |
287 |
} |
181 |
} |
288 |
private static class JLabelRenderer extends JLabel implements ListCellRenderer, UIResource { |
|
|
289 |
public JLabelRenderer () { |
290 |
setOpaque(true); |
291 |
} |
292 |
@Override |
293 |
public Component getListCellRendererComponent( |
294 |
JList list, |
295 |
Object value, |
296 |
int index, |
297 |
boolean isSelected, |
298 |
boolean cellHasFocus) { |
299 |
|
300 |
// #89393: GTK needs name to render cell renderer "natively" |
301 |
setName("ComboBox.listRenderer"); // NOI18N |
302 |
|
303 |
if ( value != null ) { |
304 |
setText(((JLabel)value).getText()); |
305 |
setIcon(((JLabel)value).getIcon()); |
306 |
} |
307 |
|
308 |
if ( isSelected ) { |
309 |
setBackground(list.getSelectionBackground()); |
310 |
setForeground(list.getSelectionForeground()); |
311 |
} else { |
312 |
setBackground(list.getBackground()); |
313 |
setForeground(list.getForeground()); |
314 |
} |
315 |
|
316 |
return this; |
317 |
} |
318 |
|
319 |
// #89393: GTK needs name to render cell renderer "natively" |
320 |
@Override |
321 |
public String getName() { |
322 |
String name = super.getName(); |
323 |
return name == null ? "ComboBox.renderer" : name; // NOI18N |
324 |
} |
325 |
} |
326 |
|
182 |
|
327 |
static abstract class WhereUsedInnerPanel extends JPanel { |
183 |
static abstract class WhereUsedInnerPanel extends JPanel { |
328 |
abstract boolean isSearchInComments(); |
184 |
abstract boolean isSearchInComments(); |
329 |
abstract void initialize(Element element, CompilationController info); |
185 |
abstract void initialize(Element element, CompilationController info); |
330 |
} |
186 |
} |
331 |
|
|
|
332 |
private class ScopeAction extends AbstractAction { |
333 |
private final JComboBox scope; |
334 |
|
335 |
private ScopeAction(JComboBox scope) { |
336 |
this.scope = scope; |
337 |
this.putValue(NAME, ELLIPSIS); |
338 |
} |
339 |
|
340 |
@Override |
341 |
public void actionPerformed(ActionEvent e) { |
342 |
Scope customScope = getCustomScope(); |
343 |
|
344 |
customScope = JavaScopeBuilder.open(NbBundle.getMessage(WhereUsedPanel.class, "DLG_CustomScope"), customScope); //NOI18N |
345 |
if (customScope != null) { |
346 |
WhereUsedPanel.this.customScope = customScope; |
347 |
scope.setSelectedIndex(4); |
348 |
storeScope(customScope); |
349 |
} |
350 |
} |
351 |
} |
352 |
|
353 |
private void storeScope(Scope customScope) { |
354 |
try { |
355 |
storeFileList(customScope.getSourceRoots(), "sourceRoot" ); //NOI18N |
356 |
storeFileList(customScope.getFolders(), "folder" ); //NOI18N |
357 |
storeFileList(customScope.getFiles(), "file" ); //NOI18N |
358 |
} catch (BackingStoreException ex) { |
359 |
Exceptions.printStackTrace(ex); |
360 |
} |
361 |
} |
362 |
|
363 |
private Scope readScope() { |
364 |
try { |
365 |
if (NbPreferences.forModule(JavaScopeBuilder.class).nodeExists(PREF_SCOPE)) { //NOI18N |
366 |
return Scope.create( |
367 |
loadFileList("sourceRoot", FileObject.class), //NOI18N |
368 |
loadFileList("folder", NonRecursiveFolder.class), //NOI18N |
369 |
loadFileList("file", FileObject.class)); //NOI18N |
370 |
} |
371 |
} catch (BackingStoreException ex) { |
372 |
Exceptions.printStackTrace(ex); |
373 |
} |
374 |
return null; |
375 |
} |
376 |
|
377 |
private <T> List<T> loadFileList(String basekey, Class<T> type) throws BackingStoreException { |
378 |
Preferences pref = NbPreferences.forModule(JavaScopeBuilder.class).node(PREF_SCOPE).node(basekey); |
379 |
List<T> toRet = new LinkedList<T>(); |
380 |
for (String key : pref.keys()) { |
381 |
final String url = pref.get(key, null); |
382 |
if (url != null && !url.isEmpty()) { |
383 |
try { |
384 |
final FileObject f = URLMapper.findFileObject(new URL(url)); |
385 |
if (f != null && f.isValid()) { |
386 |
if (type.isAssignableFrom(FileObject.class)) { |
387 |
toRet.add((T) f); |
388 |
} else { |
389 |
toRet.add((T) new NonRecursiveFolder() { |
390 |
|
391 |
@Override |
392 |
public FileObject getFolder() { |
393 |
return f; |
394 |
} |
395 |
}); |
396 |
} |
397 |
} |
398 |
} catch (MalformedURLException ex) { |
399 |
Exceptions.printStackTrace(ex); |
400 |
} |
401 |
} |
402 |
} |
403 |
return toRet; |
404 |
} |
405 |
|
406 |
private void storeFileList(Set files, String basekey) throws BackingStoreException { |
407 |
Preferences pref = NbPreferences.forModule(WhereUsedPanel.class).node(PREF_SCOPE).node(basekey); |
408 |
assert files != null; |
409 |
pref.clear(); |
410 |
int count = 0; |
411 |
for (Object next : files) { |
412 |
try { |
413 |
if (next instanceof FileObject) { |
414 |
pref.put(basekey + count++, ((FileObject) next).getURL().toExternalForm()); |
415 |
} else { |
416 |
pref.put(basekey + count++, ((NonRecursiveFolder) next).getFolder().getURL().toExternalForm()); |
417 |
} |
418 |
} catch (FileStateInvalidException ex) { |
419 |
Exceptions.printStackTrace(ex); |
420 |
} |
421 |
} |
422 |
pref.flush(); |
423 |
} |
424 |
|
187 |
|
425 |
// static String getHeader(Element call, CompilationInfo info) { |
188 |
// static String getHeader(Element call, CompilationInfo info) { |
426 |
// String result = ElementHeaders.getHeader(call, info, ElementHeaders.NAME + ElementHeaders.PARAMETERS); |
189 |
// String result = ElementHeaders.getHeader(call, info, ElementHeaders.NAME + ElementHeaders.PARAMETERS); |
Lines 452-533
Link Here
|
452 |
private void initComponents() { |
215 |
private void initComponents() { |
453 |
|
216 |
|
454 |
buttonGroup = new javax.swing.ButtonGroup(); |
217 |
buttonGroup = new javax.swing.ButtonGroup(); |
455 |
scopePanel = new javax.swing.JPanel(); |
|
|
456 |
scopeLabel = new javax.swing.JLabel(); |
457 |
scope = new javax.swing.JComboBox(); |
458 |
btnCustomScope = new javax.swing.JButton(); |
459 |
innerPanel = new javax.swing.JPanel(); |
218 |
innerPanel = new javax.swing.JPanel(); |
460 |
|
219 |
scope = new org.netbeans.modules.refactoring.spi.ui.ScopePanel(WhereUsedPanel.class.getCanonicalName().replace('.', '-'), NbPreferences.forModule(WhereUsedPanel.class), "whereUsed.scope"); |
461 |
scopeLabel.setLabelFor(scope); |
220 |
jLabel1 = new javax.swing.JLabel(); |
462 |
org.openide.awt.Mnemonics.setLocalizedText(scopeLabel, org.openide.util.NbBundle.getMessage(WhereUsedPanel.class, "LBL_Scope")); // NOI18N |
|
|
463 |
|
464 |
((javax.swing.JTextField) scope.getEditor().getEditorComponent()).setColumns(SCOPE_COMBOBOX_COLUMNS); |
465 |
scope.addActionListener(new java.awt.event.ActionListener() { |
466 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
467 |
scopeActionPerformed(evt); |
468 |
} |
469 |
}); |
470 |
|
471 |
btnCustomScope.setText(ELLIPSIS); |
472 |
|
473 |
javax.swing.GroupLayout scopePanelLayout = new javax.swing.GroupLayout(scopePanel); |
474 |
scopePanel.setLayout(scopePanelLayout); |
475 |
scopePanelLayout.setHorizontalGroup( |
476 |
scopePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
477 |
.addGroup(scopePanelLayout.createSequentialGroup() |
478 |
.addContainerGap() |
479 |
.addComponent(scopeLabel) |
480 |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
481 |
.addComponent(scope, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
482 |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
483 |
.addComponent(btnCustomScope) |
484 |
.addContainerGap()) |
485 |
); |
486 |
scopePanelLayout.setVerticalGroup( |
487 |
scopePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
488 |
.addGroup(scopePanelLayout.createSequentialGroup() |
489 |
.addContainerGap() |
490 |
.addGroup(scopePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
491 |
.addGroup(scopePanelLayout.createSequentialGroup() |
492 |
.addGap(6, 6, 6) |
493 |
.addComponent(scopeLabel)) |
494 |
.addGroup(scopePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) |
495 |
.addComponent(btnCustomScope) |
496 |
.addComponent(scope, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) |
497 |
.addContainerGap()) |
498 |
); |
499 |
|
500 |
scope.getAccessibleContext().setAccessibleDescription("N/A"); |
501 |
|
221 |
|
502 |
innerPanel.setLayout(new java.awt.BorderLayout()); |
222 |
innerPanel.setLayout(new java.awt.BorderLayout()); |
503 |
|
223 |
|
|
|
224 |
jLabel1.setText(org.openide.util.NbBundle.getMessage(WhereUsedPanel.class, "WhereUsedPanel.jLabel1.text")); // NOI18N |
225 |
|
504 |
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); |
226 |
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); |
505 |
this.setLayout(layout); |
227 |
this.setLayout(layout); |
506 |
layout.setHorizontalGroup( |
228 |
layout.setHorizontalGroup( |
507 |
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
229 |
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
508 |
.addComponent(scopePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
230 |
.addComponent(innerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
509 |
.addComponent(innerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 361, Short.MAX_VALUE) |
231 |
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() |
|
|
232 |
.addContainerGap() |
233 |
.addComponent(jLabel1) |
234 |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
235 |
.addComponent(scope, javax.swing.GroupLayout.DEFAULT_SIZE, 487, Short.MAX_VALUE) |
236 |
.addContainerGap()) |
510 |
); |
237 |
); |
511 |
layout.setVerticalGroup( |
238 |
layout.setVerticalGroup( |
512 |
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
239 |
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
513 |
.addGroup(layout.createSequentialGroup() |
240 |
.addGroup(layout.createSequentialGroup() |
514 |
.addComponent(innerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 45, Short.MAX_VALUE) |
241 |
.addComponent(innerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE) |
515 |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
242 |
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
516 |
.addComponent(scopePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) |
243 |
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) |
|
|
244 |
.addComponent(scope, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
245 |
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) |
246 |
.addContainerGap()) |
517 |
); |
247 |
); |
518 |
}// </editor-fold>//GEN-END:initComponents |
248 |
}// </editor-fold>//GEN-END:initComponents |
519 |
|
249 |
|
520 |
private void scopeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_scopeActionPerformed |
|
|
521 |
RefactoringModule.setOption("whereUsed.scope", scope.getSelectedIndex()); // NOI18N |
522 |
}//GEN-LAST:event_scopeActionPerformed |
523 |
|
524 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
250 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
525 |
private javax.swing.JButton btnCustomScope; |
|
|
526 |
private javax.swing.ButtonGroup buttonGroup; |
251 |
private javax.swing.ButtonGroup buttonGroup; |
527 |
private javax.swing.JPanel innerPanel; |
252 |
private javax.swing.JPanel innerPanel; |
528 |
private javax.swing.JComboBox scope; |
253 |
private javax.swing.JLabel jLabel1; |
529 |
private javax.swing.JLabel scopeLabel; |
254 |
private org.netbeans.modules.refactoring.spi.ui.ScopePanel scope; |
530 |
private javax.swing.JPanel scopePanel; |
|
|
531 |
// End of variables declaration//GEN-END:variables |
255 |
// End of variables declaration//GEN-END:variables |
532 |
|
256 |
|
533 |
public boolean isMethodFromBaseClass() { |
257 |
public boolean isMethodFromBaseClass() { |
Lines 587-590
Link Here
|
587 |
return this; |
311 |
return this; |
588 |
} |
312 |
} |
589 |
} |
313 |
} |
590 |
|
|
|