changeset 1245:78b33f42aa24

Removed dual panel in panel misleading declaration in AppTrustWarningDialog * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningDialog.java: no longer extends SecurityDdialog. Static methods are now only simple factory methods creating concrete extensions of AppTrustWarningPanel * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPanel.java: now extends SecurityDialogPanel instead of JPanel. Removed SecurityDialog parent, now inherited, added call to super with securityDialog parameter
author Jiri Vanek <jvanek@redhat.com>
date Tue, 16 Jun 2015 11:29:01 +0200
parents e2583f1178ce
children 37dfc20a1816
files ChangeLog netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningDialog.java netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPanel.java
diffstat 3 files changed, 22 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Jun 16 10:49:03 2015 +0200
+++ b/ChangeLog	Tue Jun 16 11:29:01 2015 +0200
@@ -1,3 +1,13 @@
+2015-06-16  Jiri Vanek  <jvanek@redhat.com>
+
+	Removed dual panel in panel misleading declaration in AppTrustWarningDialog
+	* netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningDialog.java:
+	no longer extends SecurityDdialog. Static methods are now only simple factory methods
+	creating concrete extensions of AppTrustWarningPanel
+	* netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPanel.java:
+	now extends SecurityDialogPanel instead of JPanel. Removed SecurityDialog parent,
+	now inherited, added call to super with securityDialog parameter
+	
 2015-06-16  Jiri Vanek  <jvanek@redhat.com>
 
 	Removed redeclared line.separator
--- a/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningDialog.java	Tue Jun 16 10:49:03 2015 +0200
+++ b/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningDialog.java	Tue Jun 16 11:29:01 2015 +0200
@@ -39,33 +39,23 @@
 import net.sourceforge.jnlp.JNLPFile;
 import net.sourceforge.jnlp.runtime.JNLPClassLoader.SecurityDelegate;
 import net.sourceforge.jnlp.security.SecurityDialog;
-import net.sourceforge.jnlp.security.dialogs.SecurityDialogPanel;
 
 /**
  * A panel that confirms that the user is OK with unsigned code running.
  */
-public class AppTrustWarningDialog extends SecurityDialogPanel {
+public class AppTrustWarningDialog  {
 
-    private AppTrustWarningDialog(final SecurityDialog dialog) {
-        super(dialog);
+    public static AppTrustWarningPanel unsigned(final SecurityDialog dialog, final JNLPFile file) {
+        return new UnsignedAppletTrustWarningPanel(dialog, file);
+
     }
 
-    public static AppTrustWarningDialog unsigned(final SecurityDialog dialog, final JNLPFile file) {
-        final AppTrustWarningDialog warningDialog = new AppTrustWarningDialog(dialog);
-        warningDialog.add(new UnsignedAppletTrustWarningPanel(dialog, file));
-        return warningDialog;
-    }
-
-    public static AppTrustWarningDialog partiallySigned(final SecurityDialog dialog, final JNLPFile file, final SecurityDelegate securityDelegate) {
-        final AppTrustWarningDialog warningDialog = new AppTrustWarningDialog(dialog);
-        warningDialog.add(new PartiallySignedAppTrustWarningPanel(file, dialog, securityDelegate));
-        return warningDialog;
+    public static AppTrustWarningPanel partiallySigned(final SecurityDialog dialog, final JNLPFile file, final SecurityDelegate securityDelegate) {
+        return new PartiallySignedAppTrustWarningPanel(file, dialog, securityDelegate);
     }
     
-    public static AppTrustWarningDialog matchingAlaca(SecurityDialog x, JNLPFile file, String codebase, String remoteUrls) {
-        final AppTrustWarningDialog warningDialog = new AppTrustWarningDialog(x);
-        warningDialog.add(new MatchingALACAttributePanel(x, file, codebase, remoteUrls));
-        return warningDialog;
+    public static AppTrustWarningPanel matchingAlaca(SecurityDialog x, JNLPFile file, String codebase, String remoteUrls) {
+        return new MatchingALACAttributePanel(x, file, codebase, remoteUrls);
     }
 
 }
--- a/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPanel.java	Tue Jun 16 10:49:03 2015 +0200
+++ b/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPanel.java	Tue Jun 16 11:29:01 2015 +0200
@@ -69,8 +69,8 @@
 import net.sourceforge.jnlp.security.appletextendedsecurity.ExtendedAppletSecurityHelp;
 import net.sourceforge.jnlp.security.dialogresults.DialogResult;
 import net.sourceforge.jnlp.security.dialogresults.SetValueHandler;
-import net.sourceforge.jnlp.security.dialogresults.YesNo;
 import net.sourceforge.jnlp.security.dialogresults.YesNoSandboxLimited;
+import net.sourceforge.jnlp.security.dialogs.SecurityDialogPanel;
 import net.sourceforge.jnlp.security.dialogs.remember.RememberPanel;
 import net.sourceforge.jnlp.security.dialogs.remember.RememberPanelResult;
 import net.sourceforge.jnlp.security.dialogs.remember.RememberableDialog;
@@ -85,7 +85,7 @@
  * plugin applets. New implementations should be added to the unit test at
  * unit/net/sourceforge/jnlp/security/AppTrustWarningPanelTest
  */
-public abstract class AppTrustWarningPanel extends JPanel implements RememberableDialog{
+public abstract class AppTrustWarningPanel extends SecurityDialogPanel implements RememberableDialog{
 
     protected int PANE_WIDTH = 500;
 
@@ -101,12 +101,12 @@
     protected RememberPanel rememberPanel;
 
     protected JNLPFile file;
-    protected SecurityDialog parent;
 
     /*
      * Subclasses should call addComponents() IMMEDIATELY after calling the super() constructor!
      */
     public AppTrustWarningPanel(JNLPFile file, SecurityDialog securityDialog) {
+        super(securityDialog);
         this.file = file;
         this.parent = securityDialog;
         rememberPanel = new RememberPanel(file.getCodeBase());
@@ -217,9 +217,7 @@
                     if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                         Desktop.getDesktop().browse(e.getURL().toURI());
                     }
-                } catch (IOException ex) {
-                    OutputController.getLogger().log(ex);
-                } catch (URISyntaxException ex) {
+                } catch (IOException | URISyntaxException ex) {
                     OutputController.getLogger().log(ex);
                 }
             }