This is an automated email from the ASF dual-hosted git repository. matthiasblaesing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/netbeans.git
commit 03a4c48ef8db3684e3ed635a701bb67bb8a21a47 Author: Matthias Bläsing <[email protected]> AuthorDate: Tue Nov 5 18:53:06 2019 +0100 Expose modified/damaged Plugins in verification GUI UpdateItems, that failed validation, where not reported in the Plugin Manager GUI, but still blocked installation. This changeset adds a new node into the certificate validation dialog which lists the "Modified/Damaged" Plugins. This allows the user to see the plugins, which block installation. --- .../autoupdate/services/InstallSupportImpl.java | 10 ++- .../autoupdate/ui/wizards/Bundle.properties | 3 +- .../ui/wizards/ValidationWarningPanel.form | 78 ++++++++++++------- .../ui/wizards/ValidationWarningPanel.java | 90 +++++++++++++++------- 4 files changed, 121 insertions(+), 60 deletions(-) diff --git a/platform/autoupdate.services/src/org/netbeans/modules/autoupdate/services/InstallSupportImpl.java b/platform/autoupdate.services/src/org/netbeans/modules/autoupdate/services/InstallSupportImpl.java index 5db31b9..28263fc 100644 --- a/platform/autoupdate.services/src/org/netbeans/modules/autoupdate/services/InstallSupportImpl.java +++ b/platform/autoupdate.services/src/org/netbeans/modules/autoupdate/services/InstallSupportImpl.java @@ -1056,6 +1056,13 @@ public class InstallSupportImpl { } private int verifyNbm (UpdateElement el, File nbmFile, ProgressHandle progress, int verified) throws OperationException { + UpdateElementImpl impl = Trampoline.API.impl(el); + + modified.remove(impl); + trusted.remove(impl); + signedVerified.remove(impl); + signedUnverified.remove(impl); + String res = null; try { // get trusted certificates @@ -1086,8 +1093,6 @@ public class InstallSupportImpl { progress.progress (el.getDisplayName (), verified < wasDownloaded ? verified : wasDownloaded); } - UpdateElementImpl impl = Trampoline.API.impl(el); - try { Collection<CodeSigner> nbmCerts = Utilities.getNbmCertificates(nbmFile); if(nbmCerts == null) { @@ -1114,7 +1119,6 @@ public class InstallSupportImpl { } catch (SecurityException ex) { LOG.log(Level.INFO, "The content of the jar/nbm has been modified or certificate paths were inconsistent - " + ex.getMessage(), ex); res = Utilities.MODIFIED; - modified.add(impl); } if (res != null) { diff --git a/platform/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/wizards/Bundle.properties b/platform/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/wizards/Bundle.properties index e0f4999..7086f1f 100644 --- a/platform/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/wizards/Bundle.properties +++ b/platform/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/wizards/Bundle.properties @@ -164,4 +164,5 @@ InstallStep_DownloadProblem=There were some problems while storing {0}.\nCause: InstallStep_DownloadProblem_SomePlugins=selected plugins LicenseApprovalPanel.lbPlugins.text=Plugins: OperationDescriptionStep_NoteCachesNotBuilt=<br><hr><br>\ - <b>Note:</b> Missing modules may be published on Update Centers. Please run "<b>Check for Newest</b>" from the "<b>Available Plugins</b>" tab. \ No newline at end of file + <b>Note:</b> Missing modules may be published on Update Centers. Please run "<b>Check for Newest</b>" from the "<b>Available Plugins</b>" tab. +ValidationWarningPanel.taError.text=Error: There were plugins, that were modified or damaged, Installation can't continue. diff --git a/platform/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/wizards/ValidationWarningPanel.form b/platform/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/wizards/ValidationWarningPanel.form index 70d3f6c..09ee81d 100644 --- a/platform/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/wizards/ValidationWarningPanel.form +++ b/platform/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/wizards/ValidationWarningPanel.form @@ -22,6 +22,20 @@ --> <Form version="1.4" maxVersion="1.4" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> + <Properties> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo"> + <EmptyBorder bottom="6" left="6" right="6" top="6"/> + </Border> + </Property> + <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> + <Dimension value="[480, 400]"/> + </Property> + <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> + <Dimension value="[480, 400]"/> + </Property> + <Property name="requestFocusEnabled" type="boolean" value="false"/> + </Properties> <AccessibilityProperties> <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <ResourceString bundle="org/netbeans/modules/autoupdate/ui/wizards/Bundle.properties" key="ValidationWarningPanel_ACD" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> @@ -36,36 +50,10 @@ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + <AuxValue 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,4,29,0,0,1,-30"/> </AuxValues> - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace min="-2" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="spPlugins" alignment="0" max="32767" attributes="0"/> - <Component id="taHead" alignment="0" max="32767" attributes="2"/> - <Component id="taWarning" alignment="1" max="32767" attributes="2"/> - </Group> - <EmptySpace min="-2" max="-2" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" max="-2" attributes="0"/> - <Component id="taHead" min="-2" pref="57" max="-2" attributes="0"/> - <EmptySpace min="-2" max="-2" attributes="0"/> - <Component id="spPlugins" pref="196" max="32767" attributes="0"/> - <EmptySpace min="-2" max="-2" attributes="0"/> - <Component id="taWarning" pref="58" max="32767" attributes="0"/> - <EmptySpace min="-2" max="-2" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - </Layout> + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/> <SubComponents> <Component class="javax.swing.JTextArea" name="taHead"> <Properties> @@ -82,8 +70,37 @@ <ResourceString bundle="org/netbeans/modules/autoupdate/ui/wizards/Bundle.properties" key="ValidationWarningPanel_taHead_ACN" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> </Property> </AccessibilityProperties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> + <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="3" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JTextArea" name="taError"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="12" green="0" red="cc" type="rgb"/> + </Property> + <Property name="lineWrap" type="boolean" value="true"/> + <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> + <ResourceString bundle="org/netbeans/modules/autoupdate/ui/wizards/Bundle.properties" key="ValidationWarningPanel.taError.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> + </Property> + <Property name="wrapStyleWord" type="boolean" value="true"/> + <Property name="opaque" type="boolean" value="false"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> + <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="3" insetsRight="0" anchor="512" weightX="0.0" weightY="0.0"/> + </Constraint> + </Constraints> </Component> <Container class="javax.swing.JScrollPane" name="spPlugins"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> + <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="3" insetsLeft="0" insetsBottom="3" insetsRight="0" anchor="18" weightX="1.0" weightY="1.0"/> + </Constraint> + </Constraints> <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> <SubComponents> @@ -114,6 +131,11 @@ <ResourceString bundle="org/netbeans/modules/autoupdate/ui/wizards/Bundle.properties" key="ValidationWarningPanel_taWarning_Text_ACD" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> </Property> </AccessibilityProperties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> + <GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="3" insetsLeft="0" insetsBottom="3" insetsRight="0" anchor="512" weightX="0.0" weightY="0.0"/> + </Constraint> + </Constraints> </Component> </SubComponents> </Form> diff --git a/platform/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/wizards/ValidationWarningPanel.java b/platform/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/wizards/ValidationWarningPanel.java index a60b35d..e413163 100644 --- a/platform/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/wizards/ValidationWarningPanel.java +++ b/platform/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/wizards/ValidationWarningPanel.java @@ -44,6 +44,8 @@ public class ValidationWarningPanel extends javax.swing.JPanel { taHead.setBorder(BorderFactory.createEmptyBorder()); taWarning.setBackground( new Color(0,0,0,0) ); taWarning.setBorder(BorderFactory.createEmptyBorder()); + taError.setVisible(! modified.isEmpty()); + taHead.setVisible(modified.isEmpty()); postInitComponents (signedVerified, signedUnverified, unsigned, modified, total); } @@ -51,6 +53,7 @@ public class ValidationWarningPanel extends javax.swing.JPanel { DefaultMutableTreeNode signedAndValidNode = new DefaultMutableTreeNode("Signed and Valid (" + signedVerified.size() + ")"); DefaultMutableTreeNode selfSignedNode = new DefaultMutableTreeNode("Self signed (" + signedUnverified.size() + ")"); DefaultMutableTreeNode unsignedNode = new DefaultMutableTreeNode("Unsigned (" + unsigned.size() + ")"); + DefaultMutableTreeNode modifiedNode = new DefaultMutableTreeNode("Modified/Damaged (" + modified.size() + ")"); for (UpdateElement el : signedVerified) { signedAndValidNode.add(new DefaultMutableTreeNode(el.getDisplayName())); @@ -66,7 +69,12 @@ public class ValidationWarningPanel extends javax.swing.JPanel { unsignedNode.add(new DefaultMutableTreeNode(el.getDisplayName())); } pluginModelRoot.add(unsignedNode); - + + for (UpdateElement el : modified) { + modifiedNode.add(new DefaultMutableTreeNode(el.getDisplayName())); + } + pluginModelRoot.add(modifiedNode); + pluginsModel.reload(); int requiresAttention = signedVerified.size() + signedUnverified.size() + unsigned.size(); @@ -78,6 +86,10 @@ public class ValidationWarningPanel extends javax.swing.JPanel { taHead.setText(org.openide.util.NbBundle.getMessage(ValidationWarningPanel.class, "ValidationWarningPanel_taHead_NotTrustedTextSg", requiresAttention, total)); } + + if(modified.size() > 0) { + + } } public String getSelectedNode() { @@ -96,52 +108,73 @@ public class ValidationWarningPanel extends javax.swing.JPanel { */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { + java.awt.GridBagConstraints gridBagConstraints; taHead = new javax.swing.JTextArea(); + taError = new javax.swing.JTextArea(); spPlugins = new javax.swing.JScrollPane(); tPlugins = new javax.swing.JTree(); taWarning = new javax.swing.JTextArea(); + setBorder(javax.swing.BorderFactory.createEmptyBorder(6, 6, 6, 6)); + setMinimumSize(new java.awt.Dimension(480, 400)); + setPreferredSize(new java.awt.Dimension(480, 400)); + setRequestFocusEnabled(false); + setLayout(new java.awt.GridBagLayout()); + taHead.setEditable(false); taHead.setLineWrap(true); taHead.setWrapStyleWord(true); taHead.setOpaque(false); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 0; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 3, 0); + add(taHead, gridBagConstraints); + taHead.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ValidationWarningPanel.class, "ValidationWarningPanel_taHead_ACN")); // NOI18N + taHead.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ValidationWarningPanel.class, "ValidationWarningPanel_taHead_ACN")); // NOI18N + + taError.setEditable(false); + taError.setForeground(new java.awt.Color(204, 0, 18)); + taError.setLineWrap(true); + taError.setText(org.openide.util.NbBundle.getMessage(ValidationWarningPanel.class, "ValidationWarningPanel.taError.text")); // NOI18N + taError.setWrapStyleWord(true); + taError.setOpaque(false); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.BASELINE_LEADING; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 3, 0); + add(taError, gridBagConstraints); tPlugins.setModel(pluginsModel); spPlugins.setViewportView(tPlugins); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.weighty = 1.0; + gridBagConstraints.insets = new java.awt.Insets(3, 0, 3, 0); + add(spPlugins, gridBagConstraints); + taWarning.setEditable(false); taWarning.setLineWrap(true); taWarning.setText(org.openide.util.NbBundle.getMessage(ValidationWarningPanel.class, "ValidationWarningPanel_taWarning_Text")); // NOI18N taWarning.setWrapStyleWord(true); taWarning.setOpaque(false); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(spPlugins, javax.swing.GroupLayout.DEFAULT_SIZE, 398, Short.MAX_VALUE) - .addComponent(taHead) - .addComponent(taWarning, javax.swing.GroupLayout.Alignment.TRAILING)) - .addContainerGap()) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(taHead, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spPlugins, javax.swing.GroupLayout.DEFAULT_SIZE, 196, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(taWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 58, Short.MAX_VALUE) - .addContainerGap()) - ); - - taHead.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ValidationWarningPanel.class, "ValidationWarningPanel_taHead_ACN")); // NOI18N - taHead.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ValidationWarningPanel.class, "ValidationWarningPanel_taHead_ACN")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 3; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.BASELINE_LEADING; + gridBagConstraints.insets = new java.awt.Insets(3, 0, 3, 0); + add(taWarning, gridBagConstraints); taWarning.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ValidationWarningPanel.class, "ValidationWarningPanel_taWarning_Text_ACN")); // NOI18N taWarning.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ValidationWarningPanel.class, "ValidationWarningPanel_taWarning_Text_ACD")); // NOI18N @@ -152,6 +185,7 @@ public class ValidationWarningPanel extends javax.swing.JPanel { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JScrollPane spPlugins; private javax.swing.JTree tPlugins; + private javax.swing.JTextArea taError; private javax.swing.JTextArea taHead; private javax.swing.JTextArea taWarning; // End of variables declaration//GEN-END:variables --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
