This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 172599
Collapse All | Expand All

(-)a/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/wizards/Bundle.properties (+2 lines)
Lines 24-29 Link Here
24
LicenseApprovalPanel_tpLicense_Separator=_______________________________________\n
24
LicenseApprovalPanel_tpLicense_Separator=_______________________________________\n
25
LicenseApprovalPanel_Header_Head=License Agreement
25
LicenseApprovalPanel_Header_Head=License Agreement
26
LicenseApprovalPanel_Header_Content=Please read all of the following license agreements carefully.
26
LicenseApprovalPanel_Header_Content=Please read all of the following license agreements carefully.
27
LicenseApprovalPanel_tblPluginList_ColumnName_Name=Name
28
LicenseApprovalPanel_tblPluginList_ColumnName_Version=Version
27
InstallUnitWizard_Title=Plugin Installer
29
InstallUnitWizard_Title=Plugin Installer
28
InstallStep_Header_Download_Head=Download
30
InstallStep_Header_Download_Head=Download
29
InstallStep_Header_Download_Content=Please wait until the installer downloads the requested plugins.
31
InstallStep_Header_Download_Content=Please wait until the installer downloads the requested plugins.
(-)a/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/wizards/InstallUnitWizard.java (+3 lines)
Lines 43-48 Link Here
43
43
44
import org.netbeans.modules.autoupdate.ui.*;
44
import org.netbeans.modules.autoupdate.ui.*;
45
import java.awt.Dialog;
45
import java.awt.Dialog;
46
import java.awt.Dimension;
47
import java.awt.Image;
46
import java.text.MessageFormat;
48
import java.text.MessageFormat;
47
import java.util.Collection;
49
import java.util.Collection;
48
import java.util.logging.Level;
50
import java.util.logging.Level;
Lines 51-56 Link Here
51
import org.netbeans.modules.autoupdate.ui.wizards.OperationWizardModel.OperationType;
53
import org.netbeans.modules.autoupdate.ui.wizards.OperationWizardModel.OperationType;
52
import org.openide.DialogDisplayer;
54
import org.openide.DialogDisplayer;
53
import org.openide.WizardDescriptor;
55
import org.openide.WizardDescriptor;
56
import org.openide.util.ImageUtilities;
54
import org.openide.util.NbBundle;
57
import org.openide.util.NbBundle;
55
58
56
/**
59
/**
(-)a/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/wizards/LicenseApprovalPanel.form (-34 / +73 lines)
Lines 1-9 Link Here
1
<?xml version="1.0" encoding="UTF-8" ?>
1
<?xml version="1.0" encoding="UTF-8" ?>
2
2
3
<Form version="1.4" maxVersion="1.4" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.4" maxVersion="1.4" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <SyntheticProperties>
5
    <SyntheticProperty name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,-27,0,0,2,17"/>
6
  </SyntheticProperties>
4
  <AuxValues>
7
  <AuxValues>
5
    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
8
    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
6
    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
9
    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
10
    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
7
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
11
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
8
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
12
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
9
    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
13
    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
Lines 15-26 Link Here
15
  <Layout>
19
  <Layout>
16
    <DimensionLayout dim="0">
20
    <DimensionLayout dim="0">
17
      <Group type="103" groupAlignment="0" attributes="0">
21
      <Group type="103" groupAlignment="0" attributes="0">
18
          <Group type="102" attributes="0">
22
          <Group type="102" alignment="1" attributes="0">
19
              <EmptySpace max="-2" attributes="0"/>
23
              <EmptySpace max="-2" attributes="0"/>
20
              <Group type="103" groupAlignment="0" attributes="0">
24
              <Group type="103" groupAlignment="1" attributes="0">
25
                  <Component id="spPanel" alignment="0" pref="509" max="32767" attributes="0"/>
21
                  <Component id="cbAccept" alignment="0" min="-2" max="-2" attributes="0"/>
26
                  <Component id="cbAccept" alignment="0" min="-2" max="-2" attributes="0"/>
22
                  <Component id="taTitle" alignment="1" pref="461" max="32767" attributes="1"/>
27
                  <Component id="taTitle" alignment="1" max="32767" attributes="1"/>
23
                  <Component id="spLicenses" alignment="0" pref="461" max="32767" attributes="1"/>
24
              </Group>
28
              </Group>
25
              <EmptySpace max="-2" attributes="0"/>
29
              <EmptySpace max="-2" attributes="0"/>
26
          </Group>
30
          </Group>
Lines 31-37 Link Here
31
          <Group type="102" attributes="0">
35
          <Group type="102" attributes="0">
32
              <Component id="taTitle" min="-2" pref="45" max="-2" attributes="0"/>
36
              <Component id="taTitle" min="-2" pref="45" max="-2" attributes="0"/>
33
              <EmptySpace max="-2" attributes="0"/>
37
              <EmptySpace max="-2" attributes="0"/>
34
              <Component id="spLicenses" max="32767" attributes="0"/>
38
              <Component id="spPanel" pref="147" max="32767" attributes="0"/>
35
              <EmptySpace max="-2" attributes="0"/>
39
              <EmptySpace max="-2" attributes="0"/>
36
              <Component id="cbAccept" min="-2" max="-2" attributes="0"/>
40
              <Component id="cbAccept" min="-2" max="-2" attributes="0"/>
37
              <EmptySpace min="-2" max="-2" attributes="0"/>
41
              <EmptySpace min="-2" max="-2" attributes="0"/>
Lines 54-88 Link Here
54
        <Property name="opaque" type="boolean" value="false"/>
58
        <Property name="opaque" type="boolean" value="false"/>
55
      </Properties>
59
      </Properties>
56
    </Component>
60
    </Component>
57
    <Container class="javax.swing.JScrollPane" name="spLicenses">
58
      <AuxValues>
59
        <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
60
      </AuxValues>
61
62
      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
63
      <SubComponents>
64
        <Component class="javax.swing.JTextArea" name="taLicenses">
65
          <Properties>
66
            <Property name="columns" type="int" value="20"/>
67
            <Property name="editable" type="boolean" value="false"/>
68
            <Property name="lineWrap" type="boolean" value="true"/>
69
            <Property name="rows" type="int" value="5"/>
70
            <Property name="wrapStyleWord" type="boolean" value="true"/>
71
            <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
72
              <Insets value="[0, 4, 0, 4]"/>
73
            </Property>
74
          </Properties>
75
          <AccessibilityProperties>
76
            <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
77
              <ResourceString bundle="org/netbeans/modules/autoupdate/ui/wizards/Bundle.properties" key="LicenseApprovalPanel_taLicenses_ACN" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
78
            </Property>
79
            <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
80
              <ResourceString bundle="org/netbeans/modules/autoupdate/ui/wizards/Bundle.properties" key="LicenseApprovalPanel_taLicenses_ACD" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
81
            </Property>
82
          </AccessibilityProperties>
83
        </Component>
84
      </SubComponents>
85
    </Container>
86
    <Component class="javax.swing.JCheckBox" name="cbAccept">
61
    <Component class="javax.swing.JCheckBox" name="cbAccept">
87
      <Properties>
62
      <Properties>
88
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
63
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
Lines 98-102 Link Here
98
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cbAcceptActionPerformed"/>
73
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cbAcceptActionPerformed"/>
99
      </Events>
74
      </Events>
100
    </Component>
75
    </Component>
76
    <Container class="javax.swing.JSplitPane" name="spPanel">
77
      <Properties>
78
        <Property name="dividerLocation" type="int" value="250"/>
79
      </Properties>
80
81
      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
82
      <SubComponents>
83
        <Container class="javax.swing.JScrollPane" name="spLicense">
84
          <AuxValues>
85
            <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
86
          </AuxValues>
87
          <Constraints>
88
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
89
              <JSplitPaneConstraints position="right"/>
90
            </Constraint>
91
          </Constraints>
92
93
          <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
94
          <SubComponents>
95
            <Component class="javax.swing.JTextArea" name="taLicenses">
96
              <Properties>
97
                <Property name="columns" type="int" value="20"/>
98
                <Property name="editable" type="boolean" value="false"/>
99
                <Property name="lineWrap" type="boolean" value="true"/>
100
                <Property name="rows" type="int" value="5"/>
101
                <Property name="wrapStyleWord" type="boolean" value="true"/>
102
                <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
103
                  <Insets value="[0, 4, 0, 4]"/>
104
                </Property>
105
              </Properties>
106
              <AccessibilityProperties>
107
                <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
108
                  <ResourceString bundle="org/netbeans/modules/autoupdate/ui/wizards/Bundle.properties" key="LicenseApprovalPanel_taLicenses_ACN" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
109
                </Property>
110
                <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
111
                  <ResourceString bundle="org/netbeans/modules/autoupdate/ui/wizards/Bundle.properties" key="LicenseApprovalPanel_taLicenses_ACD" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
112
                </Property>
113
              </AccessibilityProperties>
114
            </Component>
115
          </SubComponents>
116
        </Container>
117
        <Container class="javax.swing.JScrollPane" name="spPluginInfo">
118
          <AuxValues>
119
            <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
120
          </AuxValues>
121
          <Constraints>
122
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
123
              <JSplitPaneConstraints position="left"/>
124
            </Constraint>
125
          </Constraints>
126
127
          <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
128
          <SubComponents>
129
            <Component class="javax.swing.JTable" name="tblPluginList">
130
              <Properties>
131
                <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
132
                  <Table columnCount="0" rowCount="0"/>
133
                </Property>
134
              </Properties>
135
            </Component>
136
          </SubComponents>
137
        </Container>
138
      </SubComponents>
139
    </Container>
101
  </SubComponents>
140
  </SubComponents>
102
</Form>
141
</Form>
(-)a/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/wizards/LicenseApprovalPanel.java (-52 / +123 lines)
Lines 41-52 Link Here
41
41
42
package org.netbeans.modules.autoupdate.ui.wizards;
42
package org.netbeans.modules.autoupdate.ui.wizards;
43
43
44
import java.awt.event.ActionEvent;
45
import java.util.ArrayList;
44
import java.util.Collection;
46
import java.util.Collection;
45
import java.util.Collections;
47
import java.util.Collections;
46
import java.util.HashMap;
47
import java.util.HashSet;
48
import java.util.HashSet;
48
import java.util.Map;
49
import java.util.List;
49
import java.util.Set;
50
import java.util.Set;
51
import javax.swing.ListSelectionModel;
52
import javax.swing.event.ListSelectionEvent;
53
import javax.swing.event.ListSelectionListener;
54
import javax.swing.table.AbstractTableModel;
50
import org.netbeans.api.autoupdate.UpdateElement;
55
import org.netbeans.api.autoupdate.UpdateElement;
51
import org.openide.util.NbBundle;
56
import org.openide.util.NbBundle;
52
57
Lines 56-62 Link Here
56
 */
