[hg] main-silver: created QueryTopComponent.form and removed all...

  • From: Tomas Stupka < >
  • To:
  • Subject: [hg] main-silver: created QueryTopComponent.form and removed all...
  • Date: Mon, 08 Apr 2013 12:45:20 -0700

changeset 2f4f72adcc60 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/2f4f72adcc60
description:
        created QueryTopComponent.form and removed all layout tweaks related 
to the saved queries list

diffstat:

 bugtracking/manifest.mf                                                      
                    |    2 +-
 
bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponent.form
                 |  141 +++
 
bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponent.java
                 |  233 +++--
 
bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponentScrollPane.java
       |   72 -
 
bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponentScrollPaneLayout.java
 |  369 ----------
 
bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponentViewport.java
         |   71 -
 
bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponentViewportLayout.java
   |  118 ---
 bugtracking/src/org/netbeans/modules/bugtracking/ui/query/RepoPanel.java     
                    |  124 ---
 
bugtracking/src/org/netbeans/modules/bugtracking/ui/query/RepoSelectorPanel.java
                 |   46 +-
 bugzilla/nbproject/project.xml                                               
                    |    2 +-
 jira/nbproject/project.xml                                                   
                    |    2 +-
 11 files changed, 293 insertions(+), 887 deletions(-)

diffs (1404 lines):

diff --git a/bugtracking/manifest.mf b/bugtracking/manifest.mf
--- a/bugtracking/manifest.mf
+++ b/bugtracking/manifest.mf
@@ -3,5 +3,5 @@
 OpenIDE-Module: org.netbeans.modules.bugtracking
 OpenIDE-Module-Layer: org/netbeans/modules/bugtracking/layer.xml
 OpenIDE-Module-Localizing-Bundle: 
org/netbeans/modules/bugtracking/Bundle.properties
-OpenIDE-Module-Specification-Version: 1.48
+OpenIDE-Module-Specification-Version: 1.49
 
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponent.form
 
b/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponent.form
new file mode 100644
--- /dev/null
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponent.form
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.5" maxVersion="1.8" 
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="true"/>
+    <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">
+          <Component id="jScrollPane1" alignment="0" max="32767" 
attributes="0"/>
+      </Group>
+    </DimensionLayout>
+    <DimensionLayout dim="1">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Component id="jScrollPane1" alignment="0" max="32767" 
attributes="0"/>
+      </Group>
+    </DimensionLayout>
+  </Layout>
+  <SubComponents>
+    <Container class="javax.swing.JScrollPane" name="jScrollPane1">
+
+      <Layout 
class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+      <SubComponents>
+        <Container class="javax.swing.JPanel" name="mainPanel">
+
+          <Layout>
+            <DimensionLayout dim="0">
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Component id="headerPanel" max="32767" attributes="0"/>
+                  <Component id="queryPanel" alignment="0" max="32767" 
attributes="0"/>
+              </Group>
+            </DimensionLayout>
+            <DimensionLayout dim="1">
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Group type="102" alignment="0" attributes="0">
+                      <Component id="headerPanel" min="-2" max="-2" 
attributes="0"/>
+                      <EmptySpace min="0" pref="0" max="-2" attributes="0"/>
+                      <Component id="queryPanel" pref="222" max="32767" 
attributes="0"/>
+                  </Group>
+              </Group>
+            </DimensionLayout>
+          </Layout>
+          <SubComponents>
+            <Container class="javax.swing.JPanel" name="headerPanel">
+
+              <Layout>
+                <DimensionLayout dim="0">
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <Group type="102" attributes="0">
+                          <Component id="title" min="-2" max="-2" 
attributes="0"/>
+                          <EmptySpace pref="12" max="32767" attributes="0"/>
+                          <Component id="leftRepoPanel" min="-2" max="-2" 
attributes="0"/>
+                          <EmptySpace max="-2" attributes="0"/>
+                      </Group>
+                      <Group type="102" alignment="0" attributes="0">
+                          <EmptySpace max="-2" attributes="0"/>
+                          <Component id="bottomPanel" min="-2" max="-2" 
attributes="0"/>
+                          <EmptySpace max="32767" attributes="0"/>
+                      </Group>
+                  </Group>
+                </DimensionLayout>
+                <DimensionLayout dim="1">
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <Group type="102" alignment="0" attributes="0">
+                          <EmptySpace max="-2" attributes="0"/>
+                          <Group type="103" groupAlignment="0" max="-2" 
attributes="0">
+                              <Component id="leftRepoPanel" max="32767" 
attributes="0"/>
+                              <Component id="title" max="32767" 
attributes="0"/>
+                          </Group>
+                          <EmptySpace max="-2" attributes="0"/>
+                          <Component id="bottomPanel" min="-2" max="-2" 
attributes="0"/>
+                          <EmptySpace min="0" pref="0" max="32767" 
attributes="0"/>
+                      </Group>
+                  </Group>
+                </DimensionLayout>
+              </Layout>
+              <SubComponents>
+                <Component class="javax.swing.JLabel" name="title">
+                  <Properties>
+                    <Property name="text" type="java.lang.String" 
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+                      <ResourceString 
bundle="org/netbeans/modules/bugtracking/ui/query/Bundle.properties" 
key="SaveWilly.title.text" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;)"/>
+                    </Property>
+                  </Properties>
+                </Component>
+                <Container class="javax.swing.JPanel" name="bottomPanel">
+                  <Properties>
+                    <Property name="opaque" type="boolean" value="false"/>
+                  </Properties>
+
+                  <Layout>
+                    <DimensionLayout dim="0">
+                      <Group type="103" groupAlignment="0" attributes="0">
+                          <EmptySpace min="0" pref="94" max="32767" 
attributes="0"/>
+                      </Group>
+                    </DimensionLayout>
+                    <DimensionLayout dim="1">
+                      <Group type="103" groupAlignment="0" attributes="0">
+                          <EmptySpace min="0" pref="26" max="32767" 
attributes="0"/>
+                      </Group>
+                    </DimensionLayout>
+                  </Layout>
+                </Container>
+                <Container class="javax.swing.JPanel" name="leftRepoPanel">
+                  <Properties>
+                    <Property name="opaque" type="boolean" value="false"/>
+                  </Properties>
+
+                  <Layout>
+                    <DimensionLayout dim="0">
+                      <Group type="103" groupAlignment="0" attributes="0">
+                          <EmptySpace min="0" pref="100" max="32767" 
attributes="0"/>
+                      </Group>
+                    </DimensionLayout>
+                    <DimensionLayout dim="1">
+                      <Group type="103" groupAlignment="0" attributes="0">
+                          <EmptySpace min="0" pref="0" max="32767" 
attributes="0"/>
+                      </Group>
+                    </DimensionLayout>
+                  </Layout>
+                </Container>
+              </SubComponents>
+            </Container>
+            <Container class="javax.swing.JPanel" name="queryPanel">
+
+              <Layout 
class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+            </Container>
+          </SubComponents>
+        </Container>
+      </SubComponents>
+    </Container>
+  </SubComponents>
+</Form>
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
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright 2009-2010 Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013 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.
@@ -37,16 +37,12 @@
  *
  * Contributor(s):
  *
