[hg] main-silver: decouple FindInQuery from QueryTopComponent

  • From: Tomas Stupka < >
  • To:
  • Subject: [hg] main-silver: decouple FindInQuery from QueryTopComponent
  • Date: Tue, 05 Mar 2013 11:40:17 -0800

changeset ca3eb98f8154 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/ca3eb98f8154
description:
        decouple FindInQuery from QueryTopComponent

diffstat:

 
bugtracking/src/org/netbeans/modules/bugtracking/issuetable/Bundle.properties 
      |    9 +
 
bugtracking/src/org/netbeans/modules/bugtracking/issuetable/FindInQueryBar.form
     |  130 ++++
 
bugtracking/src/org/netbeans/modules/bugtracking/issuetable/FindInQueryBar.java
     |  320 ++++++++++
 
bugtracking/src/org/netbeans/modules/bugtracking/issuetable/FindInQuerySupport.java
 |  180 +++++
 bugtracking/src/org/netbeans/modules/bugtracking/issuetable/IssueTable.java  
       |   47 +-
 bugtracking/src/org/netbeans/modules/bugtracking/ui/query/Bundle.properties  
       |    8 -
 
bugtracking/src/org/netbeans/modules/bugtracking/ui/query/FindInQueryBar.form 
      |  130 ----
 
bugtracking/src/org/netbeans/modules/bugtracking/ui/query/FindInQueryBar.java 
      |  320 ----------
 
bugtracking/src/org/netbeans/modules/bugtracking/ui/query/FindInQuerySupport.java
   |  136 ----
 
bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponent.java
    |   14 +-
 10 files changed, 682 insertions(+), 612 deletions(-)

diffs (1451 lines):

diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/Bundle.properties
 
b/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/Bundle.properties
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/Bundle.properties
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/Bundle.properties
@@ -74,3 +74,12 @@
 LBL_ObsoleteIssuesFilter = Archived Issues
 LBL_AllButObsoleteIssuesFilter = All but Archived Issues
 LBL_SimpleSearchFilter = By Id or Summary
+
+FindInQueryBar.findLabel.text=Find in issue summary:
+FindInQueryBar.machCaseChoice.text=Match Case
+FindInQueryBar.wholeWordsChoice.text=Whole Words
+FindInQueryBar.highlightResultsChoice.text=Highlight Results
+FindInQueryBar.regularExpressionChoice.text=Regular Expression
+
+FindInQueryBar.invalidExpression=The syntax of the regular expression is 
invalid.
+NewJPanel.jButton1.text=jButton1
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/FindInQueryBar.form
 
b/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/FindInQueryBar.form
new file mode 100644
--- /dev/null
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/FindInQueryBar.form
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.5" maxVersion="1.7" 
type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+  <AuxValues>
+    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" 
value="1"/>
+    <AuxValue name="FormSettings_autoSetComponentName" 
type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" 
value="true"/>
+    <AuxValue name="FormSettings_generateMnemonicsCode" 
type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" 
value="true"/>
+    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" 
value="1"/>
+    <AuxValue name="FormSettings_listenerGenerationStyle" 
type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" 
value="false"/>
+    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" 
value="2"/>
+  </AuxValues>
+
+  <Layout>
+    <DimensionLayout dim="0">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Group type="102" alignment="0" attributes="0">
+              <EmptySpace min="-2" max="-2" attributes="0"/>
+              <Component id="findLabel" min="-2" max="-2" attributes="0"/>
+              <EmptySpace min="-2" max="-2" attributes="0"/>
+              <Component id="findCombo" pref="105" max="32767" 
attributes="0"/>
+              <EmptySpace min="-2" max="-2" attributes="0"/>
+              <Component id="machCaseChoice" min="-2" max="-2" 
attributes="0"/>
+              <EmptySpace min="-2" max="-2" attributes="0"/>
+              <Component id="wholeWordsChoice" min="-2" max="-2" 
attributes="0"/>
+              <EmptySpace min="-2" max="-2" attributes="0"/>
+              <Component id="regularExpressionChoice" min="-2" max="-2" 
attributes="0"/>
+              <EmptySpace min="-2" max="-2" attributes="0"/>
+              <Component id="highlightResultsChoice" min="-2" max="-2" 
attributes="0"/>
+              <EmptySpace min="-2" pref="41" max="-2" attributes="0"/>
+              <Component id="closeButton" min="-2" max="-2" attributes="0"/>
+          </Group>
+      </Group>
+    </DimensionLayout>
+    <DimensionLayout dim="1">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Group type="103" groupAlignment="3" attributes="0">
+              <Component id="findLabel" alignment="3" min="-2" max="-2" 
attributes="0"/>
+              <Component id="findCombo" alignment="3" min="-2" max="-2" 
attributes="0"/>
+              <Component id="machCaseChoice" alignment="3" min="-2" max="-2" 
attributes="0"/>
+              <Component id="wholeWordsChoice" alignment="3" min="-2" 
max="-2" attributes="0"/>
+              <Component id="regularExpressionChoice" alignment="3" min="-2" 
max="-2" attributes="0"/>
+              <Component id="highlightResultsChoice" alignment="3" min="-2" 
max="-2" attributes="0"/>
+          </Group>
+          <Component id="closeButton" alignment="0" min="-2" max="-2" 
attributes="0"/>
+      </Group>
+    </DimensionLayout>
+  </Layout>
+  <SubComponents>
+    <Component class="javax.swing.JLabel" name="findLabel">
+      <Properties>
+        <Property name="text" type="java.lang.String" 
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString 
bundle="org/netbeans/modules/bugtracking/ui/search/Bundle.properties" 
key="FindInQueryBar.findLabel.text" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;)"/>
+        </Property>
+      </Properties>
+    </Component>
+    <Component class="javax.swing.JComboBox" name="findCombo">
+      <Properties>
+        <Property name="editable" type="boolean" value="true"/>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" handler="findComboActionPerformed"/>
+      </Events>
+    </Component>
+    <Component class="javax.swing.JCheckBox" name="machCaseChoice">
+      <Properties>
+        <Property name="text" type="java.lang.String" 
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString 
bundle="org/netbeans/modules/bugtracking/ui/search/Bundle.properties" 
key="FindInQueryBar.machCaseChoice.text" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;)"/>
+        </Property>
+        <Property name="focusable" type="boolean" value="false"/>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" 
handler="machCaseChoiceActionPerformed"/>
+      </Events>
+    </Component>
+    <Component class="javax.swing.JButton" name="closeButton">
+      <Properties>
+        <Property name="icon" type="javax.swing.Icon" 
editor="org.netbeans.modules.form.editors2.IconEditor">
+          <Image iconType="3" 
name="/org/netbeans/modules/bugtracking/ui/resources/find_close.png"/>
+        </Property>
+        <Property name="borderPainted" type="boolean" value="false"/>
+        <Property name="contentAreaFilled" type="boolean" value="false"/>
+        <Property name="focusable" type="boolean" value="false"/>
+        <Property name="margin" type="java.awt.Insets" 
editor="org.netbeans.beaninfo.editors.InsetsEditor">
+          <Insets value="[2, 1, 0, 1]"/>
+        </Property>
+      </Properties>
+      <Events>
+        <EventHandler event="mouseExited" 
listener="java.awt.event.MouseListener" 
parameters="java.awt.event.MouseEvent" handler="closeButtonMouseExited"/>
+        <EventHandler event="mouseEntered" 
listener="java.awt.event.MouseListener" 
parameters="java.awt.event.MouseEvent" handler="closeButtonMouseEntered"/>
+        <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" handler="closeButtonActionPerformed"/>
+      </Events>
+    </Component>
+    <Component class="javax.swing.JCheckBox" name="wholeWordsChoice">
+      <Properties>
+        <Property name="text" type="java.lang.String" 
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString 
bundle="org/netbeans/modules/bugtracking/ui/search/Bundle.properties" 
key="FindInQueryBar.wholeWordsChoice.text" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;)"/>
+        </Property>
+        <Property name="focusable" type="boolean" value="false"/>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" 
handler="wholeWordsChoiceActionPerformed"/>
+      </Events>
+    </Component>
+    <Component class="javax.swing.JCheckBox" name="regularExpressionChoice">
+      <Properties>
+        <Property name="text" type="java.lang.String" 
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString 
bundle="org/netbeans/modules/bugtracking/ui/search/Bundle.properties" 
key="FindInQueryBar.regularExpressionChoice.text" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;)"/>
+        </Property>
+        <Property name="focusable" type="boolean" value="false"/>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" 
handler="regularExpressionChoiceActionPerformed"/>
+      </Events>
+    </Component>
+    <Component class="javax.swing.JCheckBox" name="highlightResultsChoice">
+      <Properties>
+        <Property name="text" type="java.lang.String" 
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString 
bundle="org/netbeans/modules/bugtracking/ui/search/Bundle.properties" 
key="FindInQueryBar.highlightResultsChoice.text" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;)"/>
+        </Property>
+        <Property name="focusable" type="boolean" value="false"/>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" 
handler="highlightResultsChoiceActionPerformed"/>
+      </Events>
+    </Component>
+  </SubComponents>
+</Form>
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/FindInQueryBar.java
 