61
 */
57
public class LicenseApprovalPanel extends javax.swing.JPanel {
62
public class LicenseApprovalPanel extends javax.swing.JPanel {
58
    public static final String LICENSE_APPROVED = "license-approved";
63
    public static final String LICENSE_APPROVED = "license-approved";
59
    private Map<String, Set<String>> license4plugins;
64
    private List<UpdateElement> license4plugins;
60
    
65
    
61
    /** Creates new form LicenseApprovalPanel */
66
    /** Creates new form LicenseApprovalPanel */
62
    public LicenseApprovalPanel (InstallUnitWizardModel model, boolean isApproved) {
67
    public LicenseApprovalPanel (InstallUnitWizardModel model, boolean isApproved) {
Lines 75-99 Link Here
75
        if (license4plugins == null && license4plugins.isEmpty ()) {
80
        if (license4plugins == null && license4plugins.isEmpty ()) {
76
            return Collections.emptyList ();
81
            return Collections.emptyList ();
77
        }
82
        }
78
        return license4plugins.keySet ();
83
		Set<String> licenses = new HashSet<String>();
84
		for (UpdateElement el : license4plugins) {
85
			licenses.add(el.getLicence());
86
		}
87
		return licenses;
79
    }
88
    }
80
    
89
    
81
    private void goOverLicenses (InstallUnitWizardModel model) {
90
    private void goOverLicenses (InstallUnitWizardModel model) {
82
        for (UpdateElement el : model.getAllUpdateElements ()) {
91
        for (UpdateElement el : model.getAllUpdateElements ()) {
83
            if (el.getLicence () != null) {
92
            if (el.getLicence() != null) {
84
                if (license4plugins == null) {
93
                if (license4plugins == null) {
85
                    license4plugins = new HashMap<String, Set<String>> ();
94
                    license4plugins = new ArrayList<UpdateElement> ();
86
                }
95
                }
87
                if (license4plugins.containsKey (el.getLicence ())) {
96
				
88
                    // add plugin
97
				license4plugins.add(el);
89
                    license4plugins.get (el.getLicence ()).add (el.getDisplayName ());
90
                } else {
91
                    // license
92
                    Set<String> plugins = new HashSet<String> ();
93
                    plugins.add (el.getDisplayName ());
94
                    license4plugins.put (el.getLicence (), plugins);
95
                }
96
                //licenses.put (el.getDisplayName (), el.getLicence ());
97
            }
98
            }
98
        }
99
        }
99
    }
100
    }
Lines 111-119 Link Here
111
    private void initComponents() {
112
    private void initComponents() {
112
113
113
        taTitle = new javax.swing.JTextArea();
114
        taTitle = new javax.swing.JTextArea();
114
        spLicenses = new javax.swing.JScrollPane();
115
        cbAccept = new javax.swing.JCheckBox();
116
        spPanel = new javax.swing.JSplitPane();
117
        spLicense = new javax.swing.JScrollPane();
115
        taLicenses = new javax.swing.JTextArea();
118
        taLicenses = new javax.swing.JTextArea();
116
        cbAccept = new javax.swing.JCheckBox();
119
        spPluginInfo = new javax.swing.JScrollPane();
120
        tblPluginList = new javax.swing.JTable();
117
121
118
        taTitle.setEditable(false);
122
        taTitle.setEditable(false);
119
        taTitle.setLineWrap(true);
123
        taTitle.setLineWrap(true);
Lines 122-137 Link Here
122
        taTitle.setMargin(new java.awt.Insets(0, 4, 0, 0));
126
        taTitle.setMargin(new java.awt.Insets(0, 4, 0, 0));
123
        taTitle.setOpaque(false);
127
        taTitle.setOpaque(false);
124
128
125
        taLicenses.setColumns(20);
126
        taLicenses.setEditable(false);
127
        taLicenses.setLineWrap(true);
128
        taLicenses.setRows(5);
129
        taLicenses.setWrapStyleWord(true);
130
        taLicenses.setMargin(new java.awt.Insets(0, 4, 0, 4));
131
        spLicenses.setViewportView(taLicenses);
132
        taLicenses.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(LicenseApprovalPanel.class, "LicenseApprovalPanel_taLicenses_ACN")); // NOI18N
133
        taLicenses.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(LicenseApprovalPanel.class, "LicenseApprovalPanel_taLicenses_ACD")); // NOI18N
134
135
        org.openide.awt.Mnemonics.setLocalizedText(cbAccept, org.openide.util.NbBundle.getMessage(LicenseApprovalPanel.class, "LicenseApprovalPanel.cbAccept.text")); // NOI18N
129
        org.openide.awt.Mnemonics.setLocalizedText(cbAccept, org.openide.util.NbBundle.getMessage(LicenseApprovalPanel.class, "LicenseApprovalPanel.cbAccept.text")); // NOI18N
136
        cbAccept.addActionListener(new java.awt.event.ActionListener() {
130
        cbAccept.addActionListener(new java.awt.event.ActionListener() {
137
            public void actionPerformed(java.awt.event.ActionEvent evt) {
131
            public void actionPerformed(java.awt.event.ActionEvent evt) {
Lines 139-154 Link Here
139
            }
133
            }
140
        });
134
        });
141
135
136
        spPanel.setDividerLocation(250);
137
138
        taLicenses.setColumns(20);
139
        taLicenses.setEditable(false);
140
        taLicenses.setLineWrap(true);
141
        taLicenses.setRows(5);
142
        taLicenses.setWrapStyleWord(true);
143
        taLicenses.setMargin(new java.awt.Insets(0, 4, 0, 4));
144
        spLicense.setViewportView(taLicenses);
145
        taLicenses.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(LicenseApprovalPanel.class, "LicenseApprovalPanel_taLicenses_ACN")); // NOI18N
146
        taLicenses.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(LicenseApprovalPanel.class, "LicenseApprovalPanel_taLicenses_ACD")); // NOI18N
