Lines 20-38
Link Here
|
20 |
package org.netbeans.spi.java.project.support.ui; |
20 |
package org.netbeans.spi.java.project.support.ui; |
21 |
|
21 |
|
22 |
import java.awt.EventQueue; |
22 |
import java.awt.EventQueue; |
|
|
23 |
import java.beans.PropertyChangeEvent; |
24 |
import java.beans.PropertyChangeListener; |
23 |
import java.io.File; |
25 |
import java.io.File; |
|
|
26 |
import java.util.Set; |
27 |
import java.util.regex.Pattern; |
24 |
import javax.swing.DefaultListModel; |
28 |
import javax.swing.DefaultListModel; |
|
|
29 |
import javax.swing.JFrame; |
25 |
import javax.swing.JPanel; |
30 |
import javax.swing.JPanel; |
|
|
31 |
import javax.swing.WindowConstants; |
26 |
import javax.swing.event.DocumentEvent; |
32 |
import javax.swing.event.DocumentEvent; |
27 |
import javax.swing.event.DocumentListener; |
33 |
import javax.swing.event.DocumentListener; |
|
|
34 |
import org.netbeans.spi.project.support.ant.PathMatcher; |
35 |
import org.openide.explorer.ExplorerManager; |
36 |
import org.openide.explorer.view.BeanTreeView; |
37 |
import org.openide.nodes.AbstractNode; |
38 |
import org.openide.nodes.Children; |
39 |
import org.openide.nodes.Node; |
40 |
import org.openide.util.NbPreferences; |
41 |
import org.openide.util.RequestProcessor; |
42 |
import org.openide.util.WeakSet; |
28 |
|
43 |
|
29 |
class IncludeExcludeVisualizerPanel extends JPanel { |
44 |
class IncludeExcludeVisualizerPanel extends JPanel { |
30 |
|
45 |
|
31 |
private final IncludeExcludeVisualizer handle; |
46 |
private final IncludeExcludeVisualizer handle; |
|
|
47 |
private File[] roots; |
48 |
private String currentIncludes; |
49 |
private String currentExcludes; |
32 |
private final DocumentListener listener = new DocumentListener() { |
50 |
private final DocumentListener listener = new DocumentListener() { |
33 |
private void changes() { |
51 |
private void changes() { |
34 |
handle.changedPatterns(includes.getText(), excludes.getText()); |
52 |
String _includes = includes.getText(); |
|
|
53 |
String _excludes = excludes.getText(); |
54 |
synchronized (IncludeExcludeVisualizerPanel.this) { |
55 |
currentIncludes = _includes; |
56 |
currentExcludes = _excludes; |
35 |
} |
57 |
} |
|
|
58 |
handle.changedPatterns(_includes, _excludes); |
59 |
recalculate(); |
60 |
} |
36 |
public void insertUpdate(DocumentEvent e) { |
61 |
public void insertUpdate(DocumentEvent e) { |
37 |
changes(); |
62 |
changes(); |
38 |
} |
63 |
} |
Lines 41-81
Link Here
|
41 |
} |
66 |
} |
42 |
public void changedUpdate(DocumentEvent e) {} |
67 |
public void changedUpdate(DocumentEvent e) {} |
43 |
}; |
68 |
}; |
44 |
private final DefaultListModel includedListModel = new DefaultListModel(); |
|
|
45 |
private final DefaultListModel excludedListModel = new DefaultListModel(); |
46 |
|
69 |
|
|
|
70 |
private final ExplorerManager includeSelection = new ExplorerManager(); |
71 |
private final ExplorerManager excludeSelection = new ExplorerManager(); |
72 |
|
47 |
public IncludeExcludeVisualizerPanel(IncludeExcludeVisualizer handle) { |
73 |
public IncludeExcludeVisualizerPanel(IncludeExcludeVisualizer handle) { |
48 |
this.handle = handle; |
74 |
this.handle = handle; |
49 |
initComponents(); |
75 |
initComponents(); |
50 |
includes.getDocument().addDocumentListener(listener); |
76 |
includes.getDocument().addDocumentListener(listener); |
51 |
excludes.getDocument().addDocumentListener(listener); |
77 |
excludes.getDocument().addDocumentListener(listener); |
52 |
includedList.setModel(includedListModel); |
78 |
includeSelection.setRootContext(new AbstractNode(includedRoots)); |
53 |
excludedList.setModel(excludedListModel); |
79 |
excludeSelection.setRootContext(new AbstractNode(excludedRoots)); |
|
|
80 |
class ExplorerPanel extends JPanel implements ExplorerManager.Provider { |
81 |
final ExplorerManager mgr; |
82 |
ExplorerPanel(ExplorerManager mgr) { |
83 |
this.mgr = mgr; |
84 |
add(new BeanTreeView()); |
54 |
} |
85 |
} |
|
|
86 |
public ExplorerManager getExplorerManager() { |
87 |
return mgr; |
88 |
} |
89 |
} |
90 |
includedListPanel.add(new ExplorerPanel(includeSelection)); |
91 |
excludedListPanel.add(new ExplorerPanel(excludeSelection)); |
92 |
PropertyChangeListener updateButtons = new PropertyChangeListener() { |
93 |
public void propertyChange(PropertyChangeEvent evt) { |
94 |
// XXX update button states |
95 |
} |
96 |
}; |
97 |
includeSelection.addPropertyChangeListener(updateButtons); |
98 |
excludeSelection.addPropertyChangeListener(updateButtons); |
99 |
} |
55 |
|
100 |
|
56 |
void setFields(String includes, String excludes) { |
101 |
synchronized void setFields(String includes, String excludes, File[] roots) { |
57 |
assert EventQueue.isDispatchThread(); |
102 |
assert EventQueue.isDispatchThread(); |
|
|
103 |
this.roots = roots; |
104 |
currentIncludes = includes; |
105 |
currentExcludes = excludes; |
58 |
this.includes.getDocument().removeDocumentListener(listener); |
106 |
this.includes.getDocument().removeDocumentListener(listener); |
59 |
this.includes.setText(includes); |
107 |
this.includes.setText(includes); |
60 |
this.includes.getDocument().addDocumentListener(listener); |
108 |
this.includes.getDocument().addDocumentListener(listener); |
61 |
this.excludes.getDocument().removeDocumentListener(listener); |
109 |
this.excludes.getDocument().removeDocumentListener(listener); |
62 |
this.excludes.setText(excludes); |
110 |
this.excludes.setText(excludes); |
63 |
this.excludes.getDocument().addDocumentListener(listener); |
111 |
this.excludes.getDocument().addDocumentListener(listener); |
|
|
112 |
recalculate(); |
64 |
} |
113 |
} |
65 |
|
114 |
|
66 |
void setFiles(File[] included, File[] excluded, boolean busy) { |
115 |
//private boolean interrupted; |
67 |
assert EventQueue.isDispatchThread(); |
116 |
private static final RequestProcessor RP = new RequestProcessor(IncludeExcludeVisualizerPanel.class.getName()); |
68 |
includedListModel.clear(); |
117 |
private final RequestProcessor.Task task = RP.create(new RecalculateTask()); |
69 |
for (File f : included) { |
118 |
private static final int DELAY = 200; |
70 |
includedListModel.addElement(f); |
119 |
private synchronized void recalculate() { |
|
|
120 |
//interrupted = true; |
121 |
task.schedule(DELAY); |
71 |
} |
122 |
} |
72 |
excludedListModel.clear(); |
123 |
|
73 |
for (File f : excluded) { |
124 |
private final class RecalculateTask implements Runnable { |
74 |
excludedListModel.addElement(f); |
125 |
|
|
|
126 |
public void run() { |
127 |
scanningLabel.setVisible(true); |
128 |
File[] _roots; |
129 |
String _includes, _excludes; |
130 |
synchronized (IncludeExcludeVisualizerPanel.this) { |
131 |
//interrupted = false; |
132 |
_roots = roots.clone(); |
133 |
_includes = currentIncludes; |
134 |
_excludes = currentExcludes; |
75 |
} |
135 |
} |
76 |
scanningLabel.setVisible(busy); |
136 |
includedRoots.update(roots, _includes, _excludes); |
|
|
137 |
excludedRoots.update(roots, _includes, _excludes); |
138 |
scanningLabel.setVisible(false); |
77 |
} |
139 |
} |
78 |
|
140 |
|
|
|
141 |
} |
142 |
|
143 |
// XXX #95974: VisibilityQuery only works on FileObject, and that would be too slow |
144 |
// copied from: org.netbeans.modules.masterfs.GlobalVisibilityQueryImpl |
145 |
private final Pattern ignoredFiles = Pattern.compile(NbPreferences.root().node("/org/netbeans/core").get("IgnoredFiles", // NOI18N |
146 |
"^(CVS|SCCS|vssver\\.scc|#.*#|%.*%|\\.(cvsignore|svn|DS_Store)|_svn)$|~$|^\\..*$")); // NOI18N |
147 |
|
148 |
/* |
149 |
private void scan(File d, String prefix, PathMatcher matcher) { |
150 |
String[] children = d.list(); |
151 |
if (children == null) { |
152 |
return; |
153 |
} |
154 |
for (String child : children) { |
155 |
if (ignoredFiles.matcher(child).find()) { |
156 |
continue; |
157 |
} |
158 |
File f = new File(d, child); |
159 |
boolean dir = f.isDirectory(); |
160 |
if (dir) { |
161 |
scan(f, prefix + child + "/", matcher); // NOI18N |
162 |
} else { |
163 |
synchronized (this) { |
164 |
if (interrupted) { |
165 |
return; |
166 |
} |
167 |
if (matcher.matches(prefix + child, false)) { |
168 |
included.add(f); |
169 |
} else { |
170 |
excluded.add(f); |
171 |
} |
172 |
} |
173 |
} |
174 |
} |
175 |
} |
176 |
*/ |
177 |
|
178 |
private final RootChildren includedRoots = new RootChildren(true); |
179 |
private final RootChildren excludedRoots = new RootChildren(false); |
180 |
|
181 |
private final class RootChildren extends Children.Keys<File> { |
182 |
|
183 |
private final boolean includeMode; |
184 |
private String includes; |
185 |
private String excludes; |
186 |
|
187 |
RootChildren(boolean includeMode) { |
188 |
this.includeMode = includeMode; |
189 |
} |
190 |
|
191 |
void update(File[] roots, String includes, String excludes) { |
192 |
this.includes = includes; |
193 |
this.excludes = excludes; |
194 |
setKeys(roots); |
195 |
for (Node n : getNodes(true)) { |
196 |
//XXX((FileNode) n).update(matcher); |
197 |
} |
198 |
} |
199 |
|
200 |
protected Node[] createNodes(File file) { |
201 |
return new Node[] {new FileNode(file, true, new PathMatcher(includes, excludes, file))}; |
202 |
} |
203 |
|
204 |
} |
205 |
|
206 |
private final class FileNode extends AbstractNode { |
207 |
|
208 |
private final File file; |
209 |
private boolean top; |
210 |
private PathMatcher matcher; |
211 |
|
212 |
FileNode(File file, boolean top, PathMatcher matcher) { |
213 |
super(file.isDirectory() ? new FileChildren(file) : Children.LEAF); |
214 |
this.file = file; |
215 |
this.top = top; |
216 |
} |
217 |
|
218 |
public @Override String getDisplayName() { |
219 |
return top ? file.getAbsolutePath() : file.getName(); |
220 |
} |
221 |
|
222 |
} |
223 |
|
224 |
private final class FileChildren extends Children.Keys<File> { |
225 |
|
226 |
private final File file; |
227 |
private PathMatcher matcher; |
228 |
|
229 |
FileChildren(File file, PathMatcher matcher) { |
230 |
this.file = file; |
231 |
} |
232 |
|
233 |
protected @Override void addNotify() { |
234 |
super.addNotify(); |
235 |
|
236 |
} |
237 |
|
238 |
protected Node[] createNodes(File key) { |
239 |
return new Node[] {new FileNode(key, false)}; |
240 |
} |
241 |
|
242 |
} |
243 |
|
79 |
/** This method is called from within the constructor to |
244 |
/** This method is called from within the constructor to |
80 |
* initialize the form. |
245 |
* initialize the form. |
81 |
* WARNING: Do NOT modify this code. The content of this method is |
246 |
* WARNING: Do NOT modify this code. The content of this method is |
Lines 85-195
Link Here
|
85 |
private void initComponents() { |
250 |
private void initComponents() { |
86 |
|
251 |
|
87 |
includedListLabel = new javax.swing.JLabel(); |
252 |
includedListLabel = new javax.swing.JLabel(); |
88 |
includedListPane = new javax.swing.JScrollPane(); |
253 |
includedListPanel = new javax.swing.JPanel(); |
89 |
includedList = new javax.swing.JList(); |
|
|
90 |
excludedListLabel = new javax.swing.JLabel(); |
254 |
excludedListLabel = new javax.swing.JLabel(); |
91 |
excludedListPane = new javax.swing.JScrollPane(); |
255 |
excludeButton = new javax.swing.JButton(); |
92 |
excludedList = new javax.swing.JList(); |
256 |
includeButton = new javax.swing.JButton(); |
93 |
scanningLabel = new javax.swing.JLabel(); |
257 |
scanningLabel = new javax.swing.JLabel(); |
|
|
258 |
advancedPanel = new javax.swing.JPanel(); |
94 |
includesLabel = new javax.swing.JLabel(); |
259 |
includesLabel = new javax.swing.JLabel(); |
95 |
includes = new javax.swing.JTextField(); |
260 |
includes = new javax.swing.JTextField(); |
96 |
excludesLabel = new javax.swing.JLabel(); |
261 |
excludesLabel = new javax.swing.JLabel(); |
97 |
excludes = new javax.swing.JTextField(); |
262 |
excludes = new javax.swing.JTextField(); |
98 |
explanation = new javax.swing.JLabel(); |
263 |
explanation = new javax.swing.JLabel(); |
|
|
264 |
excludedListPanel = new javax.swing.JPanel(); |
99 |
|
265 |
|
100 |
includedListLabel.setLabelFor(includedList); |
266 |
setName("Form"); // NOI18N |
|
|
267 |
|
101 |
org.openide.awt.Mnemonics.setLocalizedText(includedListLabel, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.includedListLabel.text")); // NOI18N |
268 |
org.openide.awt.Mnemonics.setLocalizedText(includedListLabel, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.includedListLabel.text")); // NOI18N |
|
|
269 |
includedListLabel.setName("includedListLabel"); // NOI18N |
102 |
|
270 |
|
103 |
includedListPane.setViewportView(includedList); |
271 |
includedListPanel.setBackground(new java.awt.Color(255, 51, 204)); |
|
|
272 |
includedListPanel.setName("includedListPanel"); // NOI18N |
104 |
|
273 |
|
105 |
excludedListLabel.setLabelFor(excludedList); |
274 |
org.jdesktop.layout.GroupLayout includedListPanelLayout = new org.jdesktop.layout.GroupLayout(includedListPanel); |
|
|
275 |
includedListPanel.setLayout(includedListPanelLayout); |
276 |
includedListPanelLayout.setHorizontalGroup( |
277 |
includedListPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
278 |
.add(0, 274, Short.MAX_VALUE) |
279 |
); |
280 |
includedListPanelLayout.setVerticalGroup( |
281 |
includedListPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
282 |
.add(0, 143, Short.MAX_VALUE) |
283 |
); |
284 |
|
106 |
org.openide.awt.Mnemonics.setLocalizedText(excludedListLabel, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.excludedListLabel.text")); // NOI18N |
285 |
org.openide.awt.Mnemonics.setLocalizedText(excludedListLabel, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.excludedListLabel.text")); // NOI18N |
|
|
286 |
excludedListLabel.setName("excludedListLabel"); // NOI18N |
107 |
|
287 |
|
108 |
excludedListPane.setViewportView(excludedList); |
288 |
org.openide.awt.Mnemonics.setLocalizedText(excludeButton, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.excludeButton.text")); // NOI18N |
|
|
289 |
excludeButton.setName("excludeButton"); // NOI18N |
290 |
excludeButton.addActionListener(new java.awt.event.ActionListener() { |
291 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
292 |
excludeButtonActionPerformed(evt); |
293 |
} |
294 |
}); |
109 |
|
295 |
|
|
|
296 |
org.openide.awt.Mnemonics.setLocalizedText(includeButton, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.includeButton.text")); // NOI18N |
297 |
includeButton.setName("includeButton"); // NOI18N |
298 |
includeButton.addActionListener(new java.awt.event.ActionListener() { |
299 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
300 |
includeButtonActionPerformed(evt); |
301 |
} |
302 |
}); |
303 |
|
110 |
org.openide.awt.Mnemonics.setLocalizedText(scanningLabel, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.scanningLabel.text")); // NOI18N |
304 |
org.openide.awt.Mnemonics.setLocalizedText(scanningLabel, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.scanningLabel.text")); // NOI18N |
|
|
305 |
scanningLabel.setName("scanningLabel"); // NOI18N |
111 |
|
306 |
|
|
|
307 |
advancedPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.border.advancedPanel.title"))); // NOI18N |
308 |
advancedPanel.setName("advancedPanel"); // NOI18N |
309 |
|
112 |
includesLabel.setLabelFor(includes); |
310 |
includesLabel.setLabelFor(includes); |
113 |
org.openide.awt.Mnemonics.setLocalizedText(includesLabel, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.includesLabel.text")); // NOI18N |
311 |
org.openide.awt.Mnemonics.setLocalizedText(includesLabel, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.includesLabel.text")); // NOI18N |
|
|
312 |
includesLabel.setName("includesLabel"); // NOI18N |
114 |
|
313 |
|
|
|
314 |
includes.setName("includes"); // NOI18N |
315 |
|
115 |
excludesLabel.setLabelFor(excludes); |
316 |
excludesLabel.setLabelFor(excludes); |
116 |
org.openide.awt.Mnemonics.setLocalizedText(excludesLabel, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.excludesLabel.text")); // NOI18N |
317 |
org.openide.awt.Mnemonics.setLocalizedText(excludesLabel, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.excludesLabel.text")); // NOI18N |
|
|
318 |
excludesLabel.setName("excludesLabel"); // NOI18N |
117 |
|
319 |
|
|
|
320 |
excludes.setName("excludes"); // NOI18N |
321 |
|
118 |
org.openide.awt.Mnemonics.setLocalizedText(explanation, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.explanation.text")); // NOI18N |
322 |
org.openide.awt.Mnemonics.setLocalizedText(explanation, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.explanation.text")); // NOI18N |
|
|
323 |
explanation.setName("explanation"); // NOI18N |
119 |
|
324 |
|
|
|
325 |
org.jdesktop.layout.GroupLayout advancedPanelLayout = new org.jdesktop.layout.GroupLayout(advancedPanel); |
326 |
advancedPanel.setLayout(advancedPanelLayout); |
327 |
advancedPanelLayout.setHorizontalGroup( |
328 |
advancedPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
329 |
.add(advancedPanelLayout.createSequentialGroup() |
330 |
.addContainerGap() |
331 |
.add(advancedPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
332 |
.add(advancedPanelLayout.createSequentialGroup() |
333 |
.add(advancedPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
334 |
.add(includesLabel) |
335 |
.add(excludesLabel)) |
336 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
337 |
.add(advancedPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
338 |
.add(excludes, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 567, Short.MAX_VALUE) |
339 |
.add(includes, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 567, Short.MAX_VALUE))) |
340 |
.add(explanation, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 630, Short.MAX_VALUE)) |
341 |
.addContainerGap()) |
342 |
); |
343 |
advancedPanelLayout.setVerticalGroup( |
344 |
advancedPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
345 |
.add(advancedPanelLayout.createSequentialGroup() |
346 |
.add(advancedPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
347 |
.add(includesLabel) |
348 |
.add(includes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
349 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
350 |
.add(advancedPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
351 |
.add(excludesLabel) |
352 |
.add(excludes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
353 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
354 |
.add(explanation, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) |
355 |
); |
356 |
|
357 |
excludedListPanel.setBackground(new java.awt.Color(51, 255, 51)); |
358 |
excludedListPanel.setName("excludedListPanel"); // NOI18N |
359 |
|
360 |
org.jdesktop.layout.GroupLayout excludedListPanelLayout = new org.jdesktop.layout.GroupLayout(excludedListPanel); |
361 |
excludedListPanel.setLayout(excludedListPanelLayout); |
362 |
excludedListPanelLayout.setHorizontalGroup( |
363 |
excludedListPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
364 |
.add(0, 290, Short.MAX_VALUE) |
365 |
); |
366 |
excludedListPanelLayout.setVerticalGroup( |
367 |
excludedListPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
368 |
.add(0, 143, Short.MAX_VALUE) |
369 |
); |
370 |
|
120 |
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); |
371 |
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); |
121 |
this.setLayout(layout); |
372 |
this.setLayout(layout); |
122 |
layout.setHorizontalGroup( |
373 |
layout.setHorizontalGroup( |
123 |
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
374 |
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
124 |
.add(layout.createSequentialGroup() |
375 |
.add(layout.createSequentialGroup() |
125 |
.addContainerGap() |
|
|
126 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
376 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
127 |
.add(layout.createSequentialGroup() |
377 |
.add(layout.createSequentialGroup() |
128 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
378 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
129 |
.add(layout.createSequentialGroup() |
379 |
.add(includedListPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
130 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
380 |
.add(includedListLabel)) |
131 |
.add(includesLabel) |
381 |
.add(12, 12, 12) |
132 |
.add(excludesLabel)) |
382 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) |
|
|
383 |
.add(excludeButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
384 |
.add(includeButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 76, Short.MAX_VALUE)) |
133 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
385 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
134 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
386 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
135 |
.add(excludes, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 371, Short.MAX_VALUE) |
387 |
.add(excludedListLabel) |
136 |
.add(includes, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 371, Short.MAX_VALUE))) |
388 |
.add(excludedListPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) |
137 |
.add(scanningLabel) |
389 |
.add(scanningLabel) |
138 |
.add(includedListLabel)) |
390 |
.add(advancedPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) |
139 |
.addContainerGap()) |
391 |
.addContainerGap()) |
140 |
.add(layout.createSequentialGroup() |
|
|
141 |
.add(excludedListLabel) |
142 |
.addContainerGap(361, Short.MAX_VALUE)) |
143 |
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() |
144 |
.add(includedListPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE) |
145 |
.addContainerGap()) |
146 |
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() |
147 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) |
148 |
.add(explanation, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE) |
149 |
.add(excludedListPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE)) |
150 |
.addContainerGap()))) |
151 |
); |
392 |
); |
152 |
layout.setVerticalGroup( |
393 |
layout.setVerticalGroup( |
153 |
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
394 |
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
154 |
.add(layout.createSequentialGroup() |
395 |
.add(layout.createSequentialGroup() |
155 |
.addContainerGap() |
396 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
156 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
|
|
157 |
.add(includesLabel) |
158 |
.add(includes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
159 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
160 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
161 |
.add(excludesLabel) |
162 |
.add(excludes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
163 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
164 |
.add(scanningLabel) |
165 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
166 |
.add(includedListLabel) |
397 |
.add(includedListLabel) |
|
|
398 |
.add(excludedListLabel)) |
167 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
399 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
168 |
.add(includedListPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
400 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
|
|
401 |
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() |
402 |
.add(excludeButton) |
169 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
403 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
170 |
.add(excludedListLabel) |
404 |
.add(includeButton) |
|
|
405 |
.add(67, 67, 67)) |
406 |
.add(layout.createSequentialGroup() |
171 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
407 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
172 |
.add(excludedListPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 143, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
408 |
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) |
|
|
409 |
.add(org.jdesktop.layout.GroupLayout.LEADING, excludedListPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
410 |
.add(org.jdesktop.layout.GroupLayout.LEADING, includedListPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
173 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
411 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
174 |
.add(explanation, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 40, Short.MAX_VALUE) |
412 |
.add(scanningLabel) |
175 |
.addContainerGap()) |
413 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))) |
|
|
414 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
415 |
.add(advancedPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
176 |
); |
416 |
); |
177 |
}// </editor-fold>//GEN-END:initComponents |
417 |
}// </editor-fold>//GEN-END:initComponents |
178 |
|
418 |
|
|
|
419 |
private void includeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_includeButtonActionPerformed |
420 |
// XXX |
421 |
}//GEN-LAST:event_includeButtonActionPerformed |
179 |
|
422 |
|
|
|
423 |
private void excludeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_excludeButtonActionPerformed |
424 |
// XXX |
425 |
}//GEN-LAST:event_excludeButtonActionPerformed |
426 |
|
427 |
|
180 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
428 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
181 |
private javax.swing.JList excludedList; |
429 |
private javax.swing.JPanel advancedPanel; |
|
|
430 |
private javax.swing.JButton excludeButton; |
182 |
private javax.swing.JLabel excludedListLabel; |
431 |
private javax.swing.JLabel excludedListLabel; |
183 |
private javax.swing.JScrollPane excludedListPane; |
432 |
private javax.swing.JPanel excludedListPanel; |
184 |
private javax.swing.JTextField excludes; |
433 |
private javax.swing.JTextField excludes; |
185 |
private javax.swing.JLabel excludesLabel; |
434 |
private javax.swing.JLabel excludesLabel; |
186 |
private javax.swing.JLabel explanation; |
435 |
private javax.swing.JLabel explanation; |
187 |
private javax.swing.JList includedList; |
436 |
private javax.swing.JButton includeButton; |
188 |
private javax.swing.JLabel includedListLabel; |
437 |
private javax.swing.JLabel includedListLabel; |
189 |
private javax.swing.JScrollPane includedListPane; |
438 |
private javax.swing.JPanel includedListPanel; |
190 |
private javax.swing.JTextField includes; |
439 |
private javax.swing.JTextField includes; |
191 |
private javax.swing.JLabel includesLabel; |
440 |
private javax.swing.JLabel includesLabel; |
192 |
private javax.swing.JLabel scanningLabel; |
441 |
private javax.swing.JLabel scanningLabel; |
193 |
// End of variables declaration//GEN-END:variables |
442 |
// End of variables declaration//GEN-END:variables |
194 |
|
443 |
|
|
|
444 |
public static void main(final String[] args) { |
445 |
EventQueue.invokeAndWait(new Runnable() { |
446 |
public void run() { |
447 |
IncludeExcludeVisualizer iev = new IncludeExcludeVisualizer(); |
448 |
File[] roots = new File[args.length]; |
449 |
for (int i = 0; i < args.length; i++) { |
450 |
roots[i] = new File(args[i]); |
195 |
} |
451 |
} |
|
|
452 |
iev.setRoots(roots); |
453 |
JFrame f = new JFrame("IncludeExcludeVisualizerPanel Test"); |
454 |
f.add(iev.getVisualizerPanel()); |
455 |
f.pack(); |
456 |
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); |
457 |
f.setVisible(true); |
458 |
} |
459 |
}); |
460 |
} |
461 |
|
462 |
} |