b/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/FindInQueryBar.java
new file mode 100644
--- /dev/null
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/FindInQueryBar.java
@@ -0,0 +1,320 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2009 Sun Microsystems, Inc.
+ */
+package org.netbeans.modules.bugtracking.issuetable;
+
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+import javax.swing.AbstractAction;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.InputMap;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.KeyStroke;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import javax.swing.text.JTextComponent;
+
+/**
+ *
+ * @author Tomas Stupka
+ */
+class FindInQueryBar extends javax.swing.JPanel {
+    private static final int MAX_SEARCH_MODEL_SIZE = 5;
+    private FindInQuerySupport support;
+    private boolean initialized;
+    private DefaultComboBoxModel lastSearchModel;
+
+    FindInQueryBar(FindInQuerySupport support) {
+        this.support = support;
+        initComponents();
+        lastSearchModel = new DefaultComboBoxModel();
+        findCombo.setModel(lastSearchModel);
+        findCombo.setSelectedItem(""); // NOI18N
+        initialized = true;
+        addComboEditorListener();
+        InputMap inputMap = 
getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        String closeKey = "close"; // NOI18N
+        inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), 
closeKey);
+        getActionMap().put(closeKey, new AbstractAction() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                FindInQueryBar.this.support.cancel();
+            }
+        });
+    }
+
+    private void addComboEditorListener() {
+        Component editor = findCombo.getEditor().getEditorComponent();
+        if (editor instanceof JTextComponent) {
+            JTextComponent tcomp = (JTextComponent)editor;
+            tcomp.getDocument().addDocumentListener(new DocumentListener() {
+                @Override
+                public void insertUpdate(DocumentEvent e) {
+                    changedUpdate(e);
+                }
+                @Override
+                public void removeUpdate(DocumentEvent e) {
+                    changedUpdate(e);
+                }
+                @Override
+                public void changedUpdate(DocumentEvent e) {
+                    support.updatePattern();
+                }
+            });
+        }
+    }
+
+    String getText() {
+        return findCombo.getEditor().getItem().toString();
+    }
+
+    boolean getMatchCase() {
+        return machCaseChoice.isSelected();
+    }
+
+    boolean getWholeWords() {
+        return wholeWordsChoice.isSelected();
+    }
+
+    boolean getRegularExpression() {
+        return regularExpressionChoice.isSelected();
+    }
+
+    boolean getHighlightResults() {
+        return highlightResultsChoice.isSelected();
+    }
+
+    @Override
+    public boolean requestFocusInWindow() {
+        return findCombo.requestFocusInWindow();
+    }
+
+    /** This method is called from within the constructor to
+     * initialize the form.
+     * WARNING: Do NOT modify this code. The content of this method is
+     * always regenerated by the Form Editor.
+     */
+    @SuppressWarnings("unchecked")
+    // <editor-fold defaultstate="collapsed" desc="Generated 
Code">//GEN-BEGIN:initComponents
+    private void initComponents() {
+
+        findLabel = new javax.swing.JLabel();
+        findCombo = new javax.swing.JComboBox();
+        machCaseChoice = new javax.swing.JCheckBox();
+        closeButton = new javax.swing.JButton();
+        wholeWordsChoice = new javax.swing.JCheckBox();
+        regularExpressionChoice = new javax.swing.JCheckBox();
+        highlightResultsChoice = new javax.swing.JCheckBox();
+
+        
findLabel.setText(org.openide.util.NbBundle.getMessage(FindInQueryBar.class, 
"FindInQueryBar.findLabel.text")); // NOI18N
+
+        findCombo.setEditable(true);
+        findCombo.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                findComboActionPerformed(evt);
+            }
+        });
+
+        
machCaseChoice.setText(org.openide.util.NbBundle.getMessage(FindInQueryBar.class,
 "FindInQueryBar.machCaseChoice.text")); // NOI18N
+        machCaseChoice.setFocusable(false);
+        machCaseChoice.addActionListener(new java.awt.event.ActionListener() 
{
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                machCaseChoiceActionPerformed(evt);
+            }
+        });
+
+        closeButton.setIcon(new 
javax.swing.ImageIcon(getClass().getResource("/org/netbeans/modules/bugtracking/ui/resources/find_close.png")));
 // NOI18N
+        closeButton.setBorderPainted(false);
+        closeButton.setContentAreaFilled(false);
+        closeButton.setFocusable(false);
+        closeButton.setMargin(new java.awt.Insets(2, 1, 0, 1));
+        closeButton.addMouseListener(new java.awt.event.MouseAdapter() {
+            public void mouseExited(java.awt.event.MouseEvent evt) {
+                closeButtonMouseExited(evt);
+            }
+            public void mouseEntered(java.awt.event.MouseEvent evt) {
+                closeButtonMouseEntered(evt);
+            }
+        });
+        closeButton.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                closeButtonActionPerformed(evt);
+            }
+        });
+
+        
wholeWordsChoice.setText(org.openide.util.NbBundle.getMessage(FindInQueryBar.class,
 "FindInQueryBar.wholeWordsChoice.text")); // NOI18N