147
148
        spPanel.setRightComponent(spLicense);
149
150
        tblPluginList.setModel(new javax.swing.table.DefaultTableModel(
151
            new Object [][] {
152
153
            },
154
            new String [] {
155
156
            }
157
        ));
158
        spPluginInfo.setViewportView(tblPluginList);
159
160
        spPanel.setLeftComponent(spPluginInfo);
161
142
        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
162
        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
143
        this.setLayout(layout);
163
        this.setLayout(layout);
144
        layout.setHorizontalGroup(
164
        layout.setHorizontalGroup(
145
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
165
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
146
            .add(layout.createSequentialGroup()
166
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
147
                .addContainerGap()
167
                .addContainerGap()
148
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
168
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
149
                    .add(cbAccept)
169
                    .add(org.jdesktop.layout.GroupLayout.LEADING, spPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 509, Short.MAX_VALUE)
150
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, taTitle, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 461, Short.MAX_VALUE)
170
                    .add(org.jdesktop.layout.GroupLayout.LEADING, cbAccept)
151
                    .add(spLicenses, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 461, Short.MAX_VALUE))
171
                    .add(taTitle))
152
                .addContainerGap())
172
                .addContainerGap())
153
        );
173
        );
154
        layout.setVerticalGroup(
174
        layout.setVerticalGroup(
Lines 156-162 Link Here
156
            .add(layout.createSequentialGroup()
176
            .add(layout.createSequentialGroup()
157
                .add(taTitle, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
177
                .add(taTitle, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
158
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
178
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
159
                .add(spLicenses)
179
                .add(spPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 147, Short.MAX_VALUE)
160
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
180
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
161
                .add(cbAccept)
181
                .add(cbAccept)
162
                .addContainerGap())
182
                .addContainerGap())
Lines 165-197 Link Here
165
        cbAccept.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(LicenseApprovalPanel.class, "LicenseApprovalPanel_cbAccept_ACN")); // NOI18N
185
        cbAccept.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(LicenseApprovalPanel.class, "LicenseApprovalPanel_cbAccept_ACN")); // NOI18N
166
    }// </editor-fold>//GEN-END:initComponents
186
    }// </editor-fold>//GEN-END:initComponents
