[hg] main-silver: Issue #227155 - Help | Report Issue .... : add...

  • From: Tomas Stupka < >
  • To:
  • Subject: [hg] main-silver: Issue #227155 - Help | Report Issue .... : add...
  • Date: Thu, 07 Mar 2013 13:00:34 -0800

changeset 42d02fe9e263 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/42d02fe9e263
description:
        Issue #227155 - Help | Report Issue .... : add View action beside 
"Attach log file"

diffstat:

 bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentPanel.form  |  33 
+++-
 bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentPanel.java  |  35 
++-
 bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentsPanel.java |  21 
+-
 bugzilla/src/org/netbeans/modules/bugzilla/issue/Bundle.properties     |   8 
+-
 bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.form       |  71 
+++++--
 bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.java       |  89 
+++++++--
 6 files changed, 187 insertions(+), 70 deletions(-)

diffs (692 lines):

diff --git 
a/bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentPanel.form 
b/bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentPanel.form
--- a/bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentPanel.form
+++ b/bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentPanel.form
@@ -20,7 +20,7 @@
               <EmptySpace max="-2" attributes="0"/>
               <Group type="103" groupAlignment="0" attributes="0">
                   <Group type="102" alignment="0" attributes="0">
-                      <Component id="fileField" max="32767" attributes="0"/>
+                      <Component id="fileField" pref="445" max="32767" 
attributes="0"/>
                       <EmptySpace min="-2" max="-2" attributes="1"/>
                       <Component id="browseButton" min="-2" max="-2" 
attributes="0"/>
                   </Group>
@@ -39,6 +39,8 @@
                   </Group>
               </Group>
               <EmptySpace min="-2" max="-2" attributes="0"/>
+              <Component id="viewButton" min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
               <Component id="deleteButton" min="-2" max="-2" attributes="0"/>
               <EmptySpace max="-2" attributes="0"/>
           </Group>
@@ -52,6 +54,7 @@
                   <Component id="fileField" alignment="3" min="-2" max="-2" 
attributes="0"/>
                   <Component id="browseButton" alignment="3" min="-2" 
max="-2" attributes="0"/>
                   <Component id="deleteButton" alignment="3" min="-2" 
max="-2" attributes="0"/>
+                  <Component id="viewButton" alignment="3" min="-2" max="-2" 
attributes="0"/>
               </Group>
               <EmptySpace max="-2" attributes="0"/>
               <Group type="103" groupAlignment="3" attributes="0">
@@ -86,6 +89,9 @@
           <ResourceString 
bundle="org/netbeans/modules/bugzilla/issue/Bundle.properties" 
key="AttachmentPanel.fileField.AccessibleContext.accessibleDescription" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;)"/>
         </Property>
       </AccessibilityProperties>
+      <AuxValues>
+        <AuxValue name="JavaCodeGenerator_VariableModifier" 
type="java.lang.Integer" value="16"/>
+      </AuxValues>
     </Component>
     <Component class="javax.swing.JButton" name="browseButton">
       <Properties>
@@ -101,6 +107,9 @@
       <Events>
         <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" 
handler="browseButtonActionPerformed"/>
       </Events>
+      <AuxValues>
+        <AuxValue name="JavaCodeGenerator_VariableModifier" 
type="java.lang.Integer" value="16"/>
+      </AuxValues>
     </Component>
     <Component class="org.netbeans.modules.bugtracking.util.LinkButton" 
name="deleteButton">
       <Properties>
@@ -153,6 +162,9 @@
           <ResourceString 
bundle="org/netbeans/modules/bugzilla/issue/Bundle.properties" 
key="AttachmentPanel.fileTypeCombo.AccessibleContext.accessibleDescription" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;)"/>
         </Property>
       </AccessibilityProperties>
+      <AuxValues>
+        <AuxValue name="JavaCodeGenerator_VariableModifier" 
type="java.lang.Integer" value="16"/>
+      </AuxValues>
     </Component>
     <Component class="javax.swing.JLabel" name="patchLabel">
       <Properties>
@@ -163,6 +175,9 @@
           <ResourceString 
bundle="org/netbeans/modules/bugzilla/issue/Bundle.properties" 
key="AttachmentPanel.patchLabel.text" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;)"/>
         </Property>
       </Properties>
+      <AuxValues>
+        <AuxValue name="JavaCodeGenerator_VariableModifier" 
type="java.lang.Integer" value="16"/>
+      </AuxValues>
     </Component>
     <Component class="javax.swing.JCheckBox" name="patchChoice">
       <Properties>
@@ -184,6 +199,22 @@
       <Events>
         <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" handler="patchChoiceActionPerformed"/>
       </Events>