+        wholeWordsChoice.setFocusable(false);
+        wholeWordsChoice.addActionListener(new 
java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                wholeWordsChoiceActionPerformed(evt);
+            }
+        });
+
+        
regularExpressionChoice.setText(org.openide.util.NbBundle.getMessage(FindInQueryBar.class,
 "FindInQueryBar.regularExpressionChoice.text")); // NOI18N
+        regularExpressionChoice.setFocusable(false);
+        regularExpressionChoice.addActionListener(new 
java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                regularExpressionChoiceActionPerformed(evt);
+            }
+        });
+
+        
highlightResultsChoice.setText(org.openide.util.NbBundle.getMessage(FindInQueryBar.class,
 "FindInQueryBar.highlightResultsChoice.text")); // NOI18N
+        highlightResultsChoice.setFocusable(false);
+        highlightResultsChoice.addActionListener(new 
java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                highlightResultsChoiceActionPerformed(evt);
+            }
+        });
+
+        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+        this.setLayout(layout);
+        layout.setHorizontalGroup(
+            
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addContainerGap()
+                .addComponent(findLabel)
+                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(findCombo, 0, 105, Short.MAX_VALUE)
+                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(machCaseChoice)
+                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(wholeWordsChoice)
+                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(regularExpressionChoice)
+                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(highlightResultsChoice)
+                .addGap(41, 41, 41)
+                .addComponent(closeButton))
+        );
+        layout.setVerticalGroup(
+            
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                .addComponent(findLabel)
+                .addComponent(findCombo, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addComponent(machCaseChoice)
+                .addComponent(wholeWordsChoice)
+                .addComponent(regularExpressionChoice)
+                .addComponent(highlightResultsChoice))
+            .addComponent(closeButton)
+        );
+    }// </editor-fold>//GEN-END:initComponents
+
+    private void closeButtonMouseEntered(java.awt.event.MouseEvent evt) 
{//GEN-FIRST:event_closeButtonMouseEntered
+        processMouseEvent(evt, true);
+    }//GEN-LAST:event_closeButtonMouseEntered
+
+    private void closeButtonMouseExited(java.awt.event.MouseEvent evt) 
{//GEN-FIRST:event_closeButtonMouseExited
+        processMouseEvent(evt, false);
+    }//GEN-LAST:event_closeButtonMouseExited
+
+    private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) 
{//GEN-FIRST:event_closeButtonActionPerformed
+        support.cancel();
+    }//GEN-LAST:event_closeButtonActionPerformed
+
+    private void findComboActionPerformed(java.awt.event.ActionEvent evt) 
{//GEN-FIRST:event_findComboActionPerformed
+        if (initialized && isVisible()) {
+            updateComboModel();
+            support.updatePattern();
+        }
+    }//GEN-LAST:event_findComboActionPerformed
+
+    private void machCaseChoiceActionPerformed(java.awt.event.ActionEvent 
evt) {//GEN-FIRST:event_machCaseChoiceActionPerformed
+        support.updatePattern();
+    }//GEN-LAST:event_machCaseChoiceActionPerformed
+
+    private void wholeWordsChoiceActionPerformed(java.awt.event.ActionEvent 
evt) {//GEN-FIRST:event_wholeWordsChoiceActionPerformed
+        support.updatePattern();
+    }//GEN-LAST:event_wholeWordsChoiceActionPerformed
+
+    private void 
regularExpressionChoiceActionPerformed(java.awt.event.ActionEvent evt) 
{//GEN-FIRST:event_regularExpressionChoiceActionPerformed
+        wholeWordsChoice.setEnabled(!regularExpressionChoice.isSelected());
+        support.updatePattern();
+    }//GEN-LAST:event_regularExpressionChoiceActionPerformed
+
+    private void 
highlightResultsChoiceActionPerformed(java.awt.event.ActionEvent evt) 
{//GEN-FIRST:event_highlightResultsChoiceActionPerformed
+        support.switchHighlight(highlightResultsChoice.isSelected());
+    }//GEN-LAST:event_highlightResultsChoiceActionPerformed
+
+    private void processMouseEvent(MouseEvent evt, boolean over) {
+        Object src = evt.getSource();
+        if (src instanceof JButton) {
+            JButton button = (JButton)src;
+            button.setContentAreaFilled(over);
+            button.setBorderPainted(over);
+        }
+    }
+
+    private void updateComboModel() {
+        String pattern = getText();
+        int idx = -1;
+        for (int i=0; i<lastSearchModel.getSize(); i++) {
+            if (pattern.equals(lastSearchModel.getElementAt(i))) {
+                idx = i;
+            }
+        }
+        if (idx != 0) {
+            if (idx != -1) {
+                lastSearchModel.removeElementAt(idx);
+            }
+            lastSearchModel.insertElementAt(pattern, 0);
+            if (lastSearchModel.getSize() > MAX_SEARCH_MODEL_SIZE) {
+                lastSearchModel.removeElementAt(MAX_SEARCH_MODEL_SIZE);
+            }
+            findCombo.setSelectedItem(pattern);
+        }
+    }
+
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JButton closeButton;
+    private javax.swing.JComboBox findCombo;
+    private javax.swing.JLabel findLabel;
+    private javax.swing.JCheckBox highlightResultsChoice;
+    private javax.swing.JCheckBox machCaseChoice;
+    private javax.swing.JCheckBox regularExpressionChoice;
+    private javax.swing.JCheckBox wholeWordsChoice;
+    // End of variables declaration//GEN-END:variables
+    
+}
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/FindInQuerySupport.java
 
