[hg] main-silver: #71051: Add Module Dependency now permits clus...

  • From: Martin Kozeny < >
  • To:
  • Subject: [hg] main-silver: #71051: Add Module Dependency now permits clus...
  • Date: Thu, 12 Sep 2013 11:50:04 -0700

changeset eb9ba8be6c1f in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/eb9ba8be6c1f
description:
        #71051: Add Module Dependency now permits cluster filtering.

diffstat:

 apisupport.ant/nbproject/project.xml                                         
                               |    9 +
 
apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/AddModuleFilter.java
               |   10 +-
 
apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/AddModulePanel.form
                |   40 ++-
 
apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/AddModulePanel.java
                |  138 +++++++++-
 
apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/Bundle.properties
                  |    1 +
 
apisupport.ant/test/unit/src/org/netbeans/modules/apisupport/project/ui/customizer/AddModuleFilterTest.java
 |    6 +-
 6 files changed, 179 insertions(+), 25 deletions(-)

diffs (494 lines):

diff --git a/apisupport.ant/nbproject/project.xml 
b/apisupport.ant/nbproject/project.xml
--- a/apisupport.ant/nbproject/project.xml
+++ b/apisupport.ant/nbproject/project.xml
@@ -59,6 +59,15 @@
                     </run-dependency>
                 </dependency>
                 <dependency>
+                    
<code-name-base>org.jdesktop.beansbinding</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>1.22</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
                     
<code-name-base>org.netbeans.api.annotations.common</code-name-base>
                     <build-prerequisite/>
                     <compile-dependency/>
diff --git 
a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/AddModuleFilter.java
 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/AddModuleFilter.java
--- 
a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/AddModuleFilter.java
+++ 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/AddModuleFilter.java
@@ -82,14 +82,20 @@
     /**
      * Find matches for a search string.
      */
