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_cbPlugins_ItemFormat={0} [{1}]
27
InstallUnitWizard_Title=Plugin Installer
28
InstallUnitWizard_Title=Plugin Installer
28
InstallStep_Header_Download_Head=Download
29
InstallStep_Header_Download_Head=Download
29
InstallStep_Header_Download_Content=Please wait until the installer downloads the requested plugins.
30
InstallStep_Header_Download_Content=Please wait until the installer downloads the requested plugins.
Lines 181-183 Link Here
181
OperationDescriptionStep_AffectedPlugin=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{0}<br>
182
OperationDescriptionStep_AffectedPlugin=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{0}<br>
182
InstallStep_DownloadProblem=There were some problems while storing {0}.\nCause: {1}
183
InstallStep_DownloadProblem=There were some problems while storing {0}.\nCause: {1}
183
InstallStep_DownloadProblem_SomePlugins=selected plugins
184
InstallStep_DownloadProblem_SomePlugins=selected plugins
185
LicenseApprovalPanel.lbPlugins.text=Plugins:
(-)a/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/wizards/LicenseApprovalPanel.form (-21 / +58 lines)
Lines 1-4 Link Here
1
<?xml version="1.0" encoding="UTF-8" ?>
1
<?xml version="1.1" 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
  <AuxValues>
4
  <AuxValues>
Lines 16-29 Link Here
16
  <Layout>
16
  <Layout>
17
    <DimensionLayout dim="0">
17
    <DimensionLayout dim="0">
18
      <Group type="103" groupAlignment="0" attributes="0">
18
      <Group type="103" groupAlignment="0" attributes="0">
19
          <Group type="102" attributes="0">
19
          <Group type="102" alignment="0" attributes="0">
20
              <EmptySpace max="-2" attributes="0"/>
20
              <EmptySpace min="-2" max="-2" attributes="0"/>
21
              <Group type="103" groupAlignment="0" attributes="0">
21
              <Group type="103" groupAlignment="0" attributes="0">
22
                  <Component id="cbAccept" alignment="0" min="-2" max="-2" attributes="0"/>
22
                  <Component id="taTitle" alignment="0" max="32767" attributes="2"/>
23
                  <Component id="taTitle" alignment="1" pref="461" max="32767" attributes="1"/>
23
                  <Group type="102" alignment="1" attributes="0">
24
                  <Component id="spLicenses" alignment="0" pref="461" max="32767" attributes="1"/>
24
                      <Group type="103" groupAlignment="1" attributes="0">
25
                          <Group type="102" alignment="1" attributes="0">
26
                              <Component id="lbPlugins" min="-2" pref="81" max="-2" attributes="0"/>
27
                              <EmptySpace max="-2" attributes="0"/>
28
                              <Component id="cbPlugins" pref="405" max="32767" attributes="0"/>
29
                          </Group>
30
                          <Component id="cbAccept" alignment="0" min="-2" max="-2" attributes="0"/>
31
                      </Group>
32
                      <EmptySpace min="-2" pref="48" max="-2" attributes="0"/>
33
                  </Group>
34
                  <Group type="102" alignment="1" attributes="0">
35
                      <Component id="spLicense" pref="519" max="32767" attributes="0"/>
36
                      <EmptySpace min="-2" max="-2" attributes="0"/>
37
                  </Group>
25
              </Group>
38
              </Group>
26
              <EmptySpace max="-2" attributes="0"/>
27
          </Group>
39
          </Group>
28
      </Group>
40
      </Group>
29
    </DimensionLayout>
41
    </DimensionLayout>
Lines 32-39 Link Here
32
          <Group type="102" attributes="0">
44
          <Group type="102" attributes="0">
33
              <Component id="taTitle" min="-2" pref="45" max="-2" attributes="0"/>
45
              <Component id="taTitle" min="-2" pref="45" max="-2" attributes="0"/>
34
              <EmptySpace max="-2" attributes="0"/>
46
              <EmptySpace max="-2" attributes="0"/>
35
              <Component id="spLicenses" max="32767" attributes="0"/>
47
              <Group type="103" groupAlignment="3" attributes="0">
36
              <EmptySpace max="-2" attributes="0"/>
48
                  <Component id="cbPlugins" alignment="3" min="-2" max="-2" attributes="0"/>
49
                  <Component id="lbPlugins" alignment="3" min="-2" max="-2" attributes="0"/>
50
              </Group>
51
              <EmptySpace min="-2" max="-2" attributes="0"/>
52
              <Component id="spLicense" pref="127" max="32767" attributes="0"/>