+      <AuxValues>
+        <AuxValue name="JavaCodeGenerator_VariableModifier" 
type="java.lang.Integer" value="16"/>
+      </AuxValues>
+    </Component>
+    <Component class="org.netbeans.modules.bugtracking.util.LinkButton" 
name="viewButton">
+      <Properties>
+        <Property name="text" type="java.lang.String" 
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString 
bundle="org/netbeans/modules/bugzilla/issue/Bundle.properties" 
key="AttachmentPanel.viewButton.text" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;)"/>
+        </Property>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" handler="viewButtonActionPerformed"/>
+      </Events>
+      <AuxValues>
+        <AuxValue name="JavaCodeGenerator_VariableModifier" 
type="java.lang.Integer" value="16"/>
+      </AuxValues>
     </Component>
   </SubComponents>
 </Form>
diff --git 
a/bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentPanel.java 
b/bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentPanel.java
--- a/bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentPanel.java
+++ b/bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentPanel.java
@@ -135,15 +135,10 @@
     // <editor-fold defaultstate="collapsed" desc="Generated 
Code">//GEN-BEGIN:initComponents
     private void initComponents() {
 
-        fileField = new javax.swing.JTextField();
-        browseButton = new javax.swing.JButton();
         deleteButton = new 
org.netbeans.modules.bugtracking.util.LinkButton();
         descriptionLabel = new javax.swing.JLabel();
         descriptionField = new javax.swing.JTextField();
         fileTypeLabel = new javax.swing.JLabel();
-        fileTypeCombo = new javax.swing.JComboBox();
-        patchLabel = new javax.swing.JLabel();
-        patchChoice = new javax.swing.JCheckBox();
 
         fileField.setColumns(30);
 
@@ -180,6 +175,13 @@
             }
         });
 
+        
viewButton.setText(org.openide.util.NbBundle.getMessage(AttachmentPanel.class,
 "AttachmentPanel.viewButton.text")); // NOI18N
+        viewButton.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                viewButtonActionPerformed(evt);
+            }
+        });
+
         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
         this.setLayout(layout);
         layout.setHorizontalGroup(
@@ -188,7 +190,7 @@
                 .addContainerGap()
                 
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                     .addGroup(layout.createSequentialGroup()
-                        .addComponent(fileField)
+                        .addComponent(fileField, 
javax.swing.GroupLayout.DEFAULT_SIZE, 445, Short.MAX_VALUE)
                         
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                         .addComponent(browseButton))
                     .addGroup(layout.createSequentialGroup()
@@ -199,9 +201,11 @@
                         
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                         
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                             .addComponent(fileTypeCombo, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE)
-                            .addComponent(descriptionField, 
javax.swing.GroupLayout.DEFAULT_SIZE, 327, Short.MAX_VALUE)
+                            .addComponent(descriptionField)
                             .addComponent(patchChoice))))
                 
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(viewButton, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE)
+                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addComponent(deleteButton, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE)
                 .addContainerGap())
         );
@@ -212,7 +216,8 @@
                 
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                     .addComponent(fileField, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE)
                     .addComponent(browseButton)
-                    .addComponent(deleteButton, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE))
+                    .addComponent(deleteButton, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE)
+                    .addComponent(viewButton, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE))
                 
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                     .addComponent(descriptionLabel)
@@ -259,17 +264,21 @@
         }
     }//GEN-LAST:event_patchChoiceActionPerformed
 
+    private void viewButtonActionPerformed(java.awt.event.ActionEvent evt) 
{//GEN-FIRST:event_viewButtonActionPerformed
+        IssuePanel.showLogFile(evt);
+    }//GEN-LAST:event_viewButtonActionPerformed
 
     // Variables declaration - do not modify//GEN-BEGIN:variables
-    private javax.swing.JButton browseButton;
+    final javax.swing.JButton browseButton = new javax.swing.JButton();
     private org.netbeans.modules.bugtracking.util.LinkButton deleteButton;
     private javax.swing.JTextField descriptionField;
     private javax.swing.JLabel descriptionLabel;
-    private javax.swing.JTextField fileField;
-    private javax.swing.JComboBox fileTypeCombo;
+    final javax.swing.JTextField fileField = new javax.swing.JTextField();
+    final javax.swing.JComboBox fileTypeCombo = new javax.swing.JComboBox();
     private javax.swing.JLabel fileTypeLabel;