b/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/FindInQuerySupport.java
new file mode 100644
--- /dev/null
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/FindInQuerySupport.java
@@ -0,0 +1,180 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2009 Sun Microsystems, Inc.
+ */
+
+package org.netbeans.modules.bugtracking.issuetable;
+
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.event.ActionEvent;
+import java.awt.event.HierarchyEvent;
+import java.awt.event.HierarchyListener;
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.ActionMap;
+import javax.swing.JComponent;
+import javax.swing.event.AncestorEvent;
+import javax.swing.event.AncestorListener;
+import org.netbeans.modules.bugtracking.QueryImpl;
+import 
org.netbeans.modules.bugtracking.issuetable.IssueTable.IssueTableProvider;
+import org.netbeans.modules.bugtracking.spi.QueryController;
+import org.openide.util.actions.CallbackSystemAction;
+import org.openide.util.actions.SystemAction;
+import org.openide.windows.TopComponent;
+
+/**
+ *
+ * @author Tomas Stupka
+ */
+class FindInQuerySupport {
+    private QueryImpl query;
+    private final FindInQueryBar bar;
+    private final AncestorListener ancestorListener;
+
+    private FindInQuerySupport() {
+        bar = new FindInQueryBar(this);
+        bar.setVisible(false);
+        
+        ancestorListener = new AncestorListener() {
+            private Action sfa;
+            @Override
+            public void ancestorAdded(AncestorEvent ae) {
+                TopComponent tc = findTC(ae.getComponent());
+                if(tc != null) {
+                    ActionMap actionMap = tc.getActionMap();
+                    CallbackSystemAction a = 
SystemAction.get(org.openide.actions.FindAction.class);
+                    sfa = actionMap.get(a.getActionMapKey());
+                    actionMap.put(a.getActionMapKey(), new FindAction());    
            
+                }
+            }
+            @Override 
+            public void ancestorRemoved(AncestorEvent ae) { 
+                TopComponent tc = findTC(ae.getComponent());
+                if(tc != null && sfa != null) {
+                    ActionMap actionMap = tc.getActionMap();
+                    CallbackSystemAction a = 
SystemAction.get(org.openide.actions.FindAction.class);
+                    actionMap.put(a.getActionMapKey(), sfa);                
+                    sfa = null;
+                }
+            }
+            @Override 
+            public void ancestorMoved(AncestorEvent ae) { }
+
+            private TopComponent findTC(Component cmp) {
+                Container parent;
+                while((parent = cmp.getParent()) != null) {
+                    cmp = parent;
+                    if(parent instanceof TopComponent) {
+                        return (TopComponent) cmp;
+                    }
+                }
+                return null;
+            }
+        };
+    }
+
+    static FindInQuerySupport create() {
+        return new FindInQuerySupport();
+    }
+
+    void setQuery(QueryImpl query) {
+        this.query = query;
+    }
+
+    FindInQueryBar getFindBar() {
+        return bar;
+    }
+
+    public AncestorListener getAncestorListener() {
+        return ancestorListener;
+    }
+
+    void reset() {
+        IssueTable issueTable = getIssueTable();
+        if(issueTable != null) {
+            issueTable.resetFilterBySummary();
+        }
+    }
+
+    protected void updatePattern() {        
+        IssueTable issueTable = getIssueTable();
+        if(issueTable != null) {
+            issueTable.setFilterBySummary(bar.getText(), 
bar.getRegularExpression(), bar.getWholeWords(), bar.getMatchCase());
+        }
+    }
+
+    protected void cancel() {
+        reset();
+        bar.setVisible(false);
+    }
+
+    protected void switchHighlight(boolean on) {
+        IssueTable issueTable = getIssueTable();
+        if(issueTable != null) {
+            issueTable.switchFilterBySummaryHighlight(on);
+        }
+    }
+
+    private class FindAction extends AbstractAction {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            if(getIssueTable() == null) {
+                return; 
+            }
+            if (bar.isVisible()) {
+                updatePattern();
+            } else {
+                bar.setVisible(true);
+                updatePattern();
+            }
+            bar.requestFocusInWindow();
+        }
+    }
+
+    private IssueTable getIssueTable() {
+        QueryController controller = query.getController();
+        if((controller instanceof IssueTableProvider)) {
+            return ((IssueTableProvider)controller).getIssueTable();
+        } 
+        return null;
+    }
+
+}
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/IssueTable.java 
b/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/IssueTable.java
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/IssueTable.java
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/IssueTable.java
@@ -44,6 +44,7 @@
 
 package org.netbeans.modules.bugtracking.issuetable;
 
+import java.awt.BorderLayout;
 import javax.swing.JButton;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ListSelectionEvent;
@@ -79,9 +80,11 @@
 import java.util.logging.Level;
 import javax.swing.Action;
 import javax.swing.BorderFactory;
+import javax.swing.GroupLayout;
 import javax.swing.ImageIcon;
 import javax.swing.JComponent;
 import javax.swing.JLabel;
+import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.JTable;
 import javax.swing.KeyStroke;
@@ -107,7 +110,7 @@
 
     private NodeTableModel  tableModel;
     private JTable          table;
-    private JScrollPane     component;
+    private JPanel     component;
 
     private TableSorter     sorter;
 
@@ -129,6 +132,7 @@
     private SummaryTextFilter textFilter;
 
     private static final String CONFIG_DELIMITER = "<=>";                    
   // NOI18N
+    private final FindInQuerySupport findInQuerySupport;
 
     public interface IssueTableProvider {
         public IssueTable getIssueTable();
@@ -165,21 +169,23 @@
 
         this.descriptors = descriptors;
         this.query.addPropertyChangeListener(this);
-
-        tableModel = new NodeTableModel();
-        sorter = new TableSorter(tableModel, this);
+        this.component = new JPanel();
         
         initFilters(includeObsoletes);
 
+        /* table */
+        tableModel = new NodeTableModel();
+        sorter = new TableSorter(tableModel, this);
         sorter.setColumnComparator(Node.Property.class, nodeComparator);
         table = new JTable(sorter);
         sorter.setTableHeader(table.getTableHeader());
         table.setRowHeight(table.getRowHeight() * 6 / 5);
-        component = new JScrollPane(table, 
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, 
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
-        component.getViewport().setBackground(table.getBackground());
+        
+        JScrollPane tableScrollPane = new JScrollPane(table, 
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, 
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+        tableScrollPane.getViewport().setBackground(table.getBackground());
         Color borderColor = UIManager.getColor("scrollpane_border"); // 
NOI18N
         if (borderColor == null) borderColor = 
UIManager.getColor("controlShadow"); // NOI18N
-        component.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, 
borderColor));
+        tableScrollPane.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 
0, borderColor));
 
         ImageIcon ic = new 
ImageIcon(ImageUtilities.loadImage("org/netbeans/modules/bugtracking/ui/resources/columns_16.png",
 true)); // NOI18N
         colsButton = new javax.swing.JButton(ic);
@@ -195,10 +201,18 @@
                 }
             }
         );
-        component.setCorner(JScrollPane.UPPER_RIGHT_CORNER, colsButton);
+        tableScrollPane.setCorner(JScrollPane.UPPER_RIGHT_CORNER, 
colsButton);
+
+        /* find bar */
+        findInQuerySupport = FindInQuerySupport.create();
+        FindInQueryBar findBar = findInQuerySupport.getFindBar();
+        findInQuerySupport.setQuery(query);
+        
+        initComponents(tableScrollPane, findBar);       
 
         table.addMouseListener(this);
         table.addKeyListener(this);
+        table.addAncestorListener(findInQuerySupport.getAncestorListener());
         table.setDefaultRenderer(Node.Property.class, new 
QueryTableCellRenderer(query.getQuery(), this));
         queryTableHeaderRenderer = new 
QueryTableHeaderRenderer(table.getTableHeader().getDefaultRenderer(), this, 
query);
         table.getTableHeader().setDefaultRenderer(queryTableHeaderRenderer);
@@ -239,6 +253,23 @@
                                                 
.create(storeColumnsWidthHandler);
     }
 