53
              <EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
37
              <Component id="cbAccept" min="-2" max="-2" attributes="0"/>
54
              <Component id="cbAccept" min="-2" max="-2" attributes="0"/>
38
              <EmptySpace min="-2" max="-2" attributes="0"/>
55
              <EmptySpace min="-2" max="-2" attributes="0"/>
39
          </Group>
56
          </Group>
Lines 55-68 Link Here
55
        <Property name="opaque" type="boolean" value="false"/>
72
        <Property name="opaque" type="boolean" value="false"/>
56
      </Properties>
73
      </Properties>
57
    </Component>
74
    </Component>
58
    <Container class="javax.swing.JScrollPane" name="spLicenses">
75
    <Component class="javax.swing.JCheckBox" name="cbAccept">
76
      <Properties>
77
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
78
          <ResourceString bundle="org/netbeans/modules/autoupdate/ui/wizards/Bundle.properties" key="LicenseApprovalPanel.cbAccept.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
79
        </Property>
80
      </Properties>
81
      <AccessibilityProperties>
82
        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
83
          <ResourceString bundle="org/netbeans/modules/autoupdate/ui/wizards/Bundle.properties" key="LicenseApprovalPanel_cbAccept_ACN" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
84
        </Property>
85
      </AccessibilityProperties>
86
      <Events>
87
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cbAcceptActionPerformed"/>
88
      </Events>
89
    </Component>
90
    <Component class="javax.swing.JComboBox" name="cbPlugins">
91
      <Properties>
92
        <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
93
          <StringArray count="0"/>
94
        </Property>
95
      </Properties>
96
      <Events>
97
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cbPluginsActionPerformed"/>
98
      </Events>
99
    </Component>
100
    <Container class="javax.swing.JScrollPane" name="spLicense">
59
      <AuxValues>
101
      <AuxValues>
60
        <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
102
        <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
61
      </AuxValues>
103
      </AuxValues>
62
104
63
      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
105
      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
64
      <SubComponents>
106
      <SubComponents>
65
        <Component class="javax.swing.JTextArea" name="taLicenses">
107
        <Component class="javax.swing.JTextArea" name="taLicense">
66
          <Properties>
108
          <Properties>
67
            <Property name="columns" type="int" value="20"/>
109
            <Property name="columns" type="int" value="20"/>
68
            <Property name="editable" type="boolean" value="false"/>
110
            <Property name="editable" type="boolean" value="false"/>
Lines 84-103 Link Here
84
        </Component>
126
        </Component>
85
      </SubComponents>
127
      </SubComponents>
86
    </Container>
128
    </Container>
87
    <Component class="javax.swing.JCheckBox" name="cbAccept">
129
    <Component class="javax.swing.JLabel" name="lbPlugins">
88
      <Properties>
130
      <Properties>
131
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
132
          <ComponentRef name="cbPlugins"/>
133
        </Property>
89
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
134
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
90
          <ResourceString bundle="org/netbeans/modules/autoupdate/ui/wizards/Bundle.properties" key="LicenseApprovalPanel.cbAccept.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
135
          <ResourceString bundle="org/netbeans/modules/autoupdate/ui/wizards/Bundle.properties" key="LicenseApprovalPanel.lbPlugins.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
91
        </Property>
136
        </Property>
92
      </Properties>
137
      </Properties>
93
      <AccessibilityProperties>
94
        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
95
          <ResourceString bundle="org/netbeans/modules/autoupdate/ui/wizards/Bundle.properties" key="LicenseApprovalPanel_cbAccept_ACN" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
96
        </Property>
97
      </AccessibilityProperties>
98
      <Events>
99
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cbAcceptActionPerformed"/>
100
      </Events>
101
    </Component>
138
    </Component>
102
  </SubComponents>
139
  </SubComponents>
103
</Form>
140
</Form>
(-)a/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/wizards/LicenseApprovalPanel.java (-58 / +101 lines)
Lines 44-57 Link Here
44
44
45
package org.netbeans.modules.autoupdate.ui.wizards;
45
package org.netbeans.modules.autoupdate.ui.wizards;
46
46
47
import java.awt.event.ActionEvent;
48
import java.text.MessageFormat;
49
import java.util.ArrayList;
47
import java.util.Collection;
50
import java.util.Collection;
48
import java.util.Collections;
51
import java.util.Collections;
49
import java.util.HashMap;
50
import java.util.HashSet;
52
import java.util.HashSet;
51
import java.util.Map;
53
import java.util.List;
52
import java.util.Set;
54
import java.util.Set;
55
import javax.swing.DefaultComboBoxModel;
56
import javax.swing.SwingUtilities;
53
import org.netbeans.api.autoupdate.UpdateElement;
57
import org.netbeans.api.autoupdate.UpdateElement;
54
import org.openide.util.NbBundle;
58
import org.openide.util.NbBundle;
59
import org.openide.util.RequestProcessor;
55
60
56
/**
61
/**
57
 *
62
 *
Lines 59-65 Link Here
59
 */