-    private javax.swing.JCheckBox patchChoice;
-    private javax.swing.JLabel patchLabel;
+    final javax.swing.JCheckBox patchChoice = new javax.swing.JCheckBox();
+    final javax.swing.JLabel patchLabel = new javax.swing.JLabel();
+    final org.netbeans.modules.bugtracking.util.LinkButton viewButton = new 
org.netbeans.modules.bugtracking.util.LinkButton();
     // End of variables declaration//GEN-END:variables
 
     static class FileType {
diff --git 
a/bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentsPanel.java 
b/bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentsPanel.java
--- a/bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentsPanel.java
+++ b/bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentsPanel.java
@@ -156,6 +156,7 @@
         dummyAttachLabel.setVisible(false);
         noneLabel.setVisible(noAttachments);
         updateButtonText(noAttachments);
+        int groupWidth = 0;
         if (noAttachments) {
             // noneLabel + createNewButton
             verticalGroup.addGroup(newVerticalGroup);
@@ -268,7 +269,7 @@
                         .addGroup(pGroup));
             }
             verticalGroup.addGroup(newVerticalGroup);
-            int groupWidth = 0;
+            groupWidth = 0;
             if (maxMethod != null) {
                 try {
                     groupWidth = (Integer)maxMethod.invoke(horizontalGroup, 
0);
@@ -308,9 +309,9 @@
         layout.setHorizontalGroup(horizontalGroup);
         layout.setVerticalGroup(verticalGroup);
         
-        
((CreateNewAction)createNewButton.getAction()).setLayoutGroups(horizontalGroup,
 newVerticalGroup);
+        
((CreateNewAction)createNewButton.getAction()).setLayoutGroups(horizontalGroup,
 newVerticalGroup, groupWidth);
         if(attachLogFileButton != null) {
-            
((CreateNewAction)attachLogFileButton.getAction()).setLayoutGroups(horizontalGroup,
 newVerticalGroup);
+            
((CreateNewAction)attachLogFileButton.getAction()).setLayoutGroups(horizontalGroup,
 newVerticalGroup, groupWidth);
         }
         
         setLayout(layout);
@@ -422,6 +423,7 @@
     class CreateNewAction extends AbstractAction {
 
         private final boolean attachLogFile;
+        private int groupWidth;
         public CreateNewAction() {
             attachLogFile = false;
         }
@@ -434,16 +436,21 @@
         private GroupLayout.SequentialGroup verticalGroup;
 
         void setLayoutGroups(GroupLayout.ParallelGroup horizontalGroup,
-                GroupLayout.SequentialGroup verticalGroup) {
+                GroupLayout.SequentialGroup verticalGroup, int groupWidth) {
             this.horizontalGroup = horizontalGroup;
             this.verticalGroup = verticalGroup;
+            this.groupWidth = groupWidth;
         }
 
         @Override
         public void actionPerformed(ActionEvent e) {
             AttachmentPanel attachment = new AttachmentPanel();
             attachment.setBackground(UIUtils.getSectionPanelBackground());
+            if(groupWidth > 0) {
+                horizontalGroup.addComponent(attachment, 0, 0, groupWidth);
+            } else {
             horizontalGroup.addComponent(attachment, 
GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, 
GroupLayout.PREFERRED_SIZE);
+            }
             
verticalGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
             verticalGroup.addComponent(attachment, 
GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, 
GroupLayout.PREFERRED_SIZE);
             if (noneLabel.isVisible()) {
@@ -460,6 +467,12 @@
                 if(f.exists()) {
                     attachment.setAttachment(f, 
NbBundle.getMessage(IssuePanel.class, "MSG_LOG_FILE_DESC"), 
NbBugzillaConstants.NB_LOG_FILE_ATT_CONT_TYPE); // NOI18N
                 }
+                attachment.browseButton.setEnabled(false);
+                attachment.fileField.setEnabled(false);
+                attachment.fileTypeCombo.setEnabled(false);
+                attachment.patchChoice.setEnabled(false);
+            } else {
+                attachment.viewButton.setVisible(false);
             }
             
             newAttachments.add(attachment);
diff --git 
a/bugzilla/src/org/netbeans/modules/bugzilla/issue/Bundle.properties 
b/bugzilla/src/org/netbeans/modules/bugzilla/issue/Bundle.properties
--- a/bugzilla/src/org/netbeans/modules/bugzilla/issue/Bundle.properties
+++ b/bugzilla/src/org/netbeans/modules/bugzilla/issue/Bundle.properties
@@ -106,7 +106,6 @@
 IssuePanel.addCommentLabel.text=Add your comment:
 IssuePanel.submitButton.text=Submit Changes
 IssuePanel.submitButton.text.new=Submit Issue
-IssuePanel.cancelButton.text=Cancel Changes
 IssuePanel.attachmentsLabel.text=Attachments:
 # {0} id, {1} summary
 IssuePanel.headerLabel.format=Issue #{0} - {1}
@@ -181,6 +180,8 @@
 IssuePanel.addCommentArea.AccessibleContext.accessibleDescription=N/A
 IssuePanel.submitButton.AccessibleContext.accessibleDescription=N/A
 IssuePanel.cancelButton.AccessibleContext.accessibleDescription=N/A
+IssuePanel.cancelButton.text=Cancel Changes
+IssuePanel.viewLogButton.text=(review IDE Log)
 # {0} NB version {1} OS name {2} OS version {3} OS arch
 # {4} Java version {5} java.vm.name {6} java.vm.version
 IssuePanel.newIssue.netbeansInfo=Product Version = {0}\n\
@@ -233,6 +234,7 @@
 AttachmentPanel.patchChoice.AccessibleContext.accessibleDescription=N/A
 AttachmentPanel.patchChoice.AccessibleContext.accessibleName=Patch
 AttachmentPanel.authorButton.AccessibleContext.accessibleDescription=Email 
the author
+AttachmentPanel.viewButton.text=view
 
 LBL_NEW_STATUS=New
 LBL_SUMMARY_CHANGED_STATUS=Summary changed
@@ -303,6 +305,6 @@
 IssuePanel.deadlineField.text=YYYY-MM-DD
 IssuePanel.workedSumField.text=0
 IssuePanel.timetrackingLabel.text=Timetracking:
-IssuePanel.attachLogCheckBox.text=Attach log file
+IssuePanel.attachLogCheckBox.text=Attach IDE Log
 
-MSG_LOG_FILE_DESC=IDE log
\ No newline at end of file
+MSG_LOG_FILE_DESC=IDE log
diff --git a/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.form 
b/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.form
--- a/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.form
+++ b/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.form
@@ -369,11 +369,11 @@
                               <EmptySpace min="-2" max="-2" attributes="0"/>
                               <Component id="summaryWarning" min="-2" 
pref="16" max="-2" attributes="0"/>
                           </Group>
+                          <Component id="customFieldsPanelRight" 
alignment="0" max="32767" attributes="0"/>
                           <Component id="messagePanel" alignment="0" 
max="32767" attributes="0"/>
-                          <Component id="customFieldsPanelRight" 
alignment="0" max="32767" attributes="0"/>
                           <Group type="102" attributes="0">
                               <Group type="103" groupAlignment="0" 
attributes="0">
-                                  <Group type="102" alignment="0" 
attributes="0">
+                                  <Group type="102" attributes="0">
                                       <Group type="103" groupAlignment="0" 
max="-2" attributes="0">
                                           <Component id="issueTypeCombo" 
max="32767" attributes="1"/>
                                           <Component 
id="statusWhiteboardField" min="0" pref="0" max="32767" attributes="1"/>
@@ -481,10 +481,13 @@
                                   </Group>
                                   <Group type="102" alignment="0" 
attributes="0">
                                       <Component id="submitButton" min="-2" 
max="-2" attributes="0"/>
-                                      <EmptySpace min="-2" max="-2" 
attributes="0"/>
+                                      <EmptySpace max="-2" attributes="0"/>
                                       <Component id="cancelButton" min="-2" 
max="-2" attributes="0"/>
+                                      <EmptySpace max="-2" attributes="0"/>
+                                      <Component id="attachLogCheckBox" 
min="-2" max="-2" attributes="0"/>
+                                      <EmptySpace max="-2" attributes="0"/>
+                                      <Component id="viewLogButton" min="-2" 
max="-2" attributes="0"/>
                                   </Group>
-                                  <Component id="attachLogCheckBox" min="-2" 
max="-2" attributes="0"/>
                               </Group>
                               <EmptySpace min="0" pref="0" max="32767" 
attributes="0"/>
                           </Group>
@@ -497,8 +500,8 @@
     </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="102" attributes="0">
+              <EmptySpace min="-2" max="-2" attributes="0"/>
               <Group type="103" groupAlignment="0" attributes="0">
                   <Component id="headerField" alignment="0" min="-2" 
max="-2" attributes="0"/>
                   <Component id="separatorLabel2" linkSize="6" alignment="0" 
min="-2" max="-2" attributes="0"/>
@@ -509,7 +512,7 @@
                   <Component id="separatorLabel3" linkSize="6" alignment="0" 
min="-2" max="-2" attributes="0"/>
                   <Component id="showInBrowserButton" linkSize="6" 
alignment="0" min="-2" max="-2" attributes="0"/>
               </Group>
-              <EmptySpace max="-2" attributes="0"/>
+              <EmptySpace min="-2" max="-2" attributes="0"/>
               <Group type="103" groupAlignment="3" attributes="0">
                   <Component id="productLabel" alignment="3" min="-2" 
max="-2" attributes="0"/>
                   <Component id="productCombo" alignment="3" min="-2" 
max="-2" attributes="0"/>
@@ -520,7 +523,7 @@
                   <Component id="modifiedField" alignment="3" min="-2" 
max="-2" attributes="0"/>
                   <Component id="reportedStatusLabel" alignment="3" min="-2" 
max="-2" attributes="0"/>
               </Group>
-              <EmptySpace max="-2" attributes="0"/>
+              <EmptySpace min="-2" max="-2" attributes="0"/>
               <Group type="103" groupAlignment="3" attributes="0">
                   <Component id="componentLabel" alignment="3" min="-2" 
max="-2" attributes="0"/>
                   <Component id="componentCombo" alignment="3" min="-2" 
max="-2" attributes="0"/>
@@ -530,14 +533,14 @@
                   <Component id="assignedToStatusLabel" alignment="3" 
min="-2" max="-2" attributes="0"/>
                   <Component id="assignedToWarning" alignment="3" min="-2" 
pref="16" max="-2" attributes="0"/>
               </Group>
-              <EmptySpace max="-2" attributes="0"/>
+              <EmptySpace min="-2" max="-2" attributes="0"/>
               <Group type="103" groupAlignment="3" attributes="0">
                   <Component id="versionLabel" alignment="3" min="-2" 
max="-2" attributes="0"/>
                   <Component id="versionCombo" alignment="3" min="-2" 
max="-2" attributes="0"/>
                   <Component id="versionWarning" alignment="3" min="-2" 
pref="16" max="-2" attributes="0"/>
                   <Component id="assignToDefaultCheckBox" alignment="3" 
min="-2" max="-2" attributes="0"/>
               </Group>
-              <EmptySpace max="-2" attributes="0"/>
+              <EmptySpace min="-2" max="-2" attributes="0"/>
               <Group type="103" groupAlignment="3" attributes="0">
                   <Component id="platformLabel" alignment="3" min="-2" 
max="-2" attributes="0"/>
                   <Component id="platformCombo" alignment="3" min="-2" 
max="-2" attributes="0"/>
@@ -548,7 +551,7 @@
                   <Component id="qaContactField" alignment="3" min="-2" 
max="-2" attributes="0"/>
                   <Component id="qaContactWarning" alignment="3" min="-2" 
pref="16" max="-2" attributes="0"/>
               </Group>
-              <EmptySpace max="-2" attributes="0"/>
+              <EmptySpace min="-2" max="-2" attributes="0"/>
               <Group type="103" groupAlignment="3" attributes="0">
                   <Component id="issueTypeLabel" alignment="3" min="-2" 
max="-2" attributes="0"/>
                   <Component id="issueTypeCombo" alignment="3" min="-2" 
max="-2" attributes="0"/>
@@ -557,9 +560,9 @@
                   <Component id="ccField" alignment="3" min="-2" max="-2" 
attributes="0"/>
                   <Component id="ccWarning" alignment="3" min="-2" pref="16" 
max="-2" attributes="0"/>
               </Group>
-              <EmptySpace max="-2" attributes="0"/>
+              <EmptySpace min="-2" max="-2" attributes="0"/>
               <Component id="dummyLabel1" linkSize="8" min="-2" max="-2" 
attributes="0"/>
-              <EmptySpace max="-2" attributes="0"/>
+              <EmptySpace min="-2" max="-2" attributes="0"/>
               <Group type="103" groupAlignment="3" attributes="0">
                   <Component id="priorityLabel" alignment="3" min="-2" 
max="-2" attributes="0"/>
                   <Component id="priorityCombo" linkSize="8" alignment="3" 
min="-2" max="-2" attributes="0"/>
@@ -570,7 +573,7 @@
                   <Component id="statusCombo" alignment="3" min="-2" 
max="-2" attributes="0"/>
                   <Component id="statusWarning" alignment="3" min="-2" 
pref="16" max="-2" attributes="0"/>
               </Group>
-              <EmptySpace max="-2" attributes="0"/>
+              <EmptySpace min="-2" max="-2" attributes="0"/>
               <Group type="103" groupAlignment="3" attributes="0">
                   <Component id="targetMilestoneLabel" alignment="3" 
min="-2" max="-2" attributes="0"/>
                   <Component id="targetMilestoneCombo" alignment="3" 
min="-2" max="-2" attributes="0"/>
@@ -607,13 +610,13 @@
                   <Component id="blocksWarning" alignment="3" min="-2" 
pref="16" max="-2" attributes="0"/>
                   <Component id="blocksButton" alignment="3" min="-2" 
max="-2" attributes="0"/>
               </Group>
-              <EmptySpace max="-2" attributes="0"/>
+              <EmptySpace min="-2" max="-2" attributes="0"/>
               <Group type="103" groupAlignment="3" attributes="0">
                   <Component id="statusWhiteboardLabel" alignment="3" 
min="-2" max="-2" attributes="0"/>
                   <Component id="statusWhiteboardField" alignment="3" 
min="-2" max="-2" attributes="0"/>
                   <Component id="statusWhiteboardWarning" alignment="3" 
min="-2" pref="16" max="-2" attributes="0"/>
               </Group>
-              <EmptySpace type="unrelated" max="-2" attributes="0"/>
+              <EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
               <Group type="103" groupAlignment="0" attributes="0">
                   <Group type="102" attributes="0">
                       <Component id="timetrackingLabel" min="-2" max="-2" 
attributes="0"/>
@@ -622,18 +625,14 @@
                   </Group>
                   <Component id="dummyTimetrackingPanel" min="-2" max="-2" 
attributes="0"/>
               </Group>
-              <EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
+              <EmptySpace min="-2" max="-2" attributes="0"/>
               <Group type="103" groupAlignment="0" attributes="0">
                   <Group type="102" attributes="0">
                       <Component id="attachmentsLabel" min="-2" max="-2" 
attributes="0"/>
                       <EmptySpace min="-2" max="-2" attributes="0"/>
                       <Component id="dummyLabel3" linkSize="8" min="-2" 
max="-2" attributes="0"/>
                   </Group>
-                  <Group type="102" attributes="0">
                       <Component id="dummyAttachmentsPanel" min="-2" 
max="-2" attributes="0"/>
-                      <EmptySpace max="-2" attributes="0"/>
-                      <Component id="attachLogCheckBox" min="-2" max="-2" 
attributes="0"/>
-                  </Group>
               </Group>
               <EmptySpace min="-2" max="-2" attributes="0"/>
               <Group type="103" groupAlignment="1" attributes="0">
@@ -652,16 +651,25 @@
                   <Component id="scrollPane1" min="-2" max="-2" 
attributes="0"/>
               </Group>
               <EmptySpace min="-2" max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Group type="102" attributes="0">
+                      <EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
               <Group type="103" groupAlignment="3" attributes="0">
+                          <Component id="viewLogButton" alignment="3" 
min="-2" max="-2" attributes="0"/>
+                          <Component id="attachLogCheckBox" alignment="3" 
min="-2" max="-2" attributes="0"/>
+                      </Group>
+                  </Group>
+                  <Group type="103" alignment="0" groupAlignment="3" 
attributes="0">
                   <Component id="submitButton" alignment="3" min="-2" 
max="-2" attributes="0"/>
                   <Component id="cancelButton" alignment="3" min="-2" 
max="-2" attributes="0"/>
               </Group>
-              <EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
-              <Component id="messagePanel" min="-2" max="-2" attributes="0"/>
-              <EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
+              </Group>
+              <EmptySpace min="-2" max="-2" attributes="0"/>
+              <Component id="messagePanel" pref="2" max="32767" 
attributes="0"/>
+              <EmptySpace min="-2" max="-2" attributes="0"/>
               <Component id="separator" min="-2" max="-2" attributes="0"/>
               <EmptySpace min="-2" max="-2" attributes="0"/>
-              <Component id="dummyCommentsPanel" pref="24" max="32767" 
attributes="0"/>
+              <Component id="dummyCommentsPanel" pref="38" max="32767" 
attributes="0"/>
           </Group>
       </Group>
     </DimensionLayout>
@@ -1426,6 +1434,19 @@
           <ResourceString 
bundle="org/netbeans/modules/bugzilla/issue/Bundle.properties" 
key="IssuePanel.attachLogCheckBox.text" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;)"/>
         </Property>
       </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" 
handler="attachLogCheckBoxActionPerformed"/>
+      </Events>
+    </Component>
+    <Component class="org.netbeans.modules.bugtracking.util.LinkButton" 
name="viewLogButton">
+      <Properties>
+        <Property name="text" type="java.lang.String" 
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+          <ResourceString 
bundle="org/netbeans/modules/bugzilla/issue/Bundle.properties" 
key="IssuePanel.viewLogButton.text" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;)"/>
+        </Property>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" 
handler="viewLogButtonActionPerformed"/>
+      </Events>
     </Component>
   </SubComponents>
 </Form>
diff --git a/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.java 
b/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.java
--- a/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.java
+++ b/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.java
@@ -140,6 +140,7 @@
 import org.netbeans.modules.bugzilla.util.NbBugzillaConstants;
 import org.netbeans.modules.spellchecker.api.Spellchecker;
 import org.openide.awt.HtmlBrowser;
+import org.openide.filesystems.FileUtil;
 import org.openide.modules.Places;
 import org.openide.nodes.Node;
 import org.openide.util.HelpCtx;
@@ -455,10 +456,13 @@
         boolean isNetbeans = 
BugtrackingUtil.isNbRepository(issue.getRepository().getUrl());
         if(isNew && isNetbeans) {
             attachLogCheckBox.setVisible(true);
+            viewLogButton.setVisible(true);
             
attachLogCheckBox.setSelected(BugzillaConfig.getInstance().getAttachLogFile());
         } else {
             attachLogCheckBox.setVisible(false);
-        }
+            viewLogButton.setVisible(false);
+        }
+        switchViewLog();
         headerField.setVisible(!isNew);
         statusCombo.setEnabled(!isNew);
         org.openide.awt.Mnemonics.setLocalizedText(addCommentLabel, 
NbBundle.getMessage(IssuePanel.class, isNew ? "IssuePanel.description" : 
"IssuePanel.addCommentLabel.text")); // NOI18N
@@ -1557,6 +1561,7 @@
         issueTypeWarning = new javax.swing.JLabel();
         assignToDefaultCheckBox = new javax.swing.JCheckBox();
         attachLogCheckBox = new javax.swing.JCheckBox();
+        viewLogButton = new 
org.netbeans.modules.bugtracking.util.LinkButton();
 
         FormListener formListener = new FormListener();
 
@@ -1873,6 +1878,10 @@
 
         
attachLogCheckBox.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
         org.openide.awt.Mnemonics.setLocalizedText(attachLogCheckBox, 
org.openide.util.NbBundle.getMessage(IssuePanel.class, 
"IssuePanel.attachLogCheckBox.text")); // NOI18N
+        attachLogCheckBox.addActionListener(formListener);
+
+        org.openide.awt.Mnemonics.setLocalizedText(viewLogButton, 
org.openide.util.NbBundle.getMessage(IssuePanel.class, 
"IssuePanel.viewLogButton.text")); // NOI18N
+        viewLogButton.addActionListener(formListener);
 
         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
         this.setLayout(layout);
@@ -1929,8 +1938,8 @@
                                 .addComponent(summaryField)
                                 
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                 .addComponent(summaryWarning, 
javax.swing.GroupLayout.PREFERRED_SIZE, 16, 
javax.swing.GroupLayout.PREFERRED_SIZE))
+                            .addComponent(customFieldsPanelRight, 
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
Short.MAX_VALUE)
                             .addComponent(messagePanel, 
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
Short.MAX_VALUE)
-                            .addComponent(customFieldsPanelRight, 
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
Short.MAX_VALUE)
                             .addGroup(layout.createSequentialGroup()
                                 
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                     .addGroup(layout.createSequentialGroup()
@@ -2026,8 +2035,11 @@
                                     .addGroup(layout.createSequentialGroup()
                                         .addComponent(submitButton)
                                         
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                                        .addComponent(cancelButton))
-                                    .addComponent(attachLogCheckBox))
+                                        .addComponent(cancelButton)
+                                        
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                                        .addComponent(attachLogCheckBox)
+                                        
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                                        .addComponent(viewLogButton, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE)))
                                 .addGap(0, 0, Short.MAX_VALUE)))))
                 .addGap(24, 24, 24))
         );