+    private void initComponents(JScrollPane tablePane, FindInQueryBar 
findBar) {
+        GroupLayout layout = new GroupLayout(component);
+        component.setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addComponent(findBar, GroupLayout.DEFAULT_SIZE, 
GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+            .addComponent(tablePane, GroupLayout.DEFAULT_SIZE, 549, 
Short.MAX_VALUE)
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(GroupLayout.Alignment.TRAILING, 
layout.createSequentialGroup()
+                .addComponent(tablePane, GroupLayout.DEFAULT_SIZE, 379, 
Short.MAX_VALUE)
+                .addGap(0, 0, 0)
+                .addComponent(findBar, GroupLayout.PREFERRED_SIZE, 
GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+        );
+    }

     /**
      * Returns the issue table filters
      * @return
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/Bundle.properties 
b/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/Bundle.properties
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/Bundle.properties
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/Bundle.properties
@@ -56,11 +56,3 @@
 CTL_PreparingQuery=Preparing query...
 
QueryTopComponent.repositoryComboBox.AccessibleContext.accessibleDescription=N/A
 QueryTopComponent.newButton.AccessibleContext.accessibleDescription=N/A
-
-FindInQueryBar.findLabel.text=Find in issue summary:
-FindInQueryBar.machCaseChoice.text=Match Case
-FindInQueryBar.wholeWordsChoice.text=Whole Words
-FindInQueryBar.highlightResultsChoice.text=Highlight Results
-FindInQueryBar.regularExpressionChoice.text=Regular Expression
-
-FindInQueryBar.invalidExpression=The syntax of the regular expression is 
invalid.
\ No newline at end of file
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/FindInQueryBar.form
 
b/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/FindInQueryBar.form
deleted file mode 100644
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/FindInQueryBar.form
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version="1.1" encoding="UTF-8" ?>
-
-<Form version="1.5" maxVersion="1.7" 
type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
-  <AuxValues>
-    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" 
value="1"/>
-    <AuxValue name="FormSettings_autoSetComponentName" 
type="java.lang.Boolean" value="false"/>
-    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" 
value="true"/>
-    <AuxValue name="FormSettings_generateMnemonicsCode" 
type="java.lang.Boolean" value="false"/>
-    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" 
value="true"/>
-    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" 
value="1"/>
-    <AuxValue name="FormSettings_listenerGenerationStyle" 
type="java.lang.Integer" value="0"/>
-    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" 
value="false"/>
-    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" 
value="2"/>
-  </AuxValues>
-
-  <Layout>
-    <DimensionLayout dim="0">
-      <Group type="103" groupAlignment="0" attributes="0">
-          <Group type="102" alignment="0" attributes="0">
-              <EmptySpace min="-2" max="-2" attributes="0"/>
-              <Component id="findLabel" min="-2" max="-2" attributes="0"/>
-              <EmptySpace min="-2" max="-2" attributes="0"/>
-              <Component id="findCombo" pref="105" max="32767" 
attributes="0"/>
-              <EmptySpace min="-2" max="-2" attributes="0"/>
-              <Component id="machCaseChoice" min="-2" max="-2" 
attributes="0"/>
-              <EmptySpace min="-2" max="-2" attributes="0"/>
-              <Component id="wholeWordsChoice" min="-2" max="-2" 
attributes="0"/>
-              <EmptySpace min="-2" max="-2" attributes="0"/>
-              <Component id="regularExpressionChoice" min="-2" max="-2" 
attributes="0"/>
-              <EmptySpace min="-2" max="-2" attributes="0"/>
-              <Component id="highlightResultsChoice" min="-2" max="-2" 
attributes="0"/>
-              <EmptySpace min="-2" pref="41" max="-2" attributes="0"/>
-              <Component id="closeButton" min="-2" max="-2" attributes="0"/>
-          </Group>
-      </Group>
-    </DimensionLayout>
-    <DimensionLayout dim="1">
-      <Group type="103" groupAlignment="0" attributes="0">
-          <Group type="103" groupAlignment="3" attributes="0">
-              <Component id="findLabel" alignment="3" min="-2" max="-2" 
attributes="0"/>
-              <Component id="findCombo" alignment="3" min="-2" max="-2" 
attributes="0"/>
-              <Component id="machCaseChoice" alignment="3" min="-2" max="-2" 
attributes="0"/>
-              <Component id="wholeWordsChoice" alignment="3" min="-2" 
max="-2" attributes="0"/>
-              <Component id="regularExpressionChoice" alignment="3" min="-2" 
max="-2" attributes="0"/>
-              <Component id="highlightResultsChoice" alignment="3" min="-2" 
max="-2" attributes="0"/>
-          </Group>
-          <Component id="closeButton" alignment="0" min="-2" max="-2" 
attributes="0"/>
-      </Group>
-    </DimensionLayout>
-  </Layout>
-  <SubComponents>
-    <Component class="javax.swing.JLabel" name="findLabel">
-      <Properties>
-        <Property name="text" type="java.lang.String" 
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
-          <ResourceString 
bundle="org/netbeans/modules/bugtracking/ui/search/Bundle.properties" 
key="FindInQueryBar.findLabel.text" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;)"/>
-        </Property>
-      </Properties>
-    </Component>
-    <Component class="javax.swing.JComboBox" name="findCombo">
-      <Properties>
-        <Property name="editable" type="boolean" value="true"/>
-      </Properties>
-      <Events>
-        <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" handler="findComboActionPerformed"/>
-      </Events>
-    </Component>
-    <Component class="javax.swing.JCheckBox" name="machCaseChoice">
-      <Properties>
-        <Property name="text" type="java.lang.String" 
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
-          <ResourceString 
bundle="org/netbeans/modules/bugtracking/ui/search/Bundle.properties" 
key="FindInQueryBar.machCaseChoice.text" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;)"/>
-        </Property>
-        <Property name="focusable" type="boolean" value="false"/>
-      </Properties>
-      <Events>
-        <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" 
handler="machCaseChoiceActionPerformed"/>
-      </Events>
-    </Component>
-    <Component class="javax.swing.JButton" name="closeButton">
-      <Properties>
-        <Property name="icon" type="javax.swing.Icon" 
editor="org.netbeans.modules.form.editors2.IconEditor">
-          <Image iconType="3" 
name="/org/netbeans/modules/bugtracking/ui/resources/find_close.png"/>
-        </Property>
-        <Property name="borderPainted" type="boolean" value="false"/>
-        <Property name="contentAreaFilled" type="boolean" value="false"/>
-        <Property name="focusable" type="boolean" value="false"/>
-        <Property name="margin" type="java.awt.Insets" 
editor="org.netbeans.beaninfo.editors.InsetsEditor">
-          <Insets value="[2, 1, 0, 1]"/>
-        </Property>
-      </Properties>
-      <Events>
-        <EventHandler event="mouseExited" 
listener="java.awt.event.MouseListener" 
parameters="java.awt.event.MouseEvent" handler="closeButtonMouseExited"/>
-        <EventHandler event="mouseEntered" 
listener="java.awt.event.MouseListener" 
parameters="java.awt.event.MouseEvent" handler="closeButtonMouseEntered"/>
-        <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" handler="closeButtonActionPerformed"/>
-      </Events>
-    </Component>
-    <Component class="javax.swing.JCheckBox" name="wholeWordsChoice">
-      <Properties>
-        <Property name="text" type="java.lang.String" 
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
-          <ResourceString 
bundle="org/netbeans/modules/bugtracking/ui/search/Bundle.properties" 
key="FindInQueryBar.wholeWordsChoice.text" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;)"/>
-        </Property>
-        <Property name="focusable" type="boolean" value="false"/>
-      </Properties>
-      <Events>
-        <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" 
handler="wholeWordsChoiceActionPerformed"/>
-      </Events>
-    </Component>
-    <Component class="javax.swing.JCheckBox" name="regularExpressionChoice">
-      <Properties>
-        <Property name="text" type="java.lang.String" 
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
-          <ResourceString 
bundle="org/netbeans/modules/bugtracking/ui/search/Bundle.properties" 
key="FindInQueryBar.regularExpressionChoice.text" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;)"/>
-        </Property>
-        <Property name="focusable" type="boolean" value="false"/>
-      </Properties>
-      <Events>
-        <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" 
handler="regularExpressionChoiceActionPerformed"/>
-      </Events>
-    </Component>
-    <Component class="javax.swing.JCheckBox" name="highlightResultsChoice">
-      <Properties>
-        <Property name="text" type="java.lang.String" 
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
-          <ResourceString 
bundle="org/netbeans/modules/bugtracking/ui/search/Bundle.properties" 
key="FindInQueryBar.highlightResultsChoice.text" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;)"/>
-        </Property>
-        <Property name="focusable" type="boolean" value="false"/>
-      </Properties>
-      <Events>
-        <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" 
handler="highlightResultsChoiceActionPerformed"/>
-      </Events>
-    </Component>
-  </SubComponents>
-</Form>
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/FindInQueryBar.java
 
b/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/FindInQueryBar.java
deleted file mode 100644
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/FindInQueryBar.java
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
- *
- * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
- * Other names may be trademarks of their respective owners.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common
- * Development and Distribution License("CDDL") (collectively, the
- * "License"). You may not use this file except in compliance with the
- * License. You can obtain a copy of the License at
- * http://www.netbeans.org/cddl-gplv2.html
- * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
- * specific language governing permissions and limitations under the
- * License.  When distributing the software, include this License Header
- * Notice in each file and include the License file at
- * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the GPL Version 2 section of the License file that
- * accompanied this code. If applicable, add the following below the
- * License Header, with the fields enclosed by brackets [] replaced by
- * your own identifying information:
- * "Portions Copyrighted [year] [name of copyright owner]"
- *
- * If you wish your version of this file to be governed by only the CDDL
- * or only the GPL Version 2, indicate your decision by adding
- * "[Contributor] elects to include this software in this distribution
- * under the [CDDL or GPL Version 2] license." If you do not indicate a
- * single choice of license, a recipient has the option to distribute
- * your version of this file under either the CDDL, the GPL Version 2 or
- * to extend the choice of license to its licensees as provided above.
- * However, if you add GPL Version 2 code and therefore, elected the GPL
- * Version 2 license, then the option applies only if the new code is
- * made subject to such option by the copyright holder.
- *
- * Contributor(s):
- *
- * Portions Copyrighted 2009 Sun Microsystems, Inc.
- */
-package org.netbeans.modules.bugtracking.ui.query;
-
-import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-import javax.swing.AbstractAction;
-import javax.swing.DefaultComboBoxModel;
-import javax.swing.InputMap;
-import javax.swing.JButton;
-import javax.swing.JComponent;
-import javax.swing.KeyStroke;
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-import javax.swing.text.JTextComponent;
-
-/**
- *
- * @author Tomas Stupka
- */
-class FindInQueryBar extends javax.swing.JPanel {
-    private static final int MAX_SEARCH_MODEL_SIZE = 5;
-    private FindInQuerySupport support;
-    private boolean initialized;
-    private DefaultComboBoxModel lastSearchModel;
-
-    FindInQueryBar(FindInQuerySupport support) {
-        this.support = support;
-        initComponents();
-        lastSearchModel = new DefaultComboBoxModel();
-        findCombo.setModel(lastSearchModel);
-        findCombo.setSelectedItem(""); // NOI18N
-        initialized = true;
-        addComboEditorListener();
-        InputMap inputMap = 
getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
-        String closeKey = "close"; // NOI18N
-        inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), 
closeKey);
-        getActionMap().put(closeKey, new AbstractAction() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                FindInQueryBar.this.support.cancel();
-            }
-        });
-    }
-
-    private void addComboEditorListener() {
-        Component editor = findCombo.getEditor().getEditorComponent();
-        if (editor instanceof JTextComponent) {
-            JTextComponent tcomp = (JTextComponent)editor;
-            tcomp.getDocument().addDocumentListener(new DocumentListener() {
-                @Override
-                public void insertUpdate(DocumentEvent e) {
-                    changedUpdate(e);
-                }
-                @Override
-                public void removeUpdate(DocumentEvent e) {
-                    changedUpdate(e);
-                }
-                @Override
-                public void changedUpdate(DocumentEvent e) {
-                    support.updatePattern();
-                }
-            });
-        }
-    }
-
-    String getText() {
-        return findCombo.getEditor().getItem().toString();
-    }
-
-    boolean getMatchCase() {
-        return machCaseChoice.isSelected();
-    }
-
-    boolean getWholeWords() {
-        return wholeWordsChoice.isSelected();
-    }
-
-    boolean getRegularExpression() {
-        return regularExpressionChoice.isSelected();
-    }
-
-    boolean getHighlightResults() {
-        return highlightResultsChoice.isSelected();
-    }
-
-    @Override
-    public boolean requestFocusInWindow() {
-        return findCombo.requestFocusInWindow();
-    }
-
-    /** This method is called from within the constructor to
-     * initialize the form.
-     * WARNING: Do NOT modify this code. The content of this method is
-     * always regenerated by the Form Editor.
-     */
-    @SuppressWarnings("unchecked")
-    // <editor-fold defaultstate="collapsed" desc="Generated 
Code">//GEN-BEGIN:initComponents
-    private void initComponents() {
-
-        findLabel = new javax.swing.JLabel();
-        findCombo = new javax.swing.JComboBox();
-        machCaseChoice = new javax.swing.JCheckBox();
-        closeButton = new javax.swing.JButton();
-        wholeWordsChoice = new javax.swing.JCheckBox();
-        regularExpressionChoice = new javax.swing.JCheckBox();
-        highlightResultsChoice = new javax.swing.JCheckBox();
-
-        
findLabel.setText(org.openide.util.NbBundle.getMessage(FindInQueryBar.class, 
"FindInQueryBar.findLabel.text")); // NOI18N
-
-        findCombo.setEditable(true);
-        findCombo.addActionListener(new java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                findComboActionPerformed(evt);
-            }
-        });
-
-        
machCaseChoice.setText(org.openide.util.NbBundle.getMessage(FindInQueryBar.class,
 "FindInQueryBar.machCaseChoice.text")); // NOI18N