-    public Set<ModuleDependency> getMatches(String text, Boolean matchCase) {
+    public Set<ModuleDependency> getMatches(Set<ModuleDependency> 
dependencies, String text, Boolean matchCase) {
+        Set<ModuleDependency> dependenciesToFilter;
+        if(dependencies != null) {
+            dependenciesToFilter = dependencies;
+        } else {
+            dependenciesToFilter = universe;
+        }
         String textLC = matchCase?text:text.toLowerCase(Locale.ENGLISH);
         List<Set<ModuleDependency>> matches = new 
ArrayList<Set<ModuleDependency>>(3);
         for (int i = 0; i < 3; i++) {
             // Within groups, just sort by module display name:
             matches.add(new 
TreeSet<ModuleDependency>(ModuleDependency.LOCALIZED_NAME_COMPARATOR));
         }
-        for (ModuleDependency dep : universe) {
+        for (ModuleDependency dep : dependenciesToFilter) {
             if (Thread.interrupted()) {
                 break;
             }
diff --git 
a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/AddModulePanel.form
 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/AddModulePanel.form
--- 
a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/AddModulePanel.form
+++ 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/AddModulePanel.form
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 
-<Form version="1.2" maxVersion="1.2" 
type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+<Form version="1.5" maxVersion="1.9" 
type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
   <Properties>
     <Property name="border" type="javax.swing.border.Border" 
editor="org.netbeans.modules.form.editors2.BorderEditor">
       <Border 
info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
@@ -36,7 +36,7 @@
       </Properties>
       <Constraints>
         <Constraint 
layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" 
value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
-          <GridBagConstraints gridX="0" gridY="2" gridWidth="0" 
gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="0" 
insetsBottom="0" insetsRight="0" anchor="16" weightX="0.0" weightY="0.0"/>
+          <GridBagConstraints gridX="0" gridY="3" gridWidth="0" 
gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="0" 
insetsBottom="0" insetsRight="0" anchor="16" weightX="0.0" weightY="0.0"/>
         </Constraint>
       </Constraints>
     </Component>
@@ -48,7 +48,7 @@
       </Properties>
       <Constraints>
         <Constraint 
layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" 
value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
-          <GridBagConstraints gridX="0" gridY="3" gridWidth="0" 
gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" 
insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="1.0"/>
+          <GridBagConstraints gridX="0" gridY="4" gridWidth="0" 
gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" 
insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="1.0"/>
         </Constraint>
       </Constraints>
 
@@ -72,7 +72,7 @@
       </Properties>
       <Constraints>
         <Constraint 
layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" 
value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
-          <GridBagConstraints gridX="0" gridY="4" gridWidth="0" 
gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="0" 
insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
+          <GridBagConstraints gridX="0" gridY="5" gridWidth="0" 
gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="0" 
insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
         </Constraint>
       </Constraints>
     </Component>
@@ -100,7 +100,7 @@
       </AuxValues>
       <Constraints>
         <Constraint 
layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" 
value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
-          <GridBagConstraints gridX="1" gridY="0" gridWidth="0" 
gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" 
insetsBottom="0" insetsRight="0" anchor="17" weightX="1.0" weightY="0.0"/>
+          <GridBagConstraints gridX="1" gridY="0" gridWidth="0" 
gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" 
insetsBottom="4" insetsRight="0" anchor="17" weightX="1.0" weightY="0.0"/>
         </Constraint>
       </Constraints>
     </Component>
@@ -112,7 +112,7 @@
       </Properties>
       <Constraints>
         <Constraint 
layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" 
value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
-          <GridBagConstraints gridX="0" gridY="5" gridWidth="0" 
gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" 
insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="1.0"/>
+          <GridBagConstraints gridX="0" gridY="6" gridWidth="0" 
gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" 
insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="1.0"/>
         </Constraint>
       </Constraints>
 
@@ -140,7 +140,7 @@
       </Events>
       <Constraints>
         <Constraint 
layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" 
value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
-          <GridBagConstraints gridX="0" gridY="6" gridWidth="0" 
gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="0" 
insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
+          <GridBagConstraints gridX="0" gridY="7" gridWidth="0" 
gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="0" 
insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
         </Constraint>
       </Constraints>
     </Component>
@@ -160,7 +160,7 @@
       </Events>
       <Constraints>
         <Constraint 
layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" 
value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
-          <GridBagConstraints gridX="0" gridY="1" gridWidth="2" 
gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="0" 
insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
+          <GridBagConstraints gridX="0" gridY="2" gridWidth="2" 
gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="0" 
insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
         </Constraint>
       </Constraints>
     </Component>
@@ -176,7 +176,7 @@
       </AuxValues>
       <Constraints>
         <Constraint 
layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" 
value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
-          <GridBagConstraints gridX="3" gridY="1" gridWidth="1" 
gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="4" insetsLeft="6" 
insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
+          <GridBagConstraints gridX="3" gridY="2" gridWidth="1" 
gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="4" insetsLeft="6" 
insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
         </Constraint>
       </Constraints>
     </Component>
@@ -189,7 +189,27 @@
       </Events>
       <Constraints>
         <Constraint 
layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" 
value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
-          <GridBagConstraints gridX="2" gridY="1" gridWidth="1" 
gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="4" insetsLeft="6" 
insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
+          <GridBagConstraints gridX="2" gridY="2" gridWidth="1" 
gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="4" insetsLeft="6" 
insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
+        </Constraint>
+      </Constraints>
+    </Component>
+    <Component class="javax.swing.JComboBox" name="clusterFilterComboBox">
+      <Constraints>
+        <Constraint 
layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" 
value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+          <GridBagConstraints gridX="1" gridY="1" gridWidth="1" 
gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="4" insetsLeft="0" 
insetsBottom="4" insetsRight="0" anchor="17" weightX="2.0" weightY="0.0"/>
+        </Constraint>
+      </Constraints>
+    </Component>
+    <Component class="javax.swing.JLabel" name="clusterFilterLabel">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="C&amp;luster:"/>
+      </Properties>
+      <AuxValues>
+        <AuxValue name="JavaCodeGenerator_InitCodePre" 
type="java.lang.String" 
value="clusterFilterLabel.setLabelFor(clusterFilterComboBox);"/>
+      </AuxValues>
+      <Constraints>
+        <Constraint 
layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" 
value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+          <GridBagConstraints gridX="0" gridY="1" gridWidth="1" 
gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" 
insetsBottom="0" insetsRight="8" anchor="17" weightX="0.0" weightY="0.0"/>
         </Constraint>
       </Constraints>
     </Component>
diff --git 
a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/AddModulePanel.java
 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/AddModulePanel.java
--- 
a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/AddModulePanel.java
+++ 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/AddModulePanel.java
@@ -53,7 +53,12 @@
 import java.awt.Rectangle;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
 import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
 import java.util.Locale;
 import java.util.Set;
 import javax.swing.AbstractAction;
@@ -75,6 +80,7 @@
 import javax.swing.text.StyledDocument;
 import org.netbeans.modules.apisupport.project.api.UIUtil;
 import org.netbeans.modules.apisupport.project.api.Util;
+import org.netbeans.modules.apisupport.project.suite.SuiteProject;
 import org.netbeans.modules.apisupport.project.universe.NbPlatform;
 import org.openide.DialogDescriptor;
 import org.openide.DialogDisplayer;
@@ -95,14 +101,18 @@
 public final class AddModulePanel extends JPanel {
     
     private static final String FILTER_DESCRIPTION = 
getMessage("LBL_FilterDescription");
+    private static final String ALL_CLUSTERS = 
getMessage("TEXT_SelectAllClusters");
     private static final RequestProcessor RP = new 
RequestProcessor(AddModulePanel.class.getName(), 2, true);
     private static Rectangle lastSize;
     
     private CustomizerComponentFactory.DependencyListModel universeModules;
+    private Set<ModuleDependency> selectedDeps;
     private RequestProcessor.Task filterTask;
     private AddModuleFilter filterer;
     private URL currectJavadoc;
     
+    private final Object IMPL_LOCK = new Object();
+    
     private final SingleModuleProperties props;
     private Timer timer;
     
@@ -164,6 +174,7 @@
         initAccessibility();
         filterValue.setText(initialString);
         fillUpUniverseModules();
+        fillUpUniverseClusters();
         
moduleList.setCellRenderer(CustomizerComponentFactory.getDependencyCellRenderer(false));
         moduleList.addListSelectionListener(new ListSelectionListener() {
             public void valueChanged(ListSelectionEvent e) {
@@ -194,6 +205,55 @@
                 }
             }
         });
+        clusterFilterComboBox.addItemListener(new ItemListener() {
+            @Override
+            public void itemStateChanged(final ItemEvent e) {
+                filterValue.setEnabled(false);
+                moduleList.setEnabled(false);
+                showNonAPIModules.setEnabled(false);
+                matchCaseValue.setEnabled(false);
+                showExclModulesCheckBox.setEnabled(false);
+                final String lastFilter = filterValue.getText();
+                filterValue.setText(UIUtil.WAIT_VALUE);
+                moduleList.setModel(UIUtil.createListWaitModel());
+                final String selectedClusterStr = 
String.valueOf(clusterFilterComboBox.getSelectedItem());
+                final Set<ModuleDependency> universeDeps = 
universeModules.getDependencies();
+                synchronized (IMPL_LOCK) {
+                    selectedDeps = new HashSet<ModuleDependency>();
+                    if(!ALL_CLUSTERS.equals(selectedClusterStr)) {
+                        for(ModuleDependency dependencyIter:universeDeps) {
+                            
if(selectedClusterStr.equals(dependencyIter.getModuleEntry().getClusterDirectory().getName()))
 {
+                                selectedDeps.add(dependencyIter);
+                            }
+                        }
+                    } else {
+                        selectedDeps.addAll(universeDeps);
+                    }
+                }
+                ModuleProperties.RP.post(new Runnable() {
+                    public void run() {
+                        EventQueue.invokeLater(new Runnable() {
+                            public void run() {
+                                
moduleList.setModel(CustomizerComponentFactory.createSortedDependencyListModel(selectedDeps));
+                                moduleList.setEnabled(true);
+                                filterValue.setEnabled(true);
+                                showNonAPIModules.setEnabled(true);
+                                boolean enableExclModuleChckBox = 
props.isHasExcludedModules() && props.isSuiteComponent()?true:false;
+                                
showExclModulesCheckBox.setEnabled(enableExclModuleChckBox);
+                                matchCaseValue.setEnabled(true);
+                            }
+                        });
+                    }
+                });
+                filterValue.setText(lastFilter);
+                if (!FILTER_DESCRIPTION.equals(lastFilter)) {
+                    search();
+                } else {
+                    filterValue.selectAll();
+                }
+                filterValue.requestFocusInWindow();
+            }
+        });
         // Make basic navigation commands from the list work from the text 
field.
         String[][] listNavCommands = {
             { "selectPreviousRow", "selectPreviousRow" }, // NOI18N
@@ -240,6 +300,36 @@
         }
     }
 
+    private void fillUpUniverseClusters() {
+        final boolean nonApiDeps = showNonAPIModules.isSelected();
+        final boolean exclModules = showExclModulesCheckBox.isSelected();
+        final Object lastSelectedItem = 
clusterFilterComboBox.getSelectedItem();
+        final List<String> allClustersList = new ArrayList<String>();
+        ModuleProperties.RP.post(new Runnable() {
+            public void run() {
+                final Set<ModuleDependency> universeDeps = selectedDeps = 
props.getUniverseDependencies(!exclModules, !nonApiDeps);
+                EventQueue.invokeLater(new Runnable() {
+                    public void run() {
+                        allClustersList.add(ALL_CLUSTERS);
+                        for(ModuleDependency dependencyIter:universeDeps) {
+                            
if(!allClustersList.contains(dependencyIter.getModuleEntry().getClusterDirectory().getName()))
 {
+                                
allClustersList.add(dependencyIter.getModuleEntry().getClusterDirectory().getName());
+                            }
+                        }
+                        String [] allClusters = new 
String[allClustersList.size()];
+                        allClustersList.toArray(allClusters);
+                        clusterFilterComboBox.setModel(new 
javax.swing.DefaultComboBoxModel(allClusters));
+                        for(int i=0; i<clusterFilterComboBox.getItemCount(); 
i++) {
+                            
if(clusterFilterComboBox.getItemAt(i).equals(lastSelectedItem)) {
+                                clusterFilterComboBox.setSelectedIndex(i);
+                            }
+                        }
+                    }
+                });
+            }
+        });
+    }
+
     private void fillUpUniverseModules() {
         filterValue.setEnabled(false);
         moduleList.setEnabled(false);
@@ -363,7 +453,7 @@
         final String text = filterValue.getText();
         final Boolean matchCase = matchCaseValue.isSelected();
         if (text.length() == 0) {
-            moduleList.setModel(universeModules);
+            
moduleList.setModel(CustomizerComponentFactory.createSortedDependencyListModel(selectedDeps));
             moduleList.setSelectedIndex(0);
             moduleList.ensureIndexIsVisible(0);
         } else {
@@ -373,7 +463,10 @@
                     if (_filterer == null) {
                         return;
                     }
-                    final Set<ModuleDependency> matches = 
_filterer.getMatches(text, matchCase);
+                    final Set<ModuleDependency> matches;
+                    synchronized (IMPL_LOCK) {
+                        matches = _filterer.getMatches(selectedDeps, text, 
matchCase);
+                    }
                     synchronized (AddModulePanel.this) {
                         filterTask = null;
                     }
@@ -455,6 +548,8 @@
         showNonAPIModules = new javax.swing.JCheckBox();
         matchCaseValue = new javax.swing.JCheckBox();
         showExclModulesCheckBox = new javax.swing.JCheckBox();
+        clusterFilterComboBox = new javax.swing.JComboBox();
+        clusterFilterLabel = new javax.swing.JLabel();
 
         setBorder(javax.swing.BorderFactory.createEmptyBorder(6, 6, 6, 6));
         setPreferredSize(new java.awt.Dimension(500, 450));
@@ -464,7 +559,7 @@
         org.openide.awt.Mnemonics.setLocalizedText(moduleLabel, 
org.openide.util.NbBundle.getMessage(AddModulePanel.class, "LBL_Module")); // 
NOI18N
         gridBagConstraints = new java.awt.GridBagConstraints();
         gridBagConstraints.gridx = 0;
-        gridBagConstraints.gridy = 2;
+        gridBagConstraints.gridy = 3;
         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
         gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHWEST;
         gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0);
@@ -475,7 +570,7 @@
 
         gridBagConstraints = new java.awt.GridBagConstraints();
         gridBagConstraints.gridx = 0;
-        gridBagConstraints.gridy = 3;
+        gridBagConstraints.gridy = 4;
         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
         gridBagConstraints.weighty = 1.0;
@@ -485,7 +580,7 @@
         org.openide.awt.Mnemonics.setLocalizedText(descLabel, 
org.openide.util.NbBundle.getMessage(AddModulePanel.class, 
"LBL_Description")); // NOI18N
         gridBagConstraints = new java.awt.GridBagConstraints();
         gridBagConstraints.gridx = 0;
-        gridBagConstraints.gridy = 4;
+        gridBagConstraints.gridy = 5;
         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
         gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0);
@@ -506,6 +601,7 @@
         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
         gridBagConstraints.weightx = 1.0;
+        gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 0);
         add(filterValue, gridBagConstraints);
 
         descValueSP.setPreferredSize(new java.awt.Dimension(450, 116));
@@ -516,7 +612,7 @@
 
         gridBagConstraints = new java.awt.GridBagConstraints();
         gridBagConstraints.gridx = 0;
-        gridBagConstraints.gridy = 5;
+        gridBagConstraints.gridy = 6;
         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
         gridBagConstraints.weighty = 1.0;
@@ -532,7 +628,7 @@
         });
         gridBagConstraints = new java.awt.GridBagConstraints();
         gridBagConstraints.gridx = 0;