@@ -2147,16 +2159,13 @@
                         
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                         .addComponent(dummyTimetrackingLabel))
                     .addComponent(dummyTimetrackingPanel, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE))
-                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                     .addGroup(layout.createSequentialGroup()
                         .addComponent(attachmentsLabel)
                         
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                         .addComponent(dummyLabel3))
-                    .addGroup(layout.createSequentialGroup()
-                        .addComponent(dummyAttachmentsPanel, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE)
-                        
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                        .addComponent(attachLogCheckBox)))
+                    .addComponent(dummyAttachmentsPanel, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE))
                 
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                     .addComponent(customFieldsPanelRight, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE)
@@ -2171,15 +2180,21 @@
                     .addComponent(addCommentLabel)
                     .addComponent(scrollPane1, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE))
                 
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(2, 2, 2)
+                        
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                            .addComponent(viewLogButton, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE)
+                            .addComponent(attachLogCheckBox)))
                 
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                     .addComponent(submitButton)
-                    .addComponent(cancelButton))
-                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
-                .addComponent(messagePanel, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE)
-                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+                        .addComponent(cancelButton)))
+                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(messagePanel, 
javax.swing.GroupLayout.DEFAULT_SIZE, 2, Short.MAX_VALUE)
+                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addComponent(separator, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE)
                 
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(dummyCommentsPanel, 
javax.swing.GroupLayout.DEFAULT_SIZE, 24, Short.MAX_VALUE))
+                .addComponent(dummyCommentsPanel, 
javax.swing.GroupLayout.DEFAULT_SIZE, 38, Short.MAX_VALUE))
         );
 
         layout.linkSize(javax.swing.SwingConstants.VERTICAL, new 
java.awt.Component[] {refreshButton, reloadButton, separatorLabel, 
separatorLabel2, separatorLabel3, showInBrowserButton});
@@ -2280,15 +2295,21 @@
             else if (evt.getSource() == submitButton) {
                 IssuePanel.this.submitButtonActionPerformed(evt);
             }