-        machCaseChoice.setFocusable(false);
-        machCaseChoice.addActionListener(new java.awt.event.ActionListener() 
{
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                machCaseChoiceActionPerformed(evt);
-            }
-        });
-
-        closeButton.setIcon(new 
javax.swing.ImageIcon(getClass().getResource("/org/netbeans/modules/bugtracking/ui/resources/find_close.png")));
 // NOI18N
-        closeButton.setBorderPainted(false);
-        closeButton.setContentAreaFilled(false);
-        closeButton.setFocusable(false);
-        closeButton.setMargin(new java.awt.Insets(2, 1, 0, 1));
-        closeButton.addMouseListener(new java.awt.event.MouseAdapter() {
-            public void mouseExited(java.awt.event.MouseEvent evt) {
-                closeButtonMouseExited(evt);
-            }
-            public void mouseEntered(java.awt.event.MouseEvent evt) {
-                closeButtonMouseEntered(evt);
-            }
-        });
-        closeButton.addActionListener(new java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                closeButtonActionPerformed(evt);
-            }
-        });
-
-        
wholeWordsChoice.setText(org.openide.util.NbBundle.getMessage(FindInQueryBar.class,
 "FindInQueryBar.wholeWordsChoice.text")); // NOI18N
-        wholeWordsChoice.setFocusable(false);
-        wholeWordsChoice.addActionListener(new 
java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                wholeWordsChoiceActionPerformed(evt);
-            }
-        });
-
-        
regularExpressionChoice.setText(org.openide.util.NbBundle.getMessage(FindInQueryBar.class,
 "FindInQueryBar.regularExpressionChoice.text")); // NOI18N