167
187
168
    private void cbAcceptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbAcceptActionPerformed
188
    private void cbAcceptActionPerformed(ActionEvent evt) {//GEN-FIRST:event_cbAcceptActionPerformed
169
        firePropertyChange (LICENSE_APPROVED, null, cbAccept.isSelected ());
189
        firePropertyChange (LICENSE_APPROVED, null, cbAccept.isSelected ());
170
    }//GEN-LAST:event_cbAcceptActionPerformed
190
    }//GEN-LAST:event_cbAcceptActionPerformed
171
    
191
        
172
    
173
    // Variables declaration - do not modify//GEN-BEGIN:variables
192
    // Variables declaration - do not modify//GEN-BEGIN:variables
174
    private javax.swing.JCheckBox cbAccept;
193
    private javax.swing.JCheckBox cbAccept;
175
    private javax.swing.JScrollPane spLicenses;
194
    private javax.swing.JScrollPane spLicense;
195
    private javax.swing.JSplitPane spPanel;
196
    private javax.swing.JScrollPane spPluginInfo;
176
    private javax.swing.JTextArea taLicenses;
197
    private javax.swing.JTextArea taLicenses;
177
    private javax.swing.JTextArea taTitle;
198
    private javax.swing.JTextArea taTitle;
199
    private javax.swing.JTable tblPluginList;
