# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. Index: java/project/build.xml --- java/project/build.xml Base (1.7) +++ java/project/build.xml Locally Modified (Based On 1.7) @@ -19,6 +19,10 @@ --> + + + + + + - - Index: java/project/nbproject/project.xml --- java/project/nbproject/project.xml Base (1.38) +++ java/project/nbproject/project.xml Locally Modified (Based On 1.38) @@ -140,6 +140,14 @@ + org.openide.explorer + + + + 6.11 + + + org.openide.filesystems Index: java/project/src/org/netbeans/spi/java/project/support/ui/Bundle.properties --- java/project/src/org/netbeans/spi/java/project/support/ui/Bundle.properties Base (1.13) +++ java/project/src/org/netbeans/spi/java/project/support/ui/Bundle.properties Locally Modified (Based On 1.13) @@ -28,9 +28,12 @@ # {0} - root folder PackageView.find_packages_progress=Finding packages in {0} -IncludeExcludeVisualizerPanel.includedListLabel.text=Incl&uded Files: -IncludeExcludeVisualizerPanel.excludedListLabel.text=E&xcluded Files: +IncludeExcludeVisualizerPanel.includedListLabel.text=&Included Files and Folders: +IncludeExcludeVisualizerPanel.excludedListLabel.text=&Excluded Files and Folders IncludeExcludeVisualizerPanel.scanningLabel.text=Scanning... -IncludeExcludeVisualizerPanel.includesLabel.text=&Includes: -IncludeExcludeVisualizerPanel.excludesLabel.text=&Excludes: +IncludeExcludeVisualizerPanel.includesLabel.text=Incl&udes: +IncludeExcludeVisualizerPanel.excludesLabel.text=Exclu&des: IncludeExcludeVisualizerPanel.explanation.text=Sample patterns: com/mycorp/, **/doc-files/, **/*.html +IncludeExcludeVisualizerPanel.border.advancedPanel.title=Advanced: +IncludeExcludeVisualizerPanel.excludeButton.text=→ E&xclude +IncludeExcludeVisualizerPanel.includeButton.text=← I&nclude Index: java/project/src/org/netbeans/spi/java/project/support/ui/IncludeExcludeVisualizer.java --- java/project/src/org/netbeans/spi/java/project/support/ui/IncludeExcludeVisualizer.java Base (1.2) +++ java/project/src/org/netbeans/spi/java/project/support/ui/IncludeExcludeVisualizer.java Locally Modified (Based On 1.2) @@ -21,18 +21,10 @@ import java.awt.EventQueue; import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.SortedSet; -import java.util.TreeSet; -import java.util.regex.Pattern; import javax.swing.JComponent; -import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import org.netbeans.spi.project.support.ant.PathMatcher; -import org.openide.util.NbPreferences; +import org.openide.util.ChangeSupport; import org.openide.util.Parameters; -import org.openide.util.RequestProcessor; /** * Utility permitting a user to easily see the effect of changing include @@ -50,14 +42,8 @@ private File[] roots = {}; private String includes = "**"; // NOI18N private String excludes = ""; // NOI18N - private final List listeners = new ArrayList(1); + private final ChangeSupport cs = new ChangeSupport(this); private IncludeExcludeVisualizerPanel panel; - private SortedSet included = new TreeSet(); - private SortedSet excluded = new TreeSet(); - private boolean busy = false; - private boolean interrupted = false; - private static final RequestProcessor RP = new RequestProcessor(IncludeExcludeVisualizer.class.getName()); - private final RequestProcessor.Task task = RP.create(new RecalculateTask()); /** * Create a new visualizer. @@ -79,7 +65,7 @@ } } this.roots = roots; - recalculate(); + updateFields(); } /** @@ -98,8 +84,7 @@ public synchronized void setIncludePattern(String pattern) { Parameters.notNull("pattern", pattern); includes = pattern; - updateIncludesExcludes(); - recalculate(); + updateFields(); } /** @@ -118,15 +103,14 @@ public synchronized void setExcludePattern(String pattern) { Parameters.notNull("pattern", pattern); excludes = pattern; - updateIncludesExcludes(); - recalculate(); + updateFields(); } - private synchronized void updateIncludesExcludes() { + private synchronized void updateFields() { if (panel != null) { EventQueue.invokeLater(new Runnable() { public void run() { - panel.setFields(includes, excludes); + panel.setFields(includes, excludes, roots); } }); } @@ -137,7 +121,7 @@ * @param l the listener */ public synchronized void addChangeListener(ChangeListener l) { - listeners.add(l); + cs.addChangeListener(l); } /** @@ -145,7 +129,7 @@ * @param l the listener */ public synchronized void removeChangeListener(ChangeListener l) { - listeners.remove(l); + cs.removeChangeListener(l); } /** @@ -154,17 +138,9 @@ synchronized void changedPatterns(String includes, String excludes) { this.includes = includes; this.excludes = excludes; - recalculate(); - fireChange(); + cs.fireChange(); } - private synchronized void fireChange() { - ChangeEvent e = new ChangeEvent(this); - for (ChangeListener l : listeners) { - l.stateChanged(e); - } - } - /** * Get the associated visual panel. * @return a panel displaying this include and exclude information @@ -176,94 +152,9 @@ } if (panel == null) { panel = new IncludeExcludeVisualizerPanel(this); - panel.setFields(includes, excludes); - panel.setFiles(included.toArray(new File[included.size()]), excluded.toArray(new File[excluded.size()]), busy); + panel.setFields(includes, excludes, roots); } return panel; } - private static final int DELAY = 200; - private synchronized void recalculate() { - interrupted = true; - task.schedule(DELAY); } - - private void updateFiles() { - assert Thread.holdsLock(this); - EventQueue.invokeLater(new Runnable() { - public void run() { - synchronized (IncludeExcludeVisualizer.this) { - if (panel != null) { - panel.setFiles(included.toArray(new File[included.size()]), excluded.toArray(new File[excluded.size()]), busy); - } - } - } - }); - } - - private int scanCounter; - private static final int GRANULARITY = 1000; - private void scan(File d, String prefix, PathMatcher matcher, Pattern ignoredFiles) { - String[] children = d.list(); - if (children == null) { - return; - } - for (String child : children) { - if (ignoredFiles.matcher(child).find()) { - continue; - } - File f = new File(d, child); - boolean dir = f.isDirectory(); - if (dir) { - scan(f, prefix + child + "/", matcher, ignoredFiles); // NOI18N - } else { - synchronized (this) { - if (interrupted) { - return; - } - if (matcher.matches(prefix + child, false)) { - included.add(f); - } else { - excluded.add(f); - } - if (++scanCounter % GRANULARITY == 0) { - updateFiles(); - } - } - } - } - } - - private final class RecalculateTask implements Runnable { - - // XXX #95974: VisibilityQuery only works on FileObject, and that would be too slow - // copied from: org.netbeans.modules.masterfs.GlobalVisibilityQueryImpl - final Pattern ignoredFiles = Pattern.compile(NbPreferences.root().node("/org/netbeans/core"). // NOI18N - get("IgnoredFiles", "^(CVS|SCCS|vssver\\.scc|#.*#|%.*%|\\.(cvsignore|svn|DS_Store)|_svn)$|~$|^\\..*$")); // NOI18N - - public void run() { - File[] _roots; - String _includes, _excludes; - synchronized (IncludeExcludeVisualizer.this) { - busy = true; - included.clear(); - excluded.clear(); - _roots = roots.clone(); - _includes = includes; - _excludes = excludes; - interrupted = false; - updateFiles(); - } - PathMatcher matcher = new PathMatcher(_includes, _excludes, null); - for (File root : _roots) { - scan(root, "", matcher, ignoredFiles); - } - synchronized (IncludeExcludeVisualizer.this) { - busy = false; - updateFiles(); - } - } - - } - -} Index: java/project/src/org/netbeans/spi/java/project/support/ui/IncludeExcludeVisualizerPanel.form --- java/project/src/org/netbeans/spi/java/project/support/ui/IncludeExcludeVisualizerPanel.form Base (1.2) +++ java/project/src/org/netbeans/spi/java/project/support/ui/IncludeExcludeVisualizerPanel.form Locally Modified (Based On 1.2) @@ -1,7 +1,11 @@ -
+ + + + + @@ -13,72 +17,59 @@ - - + - - - - + + + + + + + - - + + - + + + + + + + - - - - + - - - - + + + - - - - - - - - - + + + - - - - - - + + - - - - - - - - + @@ -86,53 +77,125 @@ - - - + - - - - + + + + + + + - - - - - + + + + + + + + + + + + - - - + - - - - - - - - + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -141,9 +204,13 @@ + + + + @@ -153,16 +220,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: java/project/src/org/netbeans/spi/java/project/support/ui/IncludeExcludeVisualizerPanel.java --- java/project/src/org/netbeans/spi/java/project/support/ui/IncludeExcludeVisualizerPanel.java Base (1.2) +++ java/project/src/org/netbeans/spi/java/project/support/ui/IncludeExcludeVisualizerPanel.java Locally Modified (Based On 1.2) @@ -20,19 +20,44 @@ package org.netbeans.spi.java.project.support.ui; import java.awt.EventQueue; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; import java.io.File; +import java.util.Set; +import java.util.regex.Pattern; import javax.swing.DefaultListModel; +import javax.swing.JFrame; import javax.swing.JPanel; +import javax.swing.WindowConstants; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; +import org.netbeans.spi.project.support.ant.PathMatcher; +import org.openide.explorer.ExplorerManager; +import org.openide.explorer.view.BeanTreeView; +import org.openide.nodes.AbstractNode; +import org.openide.nodes.Children; +import org.openide.nodes.Node; +import org.openide.util.NbPreferences; +import org.openide.util.RequestProcessor; +import org.openide.util.WeakSet; class IncludeExcludeVisualizerPanel extends JPanel { private final IncludeExcludeVisualizer handle; + private File[] roots; + private String currentIncludes; + private String currentExcludes; private final DocumentListener listener = new DocumentListener() { private void changes() { - handle.changedPatterns(includes.getText(), excludes.getText()); + String _includes = includes.getText(); + String _excludes = excludes.getText(); + synchronized (IncludeExcludeVisualizerPanel.this) { + currentIncludes = _includes; + currentExcludes = _excludes; } + handle.changedPatterns(_includes, _excludes); + recalculate(); + } public void insertUpdate(DocumentEvent e) { changes(); } @@ -41,41 +66,181 @@ } public void changedUpdate(DocumentEvent e) {} }; - private final DefaultListModel includedListModel = new DefaultListModel(); - private final DefaultListModel excludedListModel = new DefaultListModel(); + private final ExplorerManager includeSelection = new ExplorerManager(); + private final ExplorerManager excludeSelection = new ExplorerManager(); + public IncludeExcludeVisualizerPanel(IncludeExcludeVisualizer handle) { this.handle = handle; initComponents(); includes.getDocument().addDocumentListener(listener); excludes.getDocument().addDocumentListener(listener); - includedList.setModel(includedListModel); - excludedList.setModel(excludedListModel); + includeSelection.setRootContext(new AbstractNode(includedRoots)); + excludeSelection.setRootContext(new AbstractNode(excludedRoots)); + class ExplorerPanel extends JPanel implements ExplorerManager.Provider { + final ExplorerManager mgr; + ExplorerPanel(ExplorerManager mgr) { + this.mgr = mgr; + add(new BeanTreeView()); } + public ExplorerManager getExplorerManager() { + return mgr; + } + } + includedListPanel.add(new ExplorerPanel(includeSelection)); + excludedListPanel.add(new ExplorerPanel(excludeSelection)); + PropertyChangeListener updateButtons = new PropertyChangeListener() { + public void propertyChange(PropertyChangeEvent evt) { + // XXX update button states + } + }; + includeSelection.addPropertyChangeListener(updateButtons); + excludeSelection.addPropertyChangeListener(updateButtons); + } - void setFields(String includes, String excludes) { + synchronized void setFields(String includes, String excludes, File[] roots) { assert EventQueue.isDispatchThread(); + this.roots = roots; + currentIncludes = includes; + currentExcludes = excludes; this.includes.getDocument().removeDocumentListener(listener); this.includes.setText(includes); this.includes.getDocument().addDocumentListener(listener); this.excludes.getDocument().removeDocumentListener(listener); this.excludes.setText(excludes); this.excludes.getDocument().addDocumentListener(listener); + recalculate(); } - void setFiles(File[] included, File[] excluded, boolean busy) { - assert EventQueue.isDispatchThread(); - includedListModel.clear(); - for (File f : included) { - includedListModel.addElement(f); + //private boolean interrupted; + private static final RequestProcessor RP = new RequestProcessor(IncludeExcludeVisualizerPanel.class.getName()); + private final RequestProcessor.Task task = RP.create(new RecalculateTask()); + private static final int DELAY = 200; + private synchronized void recalculate() { + //interrupted = true; + task.schedule(DELAY); } - excludedListModel.clear(); - for (File f : excluded) { - excludedListModel.addElement(f); + + private final class RecalculateTask implements Runnable { + + public void run() { + scanningLabel.setVisible(true); + File[] _roots; + String _includes, _excludes; + synchronized (IncludeExcludeVisualizerPanel.this) { + //interrupted = false; + _roots = roots.clone(); + _includes = currentIncludes; + _excludes = currentExcludes; } - scanningLabel.setVisible(busy); + includedRoots.update(roots, _includes, _excludes); + excludedRoots.update(roots, _includes, _excludes); + scanningLabel.setVisible(false); } + } + + // XXX #95974: VisibilityQuery only works on FileObject, and that would be too slow + // copied from: org.netbeans.modules.masterfs.GlobalVisibilityQueryImpl + private final Pattern ignoredFiles = Pattern.compile(NbPreferences.root().node("/org/netbeans/core").get("IgnoredFiles", // NOI18N + "^(CVS|SCCS|vssver\\.scc|#.*#|%.*%|\\.(cvsignore|svn|DS_Store)|_svn)$|~$|^\\..*$")); // NOI18N + + /* + private void scan(File d, String prefix, PathMatcher matcher) { + String[] children = d.list(); + if (children == null) { + return; + } + for (String child : children) { + if (ignoredFiles.matcher(child).find()) { + continue; + } + File f = new File(d, child); + boolean dir = f.isDirectory(); + if (dir) { + scan(f, prefix + child + "/", matcher); // NOI18N + } else { + synchronized (this) { + if (interrupted) { + return; + } + if (matcher.matches(prefix + child, false)) { + included.add(f); + } else { + excluded.add(f); + } + } + } + } + } + */ + + private final RootChildren includedRoots = new RootChildren(true); + private final RootChildren excludedRoots = new RootChildren(false); + + private final class RootChildren extends Children.Keys { + + private final boolean includeMode; + private String includes; + private String excludes; + + RootChildren(boolean includeMode) { + this.includeMode = includeMode; + } + + void update(File[] roots, String includes, String excludes) { + this.includes = includes; + this.excludes = excludes; + setKeys(roots); + for (Node n : getNodes(true)) { + //XXX((FileNode) n).update(matcher); + } + } + + protected Node[] createNodes(File file) { + return new Node[] {new FileNode(file, true, new PathMatcher(includes, excludes, file))}; + } + + } + + private final class FileNode extends AbstractNode { + + private final File file; + private boolean top; + private PathMatcher matcher; + + FileNode(File file, boolean top, PathMatcher matcher) { + super(file.isDirectory() ? new FileChildren(file) : Children.LEAF); + this.file = file; + this.top = top; + } + + public @Override String getDisplayName() { + return top ? file.getAbsolutePath() : file.getName(); + } + + } + + private final class FileChildren extends Children.Keys { + + private final File file; + private PathMatcher matcher; + + FileChildren(File file, PathMatcher matcher) { + this.file = file; + } + + protected @Override void addNotify() { + super.addNotify(); + + } + + protected Node[] createNodes(File key) { + return new Node[] {new FileNode(key, false)}; + } + + } + /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is @@ -85,111 +250,213 @@ private void initComponents() { includedListLabel = new javax.swing.JLabel(); - includedListPane = new javax.swing.JScrollPane(); - includedList = new javax.swing.JList(); + includedListPanel = new javax.swing.JPanel(); excludedListLabel = new javax.swing.JLabel(); - excludedListPane = new javax.swing.JScrollPane(); - excludedList = new javax.swing.JList(); + excludeButton = new javax.swing.JButton(); + includeButton = new javax.swing.JButton(); scanningLabel = new javax.swing.JLabel(); + advancedPanel = new javax.swing.JPanel(); includesLabel = new javax.swing.JLabel(); includes = new javax.swing.JTextField(); excludesLabel = new javax.swing.JLabel(); excludes = new javax.swing.JTextField(); explanation = new javax.swing.JLabel(); + excludedListPanel = new javax.swing.JPanel(); - includedListLabel.setLabelFor(includedList); + setName("Form"); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(includedListLabel, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.includedListLabel.text")); // NOI18N + includedListLabel.setName("includedListLabel"); // NOI18N - includedListPane.setViewportView(includedList); + includedListPanel.setBackground(new java.awt.Color(255, 51, 204)); + includedListPanel.setName("includedListPanel"); // NOI18N - excludedListLabel.setLabelFor(excludedList); + org.jdesktop.layout.GroupLayout includedListPanelLayout = new org.jdesktop.layout.GroupLayout(includedListPanel); + includedListPanel.setLayout(includedListPanelLayout); + includedListPanelLayout.setHorizontalGroup( + includedListPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(0, 274, Short.MAX_VALUE) + ); + includedListPanelLayout.setVerticalGroup( + includedListPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(0, 143, Short.MAX_VALUE) + ); + org.openide.awt.Mnemonics.setLocalizedText(excludedListLabel, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.excludedListLabel.text")); // NOI18N + excludedListLabel.setName("excludedListLabel"); // NOI18N - excludedListPane.setViewportView(excludedList); + org.openide.awt.Mnemonics.setLocalizedText(excludeButton, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.excludeButton.text")); // NOI18N + excludeButton.setName("excludeButton"); // NOI18N + excludeButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + excludeButtonActionPerformed(evt); + } + }); + org.openide.awt.Mnemonics.setLocalizedText(includeButton, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.includeButton.text")); // NOI18N + includeButton.setName("includeButton"); // NOI18N + includeButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + includeButtonActionPerformed(evt); + } + }); + org.openide.awt.Mnemonics.setLocalizedText(scanningLabel, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.scanningLabel.text")); // NOI18N + scanningLabel.setName("scanningLabel"); // NOI18N + advancedPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.border.advancedPanel.title"))); // NOI18N + advancedPanel.setName("advancedPanel"); // NOI18N + includesLabel.setLabelFor(includes); org.openide.awt.Mnemonics.setLocalizedText(includesLabel, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.includesLabel.text")); // NOI18N + includesLabel.setName("includesLabel"); // NOI18N + includes.setName("includes"); // NOI18N + excludesLabel.setLabelFor(excludes); org.openide.awt.Mnemonics.setLocalizedText(excludesLabel, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.excludesLabel.text")); // NOI18N + excludesLabel.setName("excludesLabel"); // NOI18N + excludes.setName("excludes"); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(explanation, org.openide.util.NbBundle.getMessage(IncludeExcludeVisualizerPanel.class, "IncludeExcludeVisualizerPanel.explanation.text")); // NOI18N + explanation.setName("explanation"); // NOI18N + org.jdesktop.layout.GroupLayout advancedPanelLayout = new org.jdesktop.layout.GroupLayout(advancedPanel); + advancedPanel.setLayout(advancedPanelLayout); + advancedPanelLayout.setHorizontalGroup( + advancedPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(advancedPanelLayout.createSequentialGroup() + .addContainerGap() + .add(advancedPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(advancedPanelLayout.createSequentialGroup() + .add(advancedPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(includesLabel) + .add(excludesLabel)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(advancedPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(excludes, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 567, Short.MAX_VALUE) + .add(includes, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 567, Short.MAX_VALUE))) + .add(explanation, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 630, Short.MAX_VALUE)) + .addContainerGap()) + ); + advancedPanelLayout.setVerticalGroup( + advancedPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(advancedPanelLayout.createSequentialGroup() + .add(advancedPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(includesLabel) + .add(includes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(advancedPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(excludesLabel) + .add(excludes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(explanation, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + excludedListPanel.setBackground(new java.awt.Color(51, 255, 51)); + excludedListPanel.setName("excludedListPanel"); // NOI18N + + org.jdesktop.layout.GroupLayout excludedListPanelLayout = new org.jdesktop.layout.GroupLayout(excludedListPanel); + excludedListPanel.setLayout(excludedListPanelLayout); + excludedListPanelLayout.setHorizontalGroup( + excludedListPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(0, 290, Short.MAX_VALUE) + ); + excludedListPanelLayout.setVerticalGroup( + excludedListPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(0, 143, Short.MAX_VALUE) + ); + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() - .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(layout.createSequentialGroup() - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(includesLabel) - .add(excludesLabel)) + .add(includedListPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(includedListLabel)) + .add(12, 12, 12) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) + .add(excludeButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .add(includeButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 76, Short.MAX_VALUE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(excludes, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 371, Short.MAX_VALUE) - .add(includes, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 371, Short.MAX_VALUE))) + .add(excludedListLabel) + .add(excludedListPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(scanningLabel) - .add(includedListLabel)) + .add(advancedPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) - .add(layout.createSequentialGroup() - .add(excludedListLabel) - .addContainerGap(361, Short.MAX_VALUE)) - .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() - .add(includedListPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE) - .addContainerGap()) - .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) - .add(explanation, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE) - .add(excludedListPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE)) - .addContainerGap()))) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() - .addContainerGap() - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(includesLabel) - .add(includes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(excludesLabel) - .add(excludes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(scanningLabel) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(includedListLabel) + .add(excludedListLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(includedListPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() + .add(excludeButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(excludedListLabel) + .add(includeButton) + .add(67, 67, 67)) + .add(layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(excludedListPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 143, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) + .add(org.jdesktop.layout.GroupLayout.LEADING, excludedListPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .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)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(explanation, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 40, Short.MAX_VALUE) - .addContainerGap()) + .add(scanningLabel) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(advancedPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) ); }// //GEN-END:initComponents + private void includeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_includeButtonActionPerformed + // XXX +}//GEN-LAST:event_includeButtonActionPerformed + private void excludeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_excludeButtonActionPerformed + // XXX + }//GEN-LAST:event_excludeButtonActionPerformed + + // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JList excludedList; + private javax.swing.JPanel advancedPanel; + private javax.swing.JButton excludeButton; private javax.swing.JLabel excludedListLabel; - private javax.swing.JScrollPane excludedListPane; + private javax.swing.JPanel excludedListPanel; private javax.swing.JTextField excludes; private javax.swing.JLabel excludesLabel; private javax.swing.JLabel explanation; - private javax.swing.JList includedList; + private javax.swing.JButton includeButton; private javax.swing.JLabel includedListLabel; - private javax.swing.JScrollPane includedListPane; + private javax.swing.JPanel includedListPanel; private javax.swing.JTextField includes; private javax.swing.JLabel includesLabel; private javax.swing.JLabel scanningLabel; // End of variables declaration//GEN-END:variables + public static void main(final String[] args) { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + IncludeExcludeVisualizer iev = new IncludeExcludeVisualizer(); + File[] roots = new File[args.length]; + for (int i = 0; i < args.length; i++) { + roots[i] = new File(args[i]); } + iev.setRoots(roots); + JFrame f = new JFrame("IncludeExcludeVisualizerPanel Test"); + f.add(iev.getVisualizerPanel()); + f.pack(); + f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); + f.setVisible(true); + } + }); + } + +}