-        regularExpressionChoice.setFocusable(false);
-        regularExpressionChoice.addActionListener(new 
java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                regularExpressionChoiceActionPerformed(evt);
-            }
-        });
-
-        
highlightResultsChoice.setText(org.openide.util.NbBundle.getMessage(FindInQueryBar.class,
 "FindInQueryBar.highlightResultsChoice.text")); // NOI18N
-        highlightResultsChoice.setFocusable(false);
-        highlightResultsChoice.addActionListener(new 
java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                highlightResultsChoiceActionPerformed(evt);
-            }
-        });
-
-        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
-        this.setLayout(layout);
-        layout.setHorizontalGroup(
-            
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGroup(layout.createSequentialGroup()
-                .addContainerGap()
-                .addComponent(findLabel)
-                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(findCombo, 0, 105, Short.MAX_VALUE)
-                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(machCaseChoice)
-                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(wholeWordsChoice)
-                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(regularExpressionChoice)
-                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(highlightResultsChoice)
-                .addGap(41, 41, 41)
-                .addComponent(closeButton))
-        );
-        layout.setVerticalGroup(
-            
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
-                .addComponent(findLabel)
-                .addComponent(findCombo, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE)
-                .addComponent(machCaseChoice)
-                .addComponent(wholeWordsChoice)
-                .addComponent(regularExpressionChoice)
-                .addComponent(highlightResultsChoice))
-            .addComponent(closeButton)
-        );
-    }// </editor-fold>//GEN-END:initComponents
-
-    private void closeButtonMouseEntered(java.awt.event.MouseEvent evt) 
{//GEN-FIRST:event_closeButtonMouseEntered
-        processMouseEvent(evt, true);
-    }//GEN-LAST:event_closeButtonMouseEntered
-
-    private void closeButtonMouseExited(java.awt.event.MouseEvent evt) 
{//GEN-FIRST:event_closeButtonMouseExited
-        processMouseEvent(evt, false);
-    }//GEN-LAST:event_closeButtonMouseExited
-
-    private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) 
{//GEN-FIRST:event_closeButtonActionPerformed
-        support.cancel();
-    }//GEN-LAST:event_closeButtonActionPerformed
-
-    private void findComboActionPerformed(java.awt.event.ActionEvent evt) 
{//GEN-FIRST:event_findComboActionPerformed
-        if (initialized && isVisible()) {
-            updateComboModel();
-            support.updatePattern();
-        }
-    }//GEN-LAST:event_findComboActionPerformed
-
-    private void machCaseChoiceActionPerformed(java.awt.event.ActionEvent 
evt) {//GEN-FIRST:event_machCaseChoiceActionPerformed
-        support.updatePattern();
-    }//GEN-LAST:event_machCaseChoiceActionPerformed
-
-    private void wholeWordsChoiceActionPerformed(java.awt.event.ActionEvent 
evt) {//GEN-FIRST:event_wholeWordsChoiceActionPerformed
-        support.updatePattern();
-    }//GEN-LAST:event_wholeWordsChoiceActionPerformed
-
-    private void 
regularExpressionChoiceActionPerformed(java.awt.event.ActionEvent evt) 
{//GEN-FIRST:event_regularExpressionChoiceActionPerformed
-        wholeWordsChoice.setEnabled(!regularExpressionChoice.isSelected());
-        support.updatePattern();
-    }//GEN-LAST:event_regularExpressionChoiceActionPerformed
-
-    private void 
highlightResultsChoiceActionPerformed(java.awt.event.ActionEvent evt) 
{//GEN-FIRST:event_highlightResultsChoiceActionPerformed
-        support.switchHighlight(highlightResultsChoice.isSelected());
-    }//GEN-LAST:event_highlightResultsChoiceActionPerformed
-
-    private void processMouseEvent(MouseEvent evt, boolean over) {
-        Object src = evt.getSource();
-        if (src instanceof JButton) {
-            JButton button = (JButton)src;
-            button.setContentAreaFilled(over);
-            button.setBorderPainted(over);
-        }
-    }
-
-    private void updateComboModel() {
-        String pattern = getText();
-        int idx = -1;
-        for (int i=0; i<lastSearchModel.getSize(); i++) {
-            if (pattern.equals(lastSearchModel.getElementAt(i))) {
-                idx = i;
-            }
-        }
-        if (idx != 0) {
-            if (idx != -1) {
-                lastSearchModel.removeElementAt(idx);
-            }
-            lastSearchModel.insertElementAt(pattern, 0);
-            if (lastSearchModel.getSize() > MAX_SEARCH_MODEL_SIZE) {
-                lastSearchModel.removeElementAt(MAX_SEARCH_MODEL_SIZE);
-            }
-            findCombo.setSelectedItem(pattern);
-        }
-    }
-
-    // Variables declaration - do not modify//GEN-BEGIN:variables
-    private javax.swing.JButton closeButton;
-    private javax.swing.JComboBox findCombo;
-    private javax.swing.JLabel findLabel;
-    private javax.swing.JCheckBox highlightResultsChoice;
-    private javax.swing.JCheckBox machCaseChoice;
-    private javax.swing.JCheckBox regularExpressionChoice;
-    private javax.swing.JCheckBox wholeWordsChoice;
-    // End of variables declaration//GEN-END:variables
-    
-}
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/FindInQuerySupport.java
 