+            else if (evt.getSource() == resolutionCombo) {
+                IssuePanel.this.resolutionComboActionPerformed(evt);
+            }
+            else if (evt.getSource() == assignedCombo) {
+                IssuePanel.this.assignedComboActionPerformed(evt);
+            }
+            else if (evt.getSource() == attachLogCheckBox) {
+                IssuePanel.this.attachLogCheckBoxActionPerformed(evt);
+            }
+            else if (evt.getSource() == viewLogButton) {
+                IssuePanel.this.viewLogButtonActionPerformed(evt);
+            }
             else if (evt.getSource() == cancelButton) {
                 IssuePanel.this.cancelButtonActionPerformed(evt);
             }
-            else if (evt.getSource() == resolutionCombo) {
-                IssuePanel.this.resolutionComboActionPerformed(evt);
-            }
-            else if (evt.getSource() == assignedCombo) {
-                IssuePanel.this.assignedComboActionPerformed(evt);
-            }
         }
 
         public void focusGained(java.awt.event.FocusEvent evt) {
@@ -2409,10 +2430,6 @@
         resolutionLabel.setLabelFor(resolutionCombo.isVisible() ? 
resolutionCombo : resolutionField);
     }//GEN-LAST:event_statusComboActionPerformed
 
-    private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) 
{//GEN-FIRST:event_cancelButtonActionPerformed
-        reloadForm(true);
-    }//GEN-LAST:event_cancelButtonActionPerformed
-
     private void submitButtonActionPerformed(java.awt.event.ActionEvent evt) 
{//GEN-FIRST:event_submitButtonActionPerformed
         final boolean isNew = issue.getTaskData().isNew();
         if (isNew) {
@@ -2861,6 +2878,18 @@
     }
 }//GEN-LAST:event_workedFieldFocusLost
 