64
 */
60
public class LicenseApprovalPanel extends javax.swing.JPanel {
65
public class LicenseApprovalPanel extends javax.swing.JPanel {
61
    public static final String LICENSE_APPROVED = "license-approved";
66
    public static final String LICENSE_APPROVED = "license-approved";
62
    private Map<String, Set<String>> license4plugins;
67
	private List<UpdateElement> license4plugins;
63
    
68
    
64
    /** Creates new form LicenseApprovalPanel */
69
    /** Creates new form LicenseApprovalPanel */
65
    public LicenseApprovalPanel (InstallUnitWizardModel model, boolean isApproved) {
70
    public LicenseApprovalPanel (InstallUnitWizardModel model, boolean isApproved) {
Lines 69-75 Link Here
69
            writeLicenses(model);
74
            writeLicenses(model);
70
        } else {
75
        } else {
71
            cbAccept.setEnabled (false);
76
            cbAccept.setEnabled (false);
72
            taLicenses.setEnabled (false);
77
            taLicense.setEnabled (false);
73
        }
78
        }
74
    }
79
    }
75
    
80
    
Lines 78-102 Link Here
78
        if (license4plugins == null && license4plugins.isEmpty ()) {
83
        if (license4plugins == null && license4plugins.isEmpty ()) {
79
            return Collections.emptyList ();
84
            return Collections.emptyList ();
80
        }
85
        }
81
        return license4plugins.keySet ();
86
		Set<String> licenses = new HashSet<String>();
82
    }
87
		for (UpdateElement el : license4plugins) {
83
    
88
			licenses.add(el.getLicence());
89
		}
90
		return licenses;
91
	}
92
84
    private void goOverLicenses (InstallUnitWizardModel model) {
93
    private void goOverLicenses (InstallUnitWizardModel model) {
85
        for (UpdateElement el : model.getAllUpdateElements ()) {
94
        for (UpdateElement el : model.getAllUpdateElements ()) {
86
            if (el.getLicence () != null) {
95
            if (el.getLicence () != null) {
87
                if (license4plugins == null) {
96
                if (license4plugins == null) {
88
                    license4plugins = new HashMap<String, Set<String>> ();
97
					license4plugins = new ArrayList<UpdateElement> ();
89
                }
98
                }
90
                if (license4plugins.containsKey (el.getLicence ())) {
99
91
                    // add plugin
100
				license4plugins.add(el);
92
                    license4plugins.get (el.getLicence ()).add (el.getDisplayName ());
93
                } else {
94
                    // license
95
                    Set<String> plugins = new HashSet<String> ();
96
                    plugins.add (el.getDisplayName ());
97
                    license4plugins.put (el.getLicence (), plugins);
98
                }
99
                //licenses.put (el.getDisplayName (), el.getLicence ());
100
            }
101
            }
101
        }
102
        }
102
    }
103
    }
Lines 114-122 Link Here
114
    private void initComponents() {
115
    private void initComponents() {
115
116
116
        taTitle = new javax.swing.JTextArea();
117
        taTitle = new javax.swing.JTextArea();
117
        spLicenses = new javax.swing.JScrollPane();
118
        taLicenses = new javax.swing.JTextArea();
119
        cbAccept = new javax.swing.JCheckBox();
118
        cbAccept = new javax.swing.JCheckBox();
119
        cbPlugins = new javax.swing.JComboBox();
120
        spLicense = new javax.swing.JScrollPane();
121
        taLicense = new javax.swing.JTextArea();
122
        lbPlugins = new javax.swing.JLabel();
120
123
121
        taTitle.setEditable(false);
124
        taTitle.setEditable(false);
122
        taTitle.setLineWrap(true);
125
        taTitle.setLineWrap(true);
Lines 125-140 Link Here
125
        taTitle.setMargin(new java.awt.Insets(0, 4, 0, 0));
128
        taTitle.setMargin(new java.awt.Insets(0, 4, 0, 0));
126
        taTitle.setOpaque(false);
129
        taTitle.setOpaque(false);
127
130
128
        taLicenses.setColumns(20);
129
        taLicenses.setEditable(false);
130
        taLicenses.setLineWrap(true);
131
        taLicenses.setRows(5);
132
        taLicenses.setWrapStyleWord(true);
133
        taLicenses.setMargin(new java.awt.Insets(0, 4, 0, 4));
134
        spLicenses.setViewportView(taLicenses);
135
        taLicenses.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(LicenseApprovalPanel.class, "LicenseApprovalPanel_taLicenses_ACN")); // NOI18N
136
        taLicenses.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(LicenseApprovalPanel.class, "LicenseApprovalPanel_taLicenses_ACD")); // NOI18N