-        gridBagConstraints.gridy = 6;
+        gridBagConstraints.gridy = 7;
         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
         gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0);
@@ -547,7 +643,7 @@
         });
         gridBagConstraints = new java.awt.GridBagConstraints();
         gridBagConstraints.gridx = 0;
-        gridBagConstraints.gridy = 1;
+        gridBagConstraints.gridy = 2;
         gridBagConstraints.gridwidth = 2;
         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
         gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0);
@@ -562,7 +658,7 @@
         });
         gridBagConstraints = new java.awt.GridBagConstraints();
         gridBagConstraints.gridx = 3;
-        gridBagConstraints.gridy = 1;
+        gridBagConstraints.gridy = 2;
         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
         gridBagConstraints.insets = new java.awt.Insets(4, 6, 0, 0);
         add(matchCaseValue, gridBagConstraints);
@@ -575,13 +671,31 @@
         });
         gridBagConstraints = new java.awt.GridBagConstraints();
         gridBagConstraints.gridx = 2;
-        gridBagConstraints.gridy = 1;
+        gridBagConstraints.gridy = 2;
         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
         gridBagConstraints.insets = new java.awt.Insets(4, 6, 0, 0);
         add(showExclModulesCheckBox, gridBagConstraints);
+        gridBagConstraints = new java.awt.GridBagConstraints();
+        gridBagConstraints.gridx = 1;
+        gridBagConstraints.gridy = 1;
+        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+        gridBagConstraints.weightx = 2.0;
+        gridBagConstraints.insets = new java.awt.Insets(4, 0, 4, 0);
+        add(clusterFilterComboBox, gridBagConstraints);
+
+        clusterFilterLabel.setLabelFor(clusterFilterComboBox);
+        org.openide.awt.Mnemonics.setLocalizedText(clusterFilterLabel, 
"C&luster:");
+        gridBagConstraints = new java.awt.GridBagConstraints();
+        gridBagConstraints.gridx = 0;
+        gridBagConstraints.gridy = 1;
+        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 8);
+        add(clusterFilterLabel, gridBagConstraints);
     }// </editor-fold>//GEN-END:initComponents
     
     private void showNonAPIModulesActionPerformed(java.awt.event.ActionEvent 
evt) {//GEN-FIRST:event_showNonAPIModulesActionPerformed
+        fillUpUniverseClusters();
         fillUpUniverseModules();
     }//GEN-LAST:event_showNonAPIModulesActionPerformed
     