178
    // End of variables declaration//GEN-END:variables
200
    // End of variables declaration//GEN-END:variables
179
    
201
    
180
    private void writeLicenses (InstallUnitWizardModel model) {
202
    private void writeLicenses (InstallUnitWizardModel model) {
181
        goOverLicenses (model);
203
        goOverLicenses (model);
182
        StringBuffer content = new StringBuffer ();
204
		tblPluginList.setModel(new AbstractTableModel() {
183
        for (String lic : license4plugins.keySet ()) {
205
184
            StringBuffer title = new StringBuffer ();
206
			private String[] COLUMN_NAME_PROPERTIES = {
185
            for (String plugin : license4plugins.get (lic)) {
207
				"LicenseApprovalPanel_tblPluginList_ColumnName_Name", // NOI18N
186
                title.append ((title.length () == 0 ? "" :
208
				"LicenseApprovalPanel_tblPluginList_ColumnName_Version" // NOI18N
187
                    NbBundle.getMessage (LicenseApprovalPanel.class, "LicenseApprovalPanel_tpLicense_Delimeter")) + plugin); // NOI18N
209
			};
188
            }
210
189
            content.append (NbBundle.getMessage (LicenseApprovalPanel.class, "LicenseApprovalPanel_tpLicense_Head", title)); // NOI18N
211
			@Override
190
            content.append ("\n"); // NOI18N
212
			public Class<?> getColumnClass(int columnIndex) {
191
            content.append (lic);
213
				return String.class;
192
            content.append (NbBundle.getMessage (LicenseApprovalPanel.class, "LicenseApprovalPanel_tpLicense_Separator")); // NOI18N
214
			}
193
        }
215
194
        taLicenses.setText (content.toString ());
216
			@Override
195
        taLicenses.setCaretPosition (0);
217
			public String getColumnName(int column) {
218
				return NbBundle.getMessage(LicenseApprovalPanel.class,
219
						COLUMN_NAME_PROPERTIES[column]);
220
			}
221
222
			public int getRowCount() {
223
				return license4plugins.size();
224
			}
225
226
			public int getColumnCount() {
227
				return COLUMN_NAME_PROPERTIES.length;
228
			}
229
230
		    public Object getValueAt(int rowIndex, int columnIndex) {
231
				UpdateElement el = license4plugins.get(rowIndex);
232
				switch(columnIndex) {
233
					case 0:
234
						return el.getDisplayName();
235
236
					case 1:
237
						return el.getSpecificationVersion();
238
239
					default:
240
						return "";
241
				}
242
			}
243
244
		});
245
246
		ListSelectionModel selectionModel = tblPluginList.getSelectionModel();
247
		selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
248
		selectionModel.addListSelectionListener(new ListSelectionListener() {
249
250
			public void valueChanged(ListSelectionEvent e) {
251
				if (!e.getValueIsAdjusting()) {
252
					String license = getLicense4Plugin(tblPluginList.getSelectedRow());
253
					taLicenses.setText(license);
254
					taLicenses.setCaretPosition(0);
255
				}
256
			}
257
			
258
		});
259
		
260
		selectionModel.addSelectionInterval(0, 0);
196
    }
261
    }
262
263
	private String getLicense4Plugin(int selectedIndex) {
264
		UpdateElement el = license4plugins.get(selectedIndex);
265
		return el.getLicence();
266
	}
267
197
}
268
}

Return to bug 172599