- * Portions Copyrighted 2009-2010 Sun Microsystems, Inc.
+ * Portions Copyrighted 2013 Sun Microsystems, Inc.
  */
-
 package org.netbeans.modules.bugtracking.ui.query;
 
-import javax.swing.LayoutStyle;
-import java.util.Collection;
 import java.awt.Color;
 import java.awt.Component;
-import java.awt.EventQueue;
 import java.awt.Font;
 import java.awt.Point;
 import java.awt.Rectangle;
@@ -60,113 +56,81 @@
 import java.beans.PropertyChangeListener;
 import java.io.File;
 import java.io.Serializable;
-import java.util.Arrays;
-import java.util.Comparator;
+import java.util.Collection;
 import java.util.HashSet;
 import java.util.MissingResourceException;
 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;
+import javax.swing.GroupLayout;
 import javax.swing.JComboBox;
 import javax.swing.JComponent;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
+import javax.swing.LayoutStyle;
+import static javax.swing.LayoutStyle.ComponentPlacement.RELATED;
+import static javax.swing.SwingConstants.NORTH;
+import static javax.swing.SwingConstants.SOUTH;
+import static javax.swing.SwingConstants.WEST;
 import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
 import org.netbeans.api.progress.ProgressHandle;
 import org.netbeans.api.progress.ProgressHandleFactory;
+import org.netbeans.modules.bugtracking.APIAccessor;
 import org.netbeans.modules.bugtracking.BugtrackingManager;
 import org.netbeans.modules.bugtracking.QueryImpl;
+import org.netbeans.modules.bugtracking.RepositoryImpl;
+import org.netbeans.modules.bugtracking.RepositoryRegistry;
+import org.netbeans.modules.bugtracking.api.Repository;
+import org.netbeans.modules.bugtracking.kenai.spi.KenaiUtil;
+import org.netbeans.modules.bugtracking.kenai.spi.OwnerInfo;
+import org.netbeans.modules.bugtracking.spi.QueryController;
+import org.netbeans.modules.bugtracking.spi.QueryProvider;
 import org.netbeans.modules.bugtracking.util.BugtrackingUtil;
 import org.netbeans.modules.bugtracking.util.LinkButton;
-import org.netbeans.modules.bugtracking.util.PlaceholderPanel;
+import org.netbeans.modules.bugtracking.util.LogUtils;
 import org.netbeans.modules.bugtracking.util.RepositoryComboSupport;
 import org.openide.awt.Mnemonics;
 import org.openide.util.Cancellable;
 import org.openide.util.NbBundle;
 import org.openide.util.RequestProcessor;
-import org.openide.util.RequestProcessor.Task;
 import org.openide.windows.TopComponent;
 import org.openide.windows.WindowManager;
-import static javax.swing.SwingConstants.NORTH;
-import static javax.swing.SwingConstants.SOUTH;
-import static javax.swing.SwingConstants.WEST;
-import static javax.swing.LayoutStyle.ComponentPlacement.RELATED;
-import org.netbeans.modules.bugtracking.*;
-import org.netbeans.modules.bugtracking.api.Repository;
-import org.netbeans.modules.bugtracking.kenai.spi.KenaiUtil;
-import org.netbeans.modules.bugtracking.kenai.spi.OwnerInfo;
-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.
- */
 public final class QueryTopComponent extends TopComponent
                                      implements PropertyChangeListener, 