@@ -590,15 +704,19 @@
     }//GEN-LAST:event_showJavadoc
 
     private void matchCaseValueActionPerformed(java.awt.event.ActionEvent 
evt) {//GEN-FIRST:event_matchCaseValueActionPerformed
+        fillUpUniverseClusters();
         fillUpUniverseModules();
     }//GEN-LAST:event_matchCaseValueActionPerformed
 
     private void 
showExclModulesCheckBoxActionPerformed(java.awt.event.ActionEvent evt) 
{//GEN-FIRST:event_showExclModulesCheckBoxActionPerformed
+        fillUpUniverseClusters();
         fillUpUniverseModules();
     }//GEN-LAST:event_showExclModulesCheckBoxActionPerformed
     
     
     // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JComboBox clusterFilterComboBox;
+    private javax.swing.JLabel clusterFilterLabel;
     private javax.swing.JLabel descLabel;
     private javax.swing.JTextPane descValue;
     private javax.swing.JScrollPane descValueSP;
diff --git 
a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/Bundle.properties
 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/Bundle.properties
--- 
a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/Bundle.properties
+++ 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/Bundle.properties
@@ -98,6 +98,7 @@
 CTL_AddModuleDependencyTitle=Add Module Dependency
 CTL_ShowJavadoc=Show &Javadoc
 LBL_Description=&Description:
+TEXT_SelectAllClusters=All clusters
 LBL_FilterDescription=(try class or package names; JAR paths; display or 
code names)
 LBL_Filter=&Filter:
 LBL_Module=&Module:
diff --git 
a/apisupport.ant/test/unit/src/org/netbeans/modules/apisupport/project/ui/customizer/AddModuleFilterTest.java
 
b/apisupport.ant/test/unit/src/org/netbeans/modules/apisupport/project/ui/customizer/AddModuleFilterTest.java
--- 
a/apisupport.ant/test/unit/src/org/netbeans/modules/apisupport/project/ui/customizer/AddModuleFilterTest.java
+++ 
b/apisupport.ant/test/unit/src/org/netbeans/modules/apisupport/project/ui/customizer/AddModuleFilterTest.java
@@ -104,13 +104,13 @@
 //    }
     
     public void testMatchStrings() throws Exception {
-        ModuleDependency dep = filter.getMatches("callablesys", 
false).iterator().next();
+        ModuleDependency dep = filter.getMatches(null, "callablesys", 
false).iterator().next();
         
assertEquals(Collections.singleton("org.openide.util.actions.CallableSystemAction"),
 filter.getMatchesFor("callablesys", dep));
     }
     
     public void testMatchOrdering() throws Exception { // #71995
         List<String> matches = new ArrayList<String>();
-        for (ModuleDependency dep : filter.getMatches("systemaction", 
false)) {
+        for (ModuleDependency dep : filter.getMatches(null, "systemaction", 
false)) {
             matches.add(dep.getModuleEntry().getCodeNameBase());
         }
         assertEquals(Arrays.asList(
@@ -122,7 +122,7 @@
     
     private void assertMatches(String text, String[] cnbs) {
         Set<String> matchedCNBs = new HashSet<String>();
-        for (ModuleDependency dep : filter.getMatches(text, false)) {
+        for (ModuleDependency dep : filter.getMatches(null, text, false)) {
             matchedCNBs.add(dep.getModuleEntry().getCodeNameBase());
         }
         assertEquals("correct matches for '" + text + "'", new 
HashSet<String>(Arrays.asList(cnbs)), matchedCNBs);

[hg] main-silver: #71051: Add Module Dependency now permits clus...

Martin Kozeny 09/12/2013

Project Features

About this Project

APIsupport was started in November 2009, is owned by Antonin Nebuzelsky, and has 43 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close