137
138
        org.openide.awt.Mnemonics.setLocalizedText(cbAccept, org.openide.util.NbBundle.getMessage(LicenseApprovalPanel.class, "LicenseApprovalPanel.cbAccept.text")); // NOI18N
131
        org.openide.awt.Mnemonics.setLocalizedText(cbAccept, org.openide.util.NbBundle.getMessage(LicenseApprovalPanel.class, "LicenseApprovalPanel.cbAccept.text")); // NOI18N
139
        cbAccept.addActionListener(new java.awt.event.ActionListener() {
132
        cbAccept.addActionListener(new java.awt.event.ActionListener() {
140
            public void actionPerformed(java.awt.event.ActionEvent evt) {
133
            public void actionPerformed(java.awt.event.ActionEvent evt) {
Lines 142-147 Link Here
142
            }
135
            }
143
        });
136
        });
144
137
138
        cbPlugins.addActionListener(new java.awt.event.ActionListener() {
139
            public void actionPerformed(java.awt.event.ActionEvent evt) {
140
                cbPluginsActionPerformed(evt);
141
            }
142
        });
143
144
        taLicense.setColumns(20);
145
        taLicense.setEditable(false);
146
        taLicense.setLineWrap(true);
147
        taLicense.setRows(5);
148
        taLicense.setWrapStyleWord(true);
149
        taLicense.setMargin(new java.awt.Insets(0, 4, 0, 4));
150
        spLicense.setViewportView(taLicense);
151
        taLicense.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(LicenseApprovalPanel.class, "LicenseApprovalPanel_taLicenses_ACN")); // NOI18N
152
        taLicense.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(LicenseApprovalPanel.class, "LicenseApprovalPanel_taLicenses_ACD")); // NOI18N
153
154
        lbPlugins.setLabelFor(cbPlugins);
155
        org.openide.awt.Mnemonics.setLocalizedText(lbPlugins, org.openide.util.NbBundle.getMessage(LicenseApprovalPanel.class, "LicenseApprovalPanel.lbPlugins.text")); // NOI18N
156
145
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
157
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
146
        this.setLayout(layout);
158
        this.setLayout(layout);
147
        layout.setHorizontalGroup(
159
        layout.setHorizontalGroup(
Lines 149-166 Link Here
149
            .addGroup(layout.createSequentialGroup()
161
            .addGroup(layout.createSequentialGroup()
150
                .addContainerGap()
162
                .addContainerGap()
151
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
163
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
152
                    .addComponent(cbAccept)
164
                    .addComponent(taTitle)
153
                    .addComponent(taTitle, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 461, Short.MAX_VALUE)
165
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
154
                    .addComponent(spLicenses, javax.swing.GroupLayout.DEFAULT_SIZE, 461, Short.MAX_VALUE))
166
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
155
                .addContainerGap())
167
                            .addGroup(layout.createSequentialGroup()
168
                                .addComponent(lbPlugins, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
169
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
170
                                .addComponent(cbPlugins, 0, 405, Short.MAX_VALUE))
171
                            .addComponent(cbAccept, javax.swing.GroupLayout.Alignment.LEADING))
172
                        .addGap(48, 48, 48))
173
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
174
                        .addComponent(spLicense, javax.swing.GroupLayout.DEFAULT_SIZE, 519, Short.MAX_VALUE)
175
                        .addContainerGap())))
156
        );
176
        );
157
        layout.setVerticalGroup(
177
        layout.setVerticalGroup(
158
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
178
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
159
            .addGroup(layout.createSequentialGroup()
179
            .addGroup(layout.createSequentialGroup()
160
                .addComponent(taTitle, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
180
                .addComponent(taTitle, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
161
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
181
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
162
                .addComponent(spLicenses)
182
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
183
                    .addComponent(cbPlugins, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
184
                    .addComponent(lbPlugins))
163
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
185
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
186
                .addComponent(spLicense, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE)
187
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
164
                .addComponent(cbAccept)
188
                .addComponent(cbAccept)
165
                .addContainerGap())
189
                .addContainerGap())
166
        );
190
        );
Lines 168-200 Link Here
168
        cbAccept.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(LicenseApprovalPanel.class, "LicenseApprovalPanel_cbAccept_ACN")); // NOI18N
192
        cbAccept.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(LicenseApprovalPanel.class, "LicenseApprovalPanel_cbAccept_ACN")); // NOI18N