+    private void attachLogCheckBoxActionPerformed(java.awt.event.ActionEvent 
evt) {//GEN-FIRST:event_attachLogCheckBoxActionPerformed
+        switchViewLog();
+    }//GEN-LAST:event_attachLogCheckBoxActionPerformed
+
+    private void viewLogButtonActionPerformed(java.awt.event.ActionEvent 
evt) {//GEN-FIRST:event_viewLogButtonActionPerformed
+        showLogFile(evt);
+    }//GEN-LAST:event_viewLogButtonActionPerformed
+
+    private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) 
{//GEN-FIRST:event_cancelButtonActionPerformed
+        reloadForm(true);
+    }//GEN-LAST:event_cancelButtonActionPerformed
+
     // Variables declaration - do not modify//GEN-BEGIN:variables
     private javax.swing.JTextField actualField;
     private javax.swing.JLabel actualLabel;
@@ -2983,6 +3012,7 @@
     private javax.swing.JComboBox versionCombo;
     private javax.swing.JLabel versionLabel;
     private javax.swing.JLabel versionWarning;
+    private org.netbeans.modules.bugtracking.util.LinkButton viewLogButton;
     private javax.swing.JTextField workedField;
     private javax.swing.JLabel workedLabel;
     private javax.swing.JLabel workedSumField;
@@ -3145,6 +3175,17 @@
         }
     }
 
+    static void showLogFile(ActionEvent evt) {
+        Action a = 
FileUtil.getConfigObject("Actions/View/org-netbeans-core-actions-LogAction.instance",
 Action.class); // NOI18N
+        if(a != null) {
+            a.actionPerformed(evt);
+        }
+    }
+
+    private void switchViewLog() {
+        viewLogButton.setVisible(attachLogCheckBox.isSelected());
+    }
+
     class CancelHighlightDocumentListener implements DocumentListener {
         private JComponent label;
         

[hg] main-silver: Issue #227155 - Help | Report Issue .... : add...

Tomas Stupka 03/07/2013

Project Features

About this Project

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