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

Return to bug 172599