169
    }// </editor-fold>//GEN-END:initComponents
193
    }// </editor-fold>//GEN-END:initComponents
170
194
171
    private void cbAcceptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbAcceptActionPerformed
195
    private void cbAcceptActionPerformed(ActionEvent evt) {//GEN-FIRST:event_cbAcceptActionPerformed
172
        firePropertyChange (LICENSE_APPROVED, null, cbAccept.isSelected ());
196
        firePropertyChange (LICENSE_APPROVED, null, cbAccept.isSelected ());
173
    }//GEN-LAST:event_cbAcceptActionPerformed
197
    }//GEN-LAST:event_cbAcceptActionPerformed
174
    
198
175
    
199
	private void cbPluginsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbPluginsActionPerformed
200
		// This is designed on purpose to make the user feel that
201
		//  license do refresh when new plugin is selected
202
		taLicense.setText("");
203
		final int delay = 100;
204
		RequestProcessor.getDefault().post(new Runnable() {
205
206
			public void run() {
207
				SwingUtilities.invokeLater(new Runnable() {
208
209
					public void run() {
210
						UpdateElement el = license4plugins.get(cbPlugins.getSelectedIndex());
211
						taLicense.setText(el.getLicence());
212
						taLicense.setCaretPosition(0);
213
					}
214
				});
215
			}
216
		}, delay);
217
	}//GEN-LAST:event_cbPluginsActionPerformed
218
176
    // Variables declaration - do not modify//GEN-BEGIN:variables
219
    // Variables declaration - do not modify//GEN-BEGIN:variables
177
    private javax.swing.JCheckBox cbAccept;
220
    private javax.swing.JCheckBox cbAccept;
178
    private javax.swing.JScrollPane spLicenses;
221
    private javax.swing.JComboBox cbPlugins;
179
    private javax.swing.JTextArea taLicenses;
222
    private javax.swing.JLabel lbPlugins;
223
    private javax.swing.JScrollPane spLicense;
224
    private javax.swing.JTextArea taLicense;
180
    private javax.swing.JTextArea taTitle;
225
    private javax.swing.JTextArea taTitle;
181
    // End of variables declaration//GEN-END:variables
226
    // End of variables declaration//GEN-END:variables
182
    
227
183
    private void writeLicenses (InstallUnitWizardModel model) {
228
	private void writeLicenses(InstallUnitWizardModel model) {
184
        goOverLicenses (model);
229
		goOverLicenses(model);
185
        StringBuffer content = new StringBuffer ();
230
		List<String> pluginsModel = new ArrayList<String>();
186
        for (String lic : license4plugins.keySet ()) {
231
		String fmt = NbBundle.getMessage(LicenseApprovalPanel.class,
187
            StringBuffer title = new StringBuffer ();
232
				"LicenseApprovalPanel_cbPlugins_ItemFormat");
188
            for (String plugin : license4plugins.get (lic)) {
233
		for (UpdateElement el : license4plugins) {
189
                title.append ((title.length () == 0 ? "" :
234
			String formatted = MessageFormat.format(fmt,
190
                    NbBundle.getMessage (LicenseApprovalPanel.class, "LicenseApprovalPanel_tpLicense_Delimeter")) + plugin); // NOI18N
235
					new Object[]{el.getDisplayName(), el.getSpecificationVersion()});
191
            }
236
			pluginsModel.add(formatted);
192
            content.append (NbBundle.getMessage (LicenseApprovalPanel.class, "LicenseApprovalPanel_tpLicense_Head", title)); // NOI18N
237
		}
193
            content.append ("\n"); // NOI18N
238
194
            content.append (lic);
239
		cbPlugins.setModel(new DefaultComboBoxModel(pluginsModel.toArray()));
195
            content.append (NbBundle.getMessage (LicenseApprovalPanel.class, "LicenseApprovalPanel_tpLicense_Separator")); // NOI18N
240
		cbPlugins.setSelectedIndex(0);
196
        }
241
	}
197
        taLicenses.setText (content.toString ());
242
198
        taLicenses.setCaretPosition (0);
199
    }
200
}
243
}

Return to bug 172599