b/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/FindInQuerySupport.java
deleted file mode 100644
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/FindInQuerySupport.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
- *
- * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
- * Other names may be trademarks of their respective owners.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common
- * Development and Distribution License("CDDL") (collectively, the
- * "License"). You may not use this file except in compliance with the
- * License. You can obtain a copy of the License at
- * http://www.netbeans.org/cddl-gplv2.html
- * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
- * specific language governing permissions and limitations under the
- * License.  When distributing the software, include this License Header
- * Notice in each file and include the License file at
- * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the GPL Version 2 section of the License file that
- * accompanied this code. If applicable, add the following below the
- * License Header, with the fields enclosed by brackets [] replaced by
- * your own identifying information:
- * "Portions Copyrighted [year] [name of copyright owner]"
- *
- * If you wish your version of this file to be governed by only the CDDL
- * or only the GPL Version 2, indicate your decision by adding
- * "[Contributor] elects to include this software in this distribution
- * under the [CDDL or GPL Version 2] license." If you do not indicate a
- * single choice of license, a recipient has the option to distribute
- * your version of this file under either the CDDL, the GPL Version 2 or
- * to extend the choice of license to its licensees as provided above.
- * However, if you add GPL Version 2 code and therefore, elected the GPL
- * Version 2 license, then the option applies only if the new code is
- * made subject to such option by the copyright holder.
- *
- * Contributor(s):
- *
- * Portions Copyrighted 2009 Sun Microsystems, Inc.
- */
-
-package org.netbeans.modules.bugtracking.ui.query;
-
-import java.awt.event.ActionEvent;
-import javax.swing.AbstractAction;
-import javax.swing.ActionMap;
-import javax.swing.JComponent;
-import org.netbeans.modules.bugtracking.issuetable.IssueTable;
-import org.netbeans.modules.bugtracking.QueryImpl;
-import 
org.netbeans.modules.bugtracking.issuetable.IssueTable.IssueTableProvider;
-import org.netbeans.modules.bugtracking.spi.QueryController;
-import org.openide.util.actions.CallbackSystemAction;
-import org.openide.util.actions.SystemAction;
-import org.openide.windows.TopComponent;
-
-/**
- *
- * @author Tomas Stupka
- */
-class FindInQuerySupport {
-    private IssueTableProvider tableProvider;
-    private QueryImpl query;
-    private final FindInQueryBar bar;
-
-    private FindInQuerySupport(TopComponent tc) {
-        bar = new FindInQueryBar(this);
-        
-        ActionMap actionMap = tc.getActionMap();
-        CallbackSystemAction a = 
SystemAction.get(org.openide.actions.FindAction.class);
-        actionMap.put(a.getActionMapKey(), new FindAction());                
-    }
-
-    static FindInQuerySupport create(TopComponent tc) {
-        return new FindInQuerySupport(tc);
-    }
-
-    void setQuery(QueryImpl query) {
-        this.query = query;
-    }
-
-    FindInQueryBar getFindBar() {
-        return bar;
-    }
-
-    void reset() {
-        IssueTable issueTable = getIssueTable();
-        if(issueTable != null) {
-            issueTable.resetFilterBySummary();
-        }
-    }
-
-    protected void updatePattern() {        
-        IssueTable issueTable = getIssueTable();
-        if(issueTable != null) {
-            issueTable.setFilterBySummary(bar.getText(), 
bar.getRegularExpression(), bar.getWholeWords(), bar.getMatchCase());
-        }
-    }
-
-    protected void cancel() {
-        reset();
-        bar.setVisible(false);
-    }
-
-    protected void switchHighlight(boolean on) {
-        IssueTable issueTable = getIssueTable();
-        if(issueTable != null) {
-            issueTable.switchFilterBySummaryHighlight(on);
-        }
-    }
-
-    private class FindAction extends AbstractAction {
-        @Override
-        public void actionPerformed(ActionEvent e) {
-            if(getIssueTable() == null) {
-                return; 
-            }
-            if (bar.isVisible()) {
-                updatePattern();
-            } else {
-                bar.setVisible(true);
-                updatePattern();
-            }
-            bar.requestFocusInWindow();
-        }
-    }
-
-    private IssueTable getIssueTable() {
-        QueryController controller = query.getController();
-        if((controller instanceof IssueTableProvider)) {
-            return ((IssueTableProvider)controller).getIssueTable();
-        } 
-        return null;
-    }
-
-}
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponent.java
 
b/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponent.java
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponent.java
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponent.java
@@ -67,6 +67,8 @@
 import java.util.Set;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+import javax.swing.AbstractAction;
+import javax.swing.ActionMap;
 import javax.swing.BorderFactory;
 import javax.swing.Box;
 import javax.swing.BoxLayout;
@@ -103,6 +105,8 @@
 import org.netbeans.modules.bugtracking.spi.QueryController;
 import org.netbeans.modules.bugtracking.spi.QueryProvider;
 import org.netbeans.modules.bugtracking.util.*;
+import org.openide.util.actions.CallbackSystemAction;
+import org.openide.util.actions.SystemAction;
 
 /**
  * Top component which displays something.
@@ -116,7 +120,6 @@
 
     /** Set of opened {@code QueryTopComponent}s. */
     private static Set<QueryTopComponent> openQueries = new 
HashSet<QueryTopComponent>();
-    private final FindInQuerySupport findInQuerySupport;
 
     private final RepoPanel repoPanel;
     private final JPanel jPanel2;
@@ -172,12 +175,6 @@
         setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
         add(scrollPane);
 
-         /* find bar */
-        findInQuerySupport = FindInQuerySupport.create(this);
-        FindInQueryBar findBar = findInQuerySupport.getFindBar();
-        findBar.setVisible(false);       
-        add(findBar);
-
         /* texts */
         Mnemonics.setLocalizedText(
                 title,
@@ -257,7 +254,6 @@
             QueryController c = getController(query);
             panel.setComponent(c.getComponent());
             this.query.addPropertyChangeListener(this);
-            findInQuerySupport.setQuery(query);
         } else {
             newButton.addActionListener(new ActionListener() {
                 @Override
@@ -536,8 +532,6 @@
                         return;
                     }
 
-                    findInQuerySupport.setQuery(query);
-                    
                     if(context != null && 
BugtrackingUtil.isNbRepository(repo.getUrl())) {
                         OwnerInfo ownerInfo = 
KenaiUtil.getOwnerInfo(context);
                         if(ownerInfo != null) {

[hg] main-silver: decouple FindInQuery from QueryTopComponent

Tomas Stupka 03/05/2013

Project Features

About this Project

ConnectedDeveloper was started in November 2009, is owned by tpavek, and has 65 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close