FocusListener {
 
     private static QueryTopComponent instance;
-    /** path to the icon used by the component and its open action */
-//    static final String ICON_PATH = "SET/PATH/TO/ICON/HERE";
 
     /** Set of opened {@code QueryTopComponent}s. */
-    private static Set<QueryTopComponent> openQueries = new 
HashSet<QueryTopComponent>();
+    private static final Set<QueryTopComponent> openQueries = new 
HashSet<QueryTopComponent>();
 
-    private final RepoPanel repoPanel;
-    private final JPanel jPanel2;
+    private final RepoSelectorPanel repoPanel;
     private final LinkButton newButton;
-    private final PlaceholderPanel panel;
     private final JComboBox repositoryComboBox;
-    private final JScrollPane scrollPane;
 
     private static final String PREFERRED_ID = "QueryTopComponent"; // NOI18N
     private QueryImpl query; // XXX synchronized
-    private static final Object LOCK = new Object();
 
-    private RequestProcessor rp = new RequestProcessor("Bugtracking query", 
1, true); // NOI18N
-    private Task prepareTask;
+    private final RequestProcessor rp = new RequestProcessor("Bugtracking 
query", 1, true); // NOI18N
+    private RequestProcessor.Task prepareTask;
     private RepositoryComboSupport rs;
     private File context;
 
     QueryTopComponent() {
+        initComponents();
         RepositoryRegistry.getInstance().addPropertyChangeListener(this);
         repositoryComboBox = new javax.swing.JComboBox();
         newButton = new LinkButton();
 
         /* layout */
-        JLabel title = new JLabel();
         Font titleFont = title.getFont();
         title.setFont(titleFont.deriveFont(1.7f * titleFont.getSize()));
         title.setBorder(BorderFactory.createEmptyBorder(
                 0, getLeftContainerGap(title), 0, 0));
 
-        repoPanel = new RepoPanel(repositoryComboBox, newButton);
-        panel = new PlaceholderPanel();
-        jPanel2 = new JPanel();
-        jPanel2.setLayout(new BoxLayout(jPanel2, BoxLayout.Y_AXIS));
-        jPanel2.add(createVerticalStrut(null, title));
-        jPanel2.add(title);
-        jPanel2.add(createVerticalStrut(title, repoPanel));
-        jPanel2.add(repoPanel);
-        jPanel2.add(createVerticalStrut(repoPanel, panel));
-        jPanel2.add(panel);
-
-        title    .setAlignmentX(0.0f);
-        repoPanel.setAlignmentX(0.0f);
-        panel    .setAlignmentX(0.0f);
-
-        scrollPane = new QueryTopComponentScrollPane(jPanel2);
-        setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
-        add(scrollPane);
+        repoPanel = new RepoSelectorPanel(repositoryComboBox, newButton);
+        ((GroupLayout)headerPanel.getLayout()).replace(bottomPanel, 
repoPanel);
 
         /* texts */
         Mnemonics.setLocalizedText(
@@ -185,16 +149,17 @@
         Color editorBgColor = UIManager.getDefaults()
                               .getColor("EditorPane.background");       
//NOI18N
         repoPanel.setBackground(editorBgColor);
-        panel    .setBackground(editorBgColor);
-        jPanel2  .setBackground(editorBgColor);
+        headerPanel.setBackground(editorBgColor);
+        queryPanel.setBackground(editorBgColor);
+        mainPanel.setBackground(editorBgColor);
 
         /* focus */
         repoPanel.setNextFocusableComponent(newButton);
 
         /* scrolling */
         int unitIncrement = (int) (1.5f * titleFont.getSize() + 0.5f);
-        scrollPane.getHorizontalScrollBar().setUnitIncrement(unitIncrement);
-        scrollPane.getVerticalScrollBar().setUnitIncrement(unitIncrement);
+        
jScrollPane1.getHorizontalScrollBar().setUnitIncrement(unitIncrement);
+        jScrollPane1.getVerticalScrollBar().setUnitIncrement(unitIncrement);
     }
 
     private static int getLeftContainerGap(JComponent comp) {
@@ -202,21 +167,6 @@
         return layoutStyle.getContainerGap(comp, WEST, null);
     }
 
-    private static Component createVerticalStrut(JComponent above,
-                                                 JComponent below) {
-        LayoutStyle layoutStyle = LayoutStyle.getInstance();
-        int height;
-        if (above == null) {
-            height = layoutStyle.getContainerGap(below, NORTH, null);
-        } else if (below == null) {
-            height = layoutStyle.getContainerGap(above, SOUTH, null);
-        } else {
-            height = layoutStyle.getPreferredGap(above, below,
-                                                 RELATED, SOUTH, null);
-        }
-        return Box.createVerticalStrut(height);
-    }
-
     public static Set<QueryTopComponent> getOpenQueries() {
         return openQueries;
     }
@@ -245,7 +195,7 @@
                 }
             }
             QueryController c = getController(query);
-            panel.setComponent(c.getComponent());
+            queryPanel.add(c.getComponent());
             this.query.addPropertyChangeListener(this);
         } else {
             newButton.addActionListener(new ActionListener() {
@@ -535,7 +485,7 @@
                     SwingUtilities.invokeLater(new Runnable() {
                         @Override
                         public void run() {
-                            panel.setComponent(addController.getComponent());
+                            queryPanel.add(addController.getComponent());
 
                             focusFirstEnabledComponent();
 
@@ -584,16 +534,125 @@
     }
 
     private void setSaved() {
-        jPanel2.removeAll();
-        jPanel2.add(panel);
-        jPanel2.revalidate();
-        jPanel2.repaint();
+        headerPanel.setVisible(false);
+        mainPanel.revalidate();
+        mainPanel.repaint();
         setNameAndTooltip();
     }
 
     @Override
     public boolean requestFocusInWindow() {
-        return jPanel2.requestFocusInWindow();
+        return mainPanel.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() {
+
+        jScrollPane1 = new javax.swing.JScrollPane();
+        mainPanel = new javax.swing.JPanel();
+        headerPanel = new javax.swing.JPanel();
+        title = new javax.swing.JLabel();
+        bottomPanel = new javax.swing.JPanel();
+        leftRepoPanel = new javax.swing.JPanel();
+        queryPanel = new javax.swing.JPanel();
+
+        org.openide.awt.Mnemonics.setLocalizedText(title, 
org.openide.util.NbBundle.getMessage(QueryTopComponent.class, 
"SaveWilly.title.text")); // NOI18N
+
+        bottomPanel.setOpaque(false);
+
+        javax.swing.GroupLayout bottomPanelLayout = new 
javax.swing.GroupLayout(bottomPanel);
+        bottomPanel.setLayout(bottomPanelLayout);
+        bottomPanelLayout.setHorizontalGroup(
+            
bottomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGap(0, 94, Short.MAX_VALUE)
+        );
+        bottomPanelLayout.setVerticalGroup(
+            
bottomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGap(0, 26, Short.MAX_VALUE)
+        );
+
+        leftRepoPanel.setOpaque(false);
+
+        javax.swing.GroupLayout leftRepoPanelLayout = new 
javax.swing.GroupLayout(leftRepoPanel);
+        leftRepoPanel.setLayout(leftRepoPanelLayout);
+        leftRepoPanelLayout.setHorizontalGroup(
+            
leftRepoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGap(0, 100, Short.MAX_VALUE)
+        );
+        leftRepoPanelLayout.setVerticalGroup(
+            
leftRepoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGap(0, 0, Short.MAX_VALUE)
+        );
+
+        javax.swing.GroupLayout headerPanelLayout = new 
javax.swing.GroupLayout(headerPanel);
+        headerPanel.setLayout(headerPanelLayout);
+        headerPanelLayout.setHorizontalGroup(
+            
headerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(headerPanelLayout.createSequentialGroup()
+                .addComponent(title)
+                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, 
Short.MAX_VALUE)
+                .addComponent(leftRepoPanel, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addContainerGap())
+            .addGroup(headerPanelLayout.createSequentialGroup()
+                .addContainerGap()
+                .addComponent(bottomPanel, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, 
Short.MAX_VALUE))
+        );
+        headerPanelLayout.setVerticalGroup(
+            
headerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(headerPanelLayout.createSequentialGroup()
+                .addContainerGap()
+                
.addGroup(headerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
 false)
+                    .addComponent(leftRepoPanel, 
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
Short.MAX_VALUE)
+                    .addComponent(title, 
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
Short.MAX_VALUE))
+                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(bottomPanel, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addGap(0, 0, Short.MAX_VALUE))
+        );
+
+        queryPanel.setLayout(new java.awt.BorderLayout());
+
+        javax.swing.GroupLayout mainPanelLayout = new 
javax.swing.GroupLayout(mainPanel);
+        mainPanel.setLayout(mainPanelLayout);
+        mainPanelLayout.setHorizontalGroup(
+            
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addComponent(headerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+            .addComponent(queryPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+        );
+        mainPanelLayout.setVerticalGroup(
+            
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(mainPanelLayout.createSequentialGroup()
+                .addComponent(headerPanel, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addGap(0, 0, 0)
+                .addComponent(queryPanel, 
javax.swing.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE))
+        );
+
+        jScrollPane1.setViewportView(mainPanel);
+
+        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+        this.setLayout(layout);
+        layout.setHorizontalGroup(
+            
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addComponent(jScrollPane1)
+        );
+        layout.setVerticalGroup(
+            
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addComponent(jScrollPane1)
+        );
+    }// </editor-fold>//GEN-END:initComponents
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JPanel bottomPanel;
+    private javax.swing.JPanel headerPanel;
+    private javax.swing.JScrollPane jScrollPane1;
+    private javax.swing.JPanel leftRepoPanel;
+    private javax.swing.JPanel mainPanel;
+    private javax.swing.JPanel queryPanel;
+    private javax.swing.JLabel title;
+    // End of variables declaration//GEN-END:variables
 }
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponentScrollPane.java
 
b/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponentScrollPane.java
deleted file mode 100644
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponentScrollPane.java
+++ /dev/null
@@ -1,72 +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 javax.swing.JScrollPane;
-import javax.swing.JViewport;
-
-/**
- *
- * @author Marian Petras
- */
-public class QueryTopComponentScrollPane extends JScrollPane {
-
-    public QueryTopComponentScrollPane() {
-        super();
-        setLayout(new QueryTopComponentScrollPaneLayout());
-        setBorder(null);
-    }
-
-    public QueryTopComponentScrollPane(Component view) {
-        super(view);
-        setLayout(new QueryTopComponentScrollPaneLayout());
-        setBorder(null);
-    }
-
-    @Override
-    protected JViewport createViewport() {
-        return new QueryTopComponentViewport();
-    }
-
-}
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponentScrollPaneLayout.java
 
b/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponentScrollPaneLayout.java
deleted file mode 100644
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponentScrollPaneLayout.java
+++ /dev/null
@@ -1,369 +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.Container;
-import java.awt.Dimension;
-import java.awt.Insets;
-import java.awt.Rectangle;
-import javax.swing.JScrollPane;
-import javax.swing.ScrollPaneLayout;
-import javax.swing.border.Border;
-
-/**
- * Based
- */
-class QueryTopComponentScrollPaneLayout extends ScrollPaneLayout {
-
-
-    /**
-     * The preferred size of a <code>ScrollPane</code> is the size of the 
insets,
-     * plus the preferred size of the viewport,  plus the preferred size
-     * of the scrollbars that will appear given the current view
-     * and the current scrollbar displayPolicies.
-     *
-     * @param parent the <code>Container</code> that will be laid out
-     * @return a <code>Dimension</code> object specifying the preferred size 
of the
-     *         viewport and any scrollbars
-     * @see ViewportLayout
-     * @see LayoutManager
-     */
-    @Override
-    public Dimension preferredLayoutSize(Container parent)
-    {
-       /* Sync the (now obsolete) policy fields with the
-        * JScrollPane.
-        */
-       JScrollPane scrollPane = (JScrollPane) parent;
-       vsbPolicy = scrollPane.getVerticalScrollBarPolicy();
-       hsbPolicy = scrollPane.getHorizontalScrollBarPolicy();
-
-       Insets insets = parent.getInsets();
-       int prefWidth = insets.left + insets.right;
-       int prefHeight = insets.top + insets.bottom;
-
-       /*
-         * Note that viewport.getViewSize() is equivalent to
-        * viewport.getView().getPreferredSize() modulo a null
-        * view or a view whose size was explicitly set.
-        */
-
-       Dimension extentSize = null;
-       Dimension viewSize = null;
-
-       if (viewport != null) {
-           extentSize = viewport.getPreferredSize();
-           viewSize = viewport.getViewSize();
-       }
-
-       /* If there's a viewport add its preferredSize. */
-
-       if (extentSize != null) {
-           prefWidth += extentSize.width;
-           prefHeight += extentSize.height;
-       }
-
-       /* If there's a JScrollPane.viewportBorder, add its insets. */
-
-       Border viewportBorder = scrollPane.getViewportBorder();
-       if (viewportBorder != null) {
-           Insets vpbInsets = viewportBorder.getBorderInsets(parent);
-           prefWidth += vpbInsets.left + vpbInsets.right;
-           prefHeight += vpbInsets.top + vpbInsets.bottom;
-       }
-
-       /*
-         * If a scrollbar is going to appear, factor its preferred size in.
-        * If the scrollbars policy is AS_NEEDED, this can be a little
-        * tricky:
-        *
-        * - Assuming that a scrollbar hasn't been disabled by the
-        * previous constraint, we need to decide if the scrollbar is going
-        * to appear to correctly compute the JScrollPanes preferred size.
-        * To do this we compare the preferredSize of the viewport (the
-        * extentSize) to the preferredSize of the view.  Although we're
-        * not responsible for laying out the view we'll assume that the
-        * JViewport will always give it its preferredSize.
-        */
-
-       if ((vsb != null)
-                && (viewSize != null) && (extentSize != null)
-                && (viewSize.height > extentSize.height)) {
-            prefWidth += vsb.getPreferredSize().width;
-       }
-
-       if ((hsb != null) 
-               && (viewSize != null) && (extentSize != null)
-               && (viewSize.width > extentSize.width)) {
-            prefHeight += hsb.getPreferredSize().height;
-       }
-
-       return new Dimension(prefWidth, prefHeight);
-    }
-
-
-    /**
-     * Lays out the scrollpane. The positioning of components depends on
-     * the following constraints:
-     * <ul>
-     * <li> If a vertical scrollbar is needed, i.e. if the viewport's extent
-     * height is smaller than its view height or if the 
<code>displayPolicy</code>
-     * is ALWAYS, it's treated like the row header with respect to its
-     * dimensions and is made visible.
-     *
-     * <li> If a horizontal scrollbar is needed, it is treated like the
-     * column header.
-     *
-     * <li> If the scrollpane has a non-<code>null</code>
-     * <code>viewportBorder</code>, then space is allocated for that.
-     *
-     * <li> The viewport gets the space available after accounting for
-     * the previous constraints.
-     * </ul>
-     *
-     * @param parent the <code>Container</code> to lay out
-     */
-    @Override
-    public void layoutContainer(Container parent) {
-
-       /* Sync the (now obsolete) policy fields with the JScrollPane. */
-       JScrollPane scrollPane = (JScrollPane) parent;
-       vsbPolicy = scrollPane.getVerticalScrollBarPolicy();
-       hsbPolicy = scrollPane.getHorizontalScrollBarPolicy();
-
-       Rectangle availR = scrollPane.getBounds();
-       availR.x = availR.y = 0;
-
-       Insets insets = parent.getInsets();
-       availR.x = insets.left;
-       availR.y = insets.top;
-       availR.width -= insets.left + insets.right;
-       availR.height -= insets.top + insets.bottom;
-
-       /*
-         * If there's a JScrollPane.viewportBorder, remove the
-        * space it occupies for availR.
-        */
-
-       Border viewportBorder = scrollPane.getViewportBorder();
-       Insets vpbInsets;
-       if (viewportBorder != null) {
-           vpbInsets = viewportBorder.getBorderInsets(parent);
-           availR.x += vpbInsets.left;
-           availR.y += vpbInsets.top;
-           availR.width -= vpbInsets.left + vpbInsets.right;
-           availR.height -= vpbInsets.top + vpbInsets.bottom;
-       } else {
-           vpbInsets = new Insets(0,0,0,0);
-       }
-
-
-       /*
-         * At this point availR is the space available for the viewport
-        * and scrollbars.
-        *
-         * We'll decide about putting up scrollbars by comparing the
-         * viewport views preferred size with the viewports extent
-        * size (generally just its size).  Using the preferredSize is
-        * reasonable because layout proceeds top down - so we expect
-        * the viewport to be laid out next.  And we assume that the
-        * viewports layout manager will give the view it's preferred
-        * size.  One exception to this is when the view implements
-        * Scrollable and Scrollable.getViewTracksViewport{Width,Height}
-        * methods return true.  If the view is tracking the viewports
-        * width we don't bother with a horizontal scrollbar, similarly
-        * if view.getViewTracksViewport(Height) is true we don't bother
-        * with a vertical scrollbar.
-        */
-
-       Component view = (viewport != null) ? viewport.getView() : null;
-       Dimension extentSize = (viewport != null)
-                               ? viewport.toViewCoordinates(availR.getSize())
-                              : new Dimension(0,0);
-
-       Dimension viewPrefSize;
-        if (view != null) {
-            viewPrefSize = view.getPreferredSize();
-        } else {
-            viewPrefSize = new Dimension(0,0);
-        }
-
-        boolean isEmpty = (availR.width < 0 || availR.height < 0);
-
-       /*
-         * If there's a vertical scrollbar and we need one, allocate
-        * space for it (we'll make it visible later). A vertical
-        * scrollbar is considered to be fixed width, arbitrary height.
-        */
-
-       Rectangle vsbR = new Rectangle(0, availR.y - vpbInsets.top, 0, 0);
-
-       boolean vsbNeeded;
-        if (isEmpty) {
-            vsbNeeded = false;
-       } else {  // vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED
-           vsbNeeded = viewPrefSize.height > extentSize.height;
-       }
-
-
-       if ((vsb != null) && vsbNeeded) {
-           adjustForVSB(availR, vsbR, vpbInsets);
-           extentSize = viewport.toViewCoordinates(availR.getSize());
-       }
-
-       /*
-         * If there's a horizontal scrollbar and we need one, allocate
-        * space for it (we'll make it visible later). A horizontal
-        * scrollbar is considered to be fixed height, arbitrary width.
-        */
-
-       Rectangle hsbR = new Rectangle(availR.x - vpbInsets.left, 0, 0, 0);
-       boolean hsbNeeded;
-        if (isEmpty) {
-            hsbNeeded = false;
-       } else {  // hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED
-           hsbNeeded = viewPrefSize.width > extentSize.width;
-       }
-
-       if ((hsb != null) && hsbNeeded) {
-           adjustForHSB(availR, hsbR, vpbInsets);
-
-           /*
-             * If we added the horizontal scrollbar then we've implicitly
-            * reduced  the vertical space available to the viewport.
-            * As a consequence we may have to add the vertical scrollbar,
-            * if that hasn't been done so already.  Of course we
-            * don't bother with any of this if the vsbPolicy is NEVER.
-            */
-           if ((vsb != null) && !vsbNeeded) {
-
-               extentSize = viewport.toViewCoordinates(availR.getSize());
-               vsbNeeded = viewPrefSize.height > extentSize.height;
-
-               if (vsbNeeded) {
-                   adjustForVSB(availR, vsbR, vpbInsets);
-               }
-           }
-       }
-
-       /*
-         * Set the size of the viewport first, and then recheck the 
Scrollable
-        * methods. Some components base their return values for the 
Scrollable
-        * methods on the size of the Viewport, so that if we don't
-        * ask after resetting the bounds we may have gotten the wrong
-        * answer.
-        */
-
-       if (viewport != null) {
-           viewport.setBounds(availR);
-       }
-
-       /*
-         * We now have the final size of the viewport: availR.
-        * Now fixup the scrollbar widths/heights.
-        */
-       vsbR.height = availR.height + vpbInsets.top + vpbInsets.bottom;
-       hsbR.width = availR.width + vpbInsets.left + vpbInsets.right;
-
-       /*
-         * Set the bounds of the remaining components.  The scrollbars
-        * are made invisible if they're not needed.
-        */
-
-       if (vsb != null) {
-           if (vsbNeeded) {
-               vsb.setVisible(true);
-               vsb.setBounds(vsbR);
-           }
-           else {
-               vsb.setVisible(false);
-           }
-       }
-
-       if (hsb != null) {
-           if (hsbNeeded) {
-               hsb.setVisible(true);
-               hsb.setBounds(hsbR);
-           }
-           else {
-               hsb.setVisible(false);
-           }
-       }
-    }
-
-    /**
-     * Adjusts the <code>Rectangle</code> <code>available</code> as
-     * the vertical scrollbar is needed (<code>wantsVSB</code>).
-     * The location of the vsb is updated in <code>vsbR</code>, and
-     * the viewport border insets (<code>vpbInsets</code>) are used to offset
-     * the vsb.
-     */
-    private void adjustForVSB(Rectangle available,
-                             Rectangle vsbR, Insets vpbInsets) {
-        int vsbWidth = Math.max(0, Math.min(vsb.getPreferredSize().width,
-                                            available.width));
-
-        available.width -= vsbWidth;
-        vsbR.width = vsbWidth;
-        vsbR.x = available.x + available.width + vpbInsets.right;
-    }
-
-    /**
-     * Adjusts the <code>Rectangle</code> <code>available</code> as
-     * the horizontal scrollbar is needed.
-     * The location of the hsb is updated in <code>hsbR</code>, and
-     * the viewport border insets (<code>vpbInsets</code>) are used to offset
-     * the hsb.
-     */
-    private void adjustForHSB(Rectangle available,
-                             Rectangle hsbR, Insets vpbInsets) {
-        int hsbHeight = Math.max(0, Math.min(available.height,
-                                          hsb.getPreferredSize().height));
-
-        available.height -= hsbHeight;
-        hsbR.y = available.y + available.height + vpbInsets.bottom;
-        hsbR.height = hsbHeight;
-    }
-
-}
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponentViewport.java
 
b/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponentViewport.java
deleted file mode 100644
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponentViewport.java
+++ /dev/null
@@ -1,71 +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.Dimension;
-import java.awt.LayoutManager;
-import javax.swing.JViewport;
-
-/**
- *
- * @author Marian Petras
- */
-public class QueryTopComponentViewport extends JViewport {
-
-    @Override
-    protected LayoutManager createLayoutManager() {
-        return QueryTopComponentViewportLayout.SHARED_INSTANCE;
-    }
-
-    @Override
-    public void setSize(Dimension d) {
-        setSize(d.width, d.height);
-    }
-
-    @Override
-    public void setSize(int width, int height) {
-        super.setSize(width, height);
-    }
-
-}
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponentViewportLayout.java
 
b/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponentViewportLayout.java
deleted file mode 100644
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponentViewportLayout.java
+++ /dev/null
@@ -1,118 +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.Container;
-import java.awt.Dimension;
-import java.awt.LayoutManager;
-import java.awt.Point;
-import javax.swing.JViewport;
-import javax.swing.ViewportLayout;
-
-/**
- *
- * @author Marian Petras
- */
-public class QueryTopComponentViewportLayout extends ViewportLayout {
-
-    static LayoutManager SHARED_INSTANCE = new 
QueryTopComponentViewportLayout();
-
-    @Override
-    public void layoutContainer(Container parent) {
-       JViewport vp = (JViewport) parent;
-       Component view = vp.getView();
-
-       if (view == null) {
-           return;
-       }
-
-       /*
-         * All of the dimensions below are in view coordinates, except
-        * vpSize which we're converting.
-        */
-
-       Dimension vpSize = vp.getSize();
-       Dimension viewPrefSize = view.getPreferredSize();
-       Dimension extentSize = vp.toViewCoordinates(vpSize);
-       Dimension viewSize = new Dimension(viewPrefSize);
-
-       Point viewPosition = vp.getViewPosition();
-
-       /*
-         * If the new viewport size would leave empty space to the
-        * right of the view, right justify the view or left justify
-        * the view when the width of the view is smaller than the
-        * container.
-        */
-        if ((viewPosition.x + extentSize.width) > viewSize.width) {
-            viewPosition.x = Math.max(0, viewSize.width - extentSize.width);
-        }
-
-       /*
-         * If the new viewport size would leave empty space below the
-        * view, bottom justify the view or top justify the view when
-        * the height of the view is smaller than the container.
-        */
-       if ((viewPosition.y + extentSize.height) > viewSize.height) {
-           viewPosition.y = Math.max(0, viewSize.height - extentSize.height);
-       }
-
-        /*
-        * If the origin of the view is showing and the viewport is
-        * bigger than the views preferred size, then make the view
-        * the same size as the viewport.
-        */
-        if ((viewPosition.x == 0) && (vpSize.width > viewPrefSize.width)) {
-            viewSize.width = vpSize.width;
-        }
-        if ((viewPosition.y == 0) && (vpSize.height > viewPrefSize.height)) {
-            viewSize.height = vpSize.height;
-        }
-
-       vp.setViewPosition(viewPosition);
-       vp.setViewSize(viewSize);
-    }
-
-
-}
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/RepoPanel.java 
b/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/RepoPanel.java
deleted file mode 100644
--- a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/RepoPanel.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 2009-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-2010 Sun Microsystems, Inc.
- */
-
-package org.netbeans.modules.bugtracking.ui.query;
-
-import javax.swing.LayoutStyle;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.EventQueue;
-import java.awt.Insets;
-import javax.swing.BorderFactory;
-import javax.swing.JComponent;
-import static java.lang.Math.max;
-import javax.swing.JPanel;
-import static javax.swing.SwingConstants.EAST;
-import static javax.swing.SwingConstants.WEST;
-import org.netbeans.modules.bugtracking.QueryImpl;
-import org.netbeans.modules.bugtracking.util.UIUtils;
-
-/**
- * Top part of the {@code QueryTopComponent} - displays the combo-box for
- * selection of the bug-tracking repository and the list of saved queries.
- *
- * @author Marian Petras
- */
-class RepoPanel extends JPanel {
-
-    private static final int MIN_SPACE = 24;
-
-    private final RepoSelectorPanel repoSelectorPanel;
-
-    RepoPanel(JComponent repoSelector,
-              JComponent newRepoButton) {
-        super(null);
-        repoSelectorPanel = new RepoSelectorPanel(repoSelector, 
newRepoButton);
-
-        LayoutStyle layoutStyle = LayoutStyle.getInstance();
-        setBorder(BorderFactory.createEmptyBorder(
-                      0, layoutStyle.getContainerGap(this, WEST, 
getParent()),
-                      0, layoutStyle.getContainerGap(this, EAST, 
getParent())));
-
-        add(repoSelectorPanel);
-    }
-
-    @Override
-    public Dimension getPreferredSize() {
-        Dimension repoSelectorPrefSize = 
repoSelectorPanel.getPreferredSize();
-
-        int width = repoSelectorPrefSize.width;
-        int height;
-
-        Insets insets = getInsets();
-
-        height = repoSelectorPrefSize.height
-                 + insets.top + insets.bottom;
-        width += insets.left + insets.right;
-
-        return new Dimension(width, height);
-    }
-
-    @Override
-    public void doLayout() {
-        int baseline = getBaseline();
-        Insets insets = getInsets();
-
-        int x = insets.left;
-        Dimension tmpPrefSize = repoSelectorPanel.getPreferredSize();
-        repoSelectorPanel.setBounds(x,
-                                    baseline - 
repoSelectorPanel.getBaseline(),
-                                    tmpPrefSize.width,
-                                    tmpPrefSize.height);
-    }
-
-    public int getBaseline() {
-        int baseline = repoSelectorPanel.getBaseline();
-        baseline += getInsets().top;
-        return baseline;
-    }
-
-    @Override
-    public Dimension getMaximumSize() {
-        return new Dimension(Short.MAX_VALUE, getPreferredSize().height);
-    }
-
-}
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/RepoSelectorPanel.java
 
b/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/RepoSelectorPanel.java
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/RepoSelectorPanel.java
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/RepoSelectorPanel.java
@@ -42,7 +42,6 @@
 
 package org.netbeans.modules.bugtracking.ui.query;
 
-import java.awt.Dimension;
 import javax.swing.GroupLayout;
 import java.awt.Component;
 import java.awt.EventQueue;
@@ -59,22 +58,17 @@
 import static javax.swing.LayoutStyle.ComponentPlacement.RELATED;
 
 /**
- * Part of the {@code RepoPanel}. Contains the combo-box for selection
- * of a bug-tracking repository, plus accessories
- * (label, button &quot;New&quot).
+ * Part of the {@code QueryTopComponent}. Contains the combo-box for 
selection
+ * of a bug-tracking repository, plus accessories (label, button 
&quot;New&quot).
  *
  * @author Marian Petras
  */
 public class RepoSelectorPanel extends JPanel implements FocusListener {
 
-    private final JLabel repoSelectorLabel;
-    private final JComponent repoSelector;
-    private final JComponent newRepoButton;
-
     RepoSelectorPanel(JComponent repoSelector,
                       JComponent newRepoButton) {
         super(null);
-        repoSelectorLabel = new JLabel();
+        JLabel repoSelectorLabel = new JLabel();
 
         repoSelectorLabel.setLabelFor(repoSelector);
         repoSelectorLabel.setFocusCycleRoot(true);
@@ -84,9 +78,6 @@
                NbBundle.getMessage(getClass(),
                                    
"QueryTopComponent.repoLabel.text"));//NOI18N
 
-        this.repoSelector = repoSelector;
-        this.newRepoButton = newRepoButton;
-
         setOpaque(false);
 
         newRepoButton.addFocusListener(this);
@@ -110,37 +101,6 @@
                         .addComponent(newRepoButton));
     }
 
-    /*
-     * To make it work correctly with GroupLayout.
-     */
-    @Override
-    public int getBaseline(int width, int height) {
-        return getBaseline();
-    }
-
-    /*
-     * To make it work correctly with GroupLayout.
-     */
-    @Override
-    public BaselineResizeBehavior getBaselineResizeBehavior() {
-        return BaselineResizeBehavior.CONSTANT_ASCENT;
-    }
-
-    int getBaseline() {
-        Dimension lSize = repoSelectorLabel.getPreferredSize();
-        Dimension sSize = repoSelector.getPreferredSize();
-        Dimension bSize = newRepoButton.getPreferredSize();
-        int baseline = max(repoSelectorLabel.getBaseline(lSize.width, 
lSize.height),
-                           repoSelector.getBaseline(sSize.width, 
sSize.height),
-                           newRepoButton.getBaseline(bSize.width, 
bSize.height))
-                       + getInsets().top;
-        return baseline;
-    }
-
-    private static int max(int a, int b, int c) {
-        return Math.max(a, Math.max(b, c));
-    }
-
     @Override
     public void focusGained(FocusEvent e) {
         final Component c = e.getComponent();
diff --git a/bugzilla/nbproject/project.xml b/bugzilla/nbproject/project.xml
--- a/bugzilla/nbproject/project.xml
+++ b/bugzilla/nbproject/project.xml
@@ -91,7 +91,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>1.48</specification-version>
+                        <specification-version>1.49</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
diff --git a/jira/nbproject/project.xml b/jira/nbproject/project.xml
--- a/jira/nbproject/project.xml
+++ b/jira/nbproject/project.xml
@@ -93,7 +93,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>1.48</specification-version>
+                        <specification-version>1.49</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>

[hg] main-silver: created QueryTopComponent.form and removed all...

Tomas Stupka 04/08/2013

Project Features

About this Project

ConnectedDeveloper was started in November 2009, is owned by tpavek, and has 66 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