changeset in /hg/icedtea6: 2008-04-04 Joshua Sumali <jsumali at r...

Joshua Sumali jsumali at redhat.com
Fri Apr 4 13:13:59 PDT 2008


changeset 172f34f6f4b7 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=172f34f6f4b7
description:
	2008-04-04  Joshua Sumali  <jsumali at redhat.com>

	        * rt/net/sourceforge/jnlp/cache/CacheUtil.java: Added debugging code.
	        * rt/net/sourceforge/jnlp/runtime/Boot.java: Likewise.
	        * rt/net/sourceforge/jnlp/runtime/AppletEnvironment.java: Improved Applet
	        displaying.
	        * rt/net/sourceforge/jnlp/runtime/InstallDialog.java: Fixed image loading
	        on the cache dialog.
	        * rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Fixed window icon
	        loading.
	        * rt/net/sourceforge/jnlp/security/AccessWarningPane.java: Added icons to
	        warning dialogs.
	        * rt/net/sourceforge/jnlp/security/CertWarningPane.java: Likewise.
	        * rt/net/sourceforge/jnlp/security/MoreInfoPane.java: Likewise.
	        * rt/net/sourceforge/jnlp/security/SecurityWarningDialog.java: Added
	        NETWORK as type of security access.
	        * rt/net/sourceforge/jnlp/resources/info-small.png: New file.
	        * rt/net/sourceforge/jnlp/resources/warning-small.png: Likewise.
	        * rt/net/sourceforge/jnlp/resources/warning.png: Likewise.

diffstat:

10 files changed, 93 insertions(+), 48 deletions(-)
ChangeLog                                                   |   20 +++++
rt/net/sourceforge/jnlp/cache/CacheUtil.java                |    4 -
rt/net/sourceforge/jnlp/runtime/AppletEnvironment.java      |   31 +++++---
rt/net/sourceforge/jnlp/runtime/Boot.java                   |    2 
rt/net/sourceforge/jnlp/runtime/InstallDialog.java          |   14 +--
rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java            |    5 -
rt/net/sourceforge/jnlp/security/AccessWarningPane.java     |   41 +++++------
rt/net/sourceforge/jnlp/security/CertWarningPane.java       |    9 +-
rt/net/sourceforge/jnlp/security/MoreInfoPane.java          |   14 +++
rt/net/sourceforge/jnlp/security/SecurityWarningDialog.java |    1 

diffs (336 lines):

diff -r 26bd96e2a20b -r 172f34f6f4b7 ChangeLog
--- a/ChangeLog	Fri Apr 04 09:56:54 2008 -0400
+++ b/ChangeLog	Fri Apr 04 16:13:34 2008 -0400
@@ -1,3 +1,23 @@ 2008-04-04  Gary Benson  <gbenson at redhat
+2008-04-04  Joshua Sumali  <jsumali at redhat.com>
+
+	* rt/net/sourceforge/jnlp/cache/CacheUtil.java: Added debugging code.
+	* rt/net/sourceforge/jnlp/runtime/Boot.java: Likewise.
+	* rt/net/sourceforge/jnlp/runtime/AppletEnvironment.java: Improved Applet
+	displaying.
+	* rt/net/sourceforge/jnlp/runtime/InstallDialog.java: Fixed image loading
+	on the cache dialog.
+	* rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Fixed window icon
+	loading.
+	* rt/net/sourceforge/jnlp/security/AccessWarningPane.java: Added icons to
+	warning dialogs.
+	* rt/net/sourceforge/jnlp/security/CertWarningPane.java: Likewise.
+	* rt/net/sourceforge/jnlp/security/MoreInfoPane.java: Likewise.
+	* rt/net/sourceforge/jnlp/security/SecurityWarningDialog.java: Added
+	NETWORK as type of security access.
+	* rt/net/sourceforge/jnlp/resources/info-small.png: New file.
+	* rt/net/sourceforge/jnlp/resources/warning-small.png: Likewise.
+	* rt/net/sourceforge/jnlp/resources/warning.png: Likewise.
+
 2008-04-04  Gary Benson  <gbenson at redhat.com>
 
 	* patches/icedtea-ia64-bugfix.patch: New file.
diff -r 26bd96e2a20b -r 172f34f6f4b7 rt/net/sourceforge/jnlp/cache/CacheUtil.java
--- a/rt/net/sourceforge/jnlp/cache/CacheUtil.java	Fri Apr 04 09:56:54 2008 -0400
+++ b/rt/net/sourceforge/jnlp/cache/CacheUtil.java	Fri Apr 04 16:13:34 2008 -0400
@@ -115,10 +115,12 @@ public class CacheUtil {
         else {
             try {
                 // this is what URLClassLoader does
-                location.openConnection().getPermission();
+                return location.openConnection().getPermission();
             }
             catch (java.io.IOException ioe) {
                 // should try to figure out the permission
+            	if (JNLPRuntime.isDebug())
+            		ioe.printStackTrace();
             }
         }
 
diff -r 26bd96e2a20b -r 172f34f6f4b7 rt/net/sourceforge/jnlp/resources/info-small.png
Binary file rt/net/sourceforge/jnlp/resources/info-small.png has changed
diff -r 26bd96e2a20b -r 172f34f6f4b7 rt/net/sourceforge/jnlp/resources/warning-small.png
Binary file rt/net/sourceforge/jnlp/resources/warning-small.png has changed
diff -r 26bd96e2a20b -r 172f34f6f4b7 rt/net/sourceforge/jnlp/resources/warning.png
Binary file rt/net/sourceforge/jnlp/resources/warning.png has changed
diff -r 26bd96e2a20b -r 172f34f6f4b7 rt/net/sourceforge/jnlp/runtime/AppletEnvironment.java
--- a/rt/net/sourceforge/jnlp/runtime/AppletEnvironment.java	Fri Apr 04 09:56:54 2008 -0400
+++ b/rt/net/sourceforge/jnlp/runtime/AppletEnvironment.java	Fri Apr 04 16:13:34 2008 -0400
@@ -22,6 +22,7 @@ import java.awt.event.*;
 import java.awt.event.*;
 import java.util.*;
 import java.util.List;
+import java.lang.reflect.InvocationTargetException;
 import java.net.*;
 import java.io.*;
 import javax.swing.*;
@@ -168,16 +169,26 @@ public class AppletEnvironment implement
                               appletDesc.getHeight() + insets.top + insets.bottom);
             }
     
-            // do first because some applets need to be displayed before
-            // starting (they use Component.getImage or something)
-            cont.show();
-
-            applet.init();
-            applet.start();
-
-            cont.invalidate(); // this should force the applet to
-            cont.validate();   // the correct size and to repaint
-            cont.repaint();
+            try {
+            	SwingUtilities.invokeAndWait(new Runnable() {
+            		public void run() {
+            			// do first because some applets need to be displayed before
+            			// starting (they use Component.getImage or something)
+            			cont.setVisible(true);
+
+            			applet.init();
+            			applet.start();
+
+            			cont.invalidate(); // this should force the applet to
+            			cont.validate();   // the correct size and to repaint
+            			cont.repaint();
+            		}
+            	});
+            } catch (InterruptedException ie) {
+
+            } catch (InvocationTargetException ite) {
+
+            }
         }
         catch (Exception ex) {
             if (JNLPRuntime.isDebug())
diff -r 26bd96e2a20b -r 172f34f6f4b7 rt/net/sourceforge/jnlp/runtime/Boot.java
--- a/rt/net/sourceforge/jnlp/runtime/Boot.java	Fri Apr 04 09:56:54 2008 -0400
+++ b/rt/net/sourceforge/jnlp/runtime/Boot.java	Fri Apr 04 16:13:34 2008 -0400
@@ -236,6 +236,8 @@ public final class Boot implements Privi
         		url = new URL(ServiceUtil.getBasicService().getCodeBase(), location);
         } catch (Exception e) {
         	fatalError("Invalid jnlp file " + location);
+        	if (JNLPRuntime.isDebug())
+        		e.printStackTrace();
         }
         
         boolean strict = (null != getOption("-strict"));
diff -r 26bd96e2a20b -r 172f34f6f4b7 rt/net/sourceforge/jnlp/runtime/InstallDialog.java
--- a/rt/net/sourceforge/jnlp/runtime/InstallDialog.java	Fri Apr 04 09:56:54 2008 -0400
+++ b/rt/net/sourceforge/jnlp/runtime/InstallDialog.java	Fri Apr 04 16:13:34 2008 -0400
@@ -54,11 +54,9 @@ class InstallDialog extends Dialog imple
     InstallDialog() {
         super(createFrame(), R("CChooseCache"), true);
 
-		/*
-        background = 
-            new ImageIcon(getClass().getClassLoader().getResource("net/sourceforge/jnlp/resources/install.png"));
-		*/
-
+        URL icon = (new sun.misc.Launcher()).getClassLoader().getResource("net/sourceforge/jnlp/resources/install.png");
+        
+        background = new ImageIcon(icon);
         setLayout(new BorderLayout());
         setBackground(Color.white);
 
@@ -120,10 +118,10 @@ class InstallDialog extends Dialog imple
     }
 
     public void paint(Graphics g) {
-		/*
+		
         Insets sin = super.getInsets();
         g.drawImage(background.getImage(), sin.left, sin.top, this);
-		*/
+		
     }
 
     public void actionPerformed(ActionEvent evt) {
@@ -161,7 +159,7 @@ class InstallDialog extends Dialog imple
         Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
         id.setLocation(screen.width/2-id.getWidth()/2,
                        screen.height/2-id.getHeight()/2);
-        id.show();
+        id.setVisible(true);
 
         if (id.canceled)
             return null;
diff -r 26bd96e2a20b -r 172f34f6f4b7 rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java
--- a/rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java	Fri Apr 04 09:56:54 2008 -0400
+++ b/rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java	Fri Apr 04 16:13:34 2008 -0400
@@ -454,9 +454,8 @@ public class JNLPRuntime {
             return;
 
         try {
-            ClassLoader cl = JNLPRuntime.class.getClassLoader();
-            windowIcon = new javax.swing.ImageIcon(cl.getResource(
-            		"net/sourceforge/jnlp/resources/netx-icon.png")).getImage();
+            windowIcon = new javax.swing.ImageIcon((new sun.misc.Launcher())
+            		.getClassLoader().getResource("net/sourceforge/jnlp/resources/netx-icon.png")).getImage();
         }
         catch (Exception ex) {
             if (JNLPRuntime.isDebug())
diff -r 26bd96e2a20b -r 172f34f6f4b7 rt/net/sourceforge/jnlp/security/AccessWarningPane.java
--- a/rt/net/sourceforge/jnlp/security/AccessWarningPane.java	Fri Apr 04 09:56:54 2008 -0400
+++ b/rt/net/sourceforge/jnlp/security/AccessWarningPane.java	Fri Apr 04 16:13:34 2008 -0400
@@ -39,21 +39,12 @@ package net.sourceforge.jnlp.security;
 
 import java.awt.*;
 import javax.swing.*;
-import javax.swing.border.Border;
-import javax.swing.plaf.OptionPaneUI;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.ComponentAdapter;
-import java.util.List;
-import java.security.cert.Certificate;
-import java.security.cert.CertPath;
-import sun.swing.DefaultLookup;
+import java.net.URL;
+
 import net.sourceforge.jnlp.JNLPFile;
 import net.sourceforge.jnlp.runtime.JNLPRuntime;
-import net.sourceforge.jnlp.tools.KeyTool;
 
 /**
  * Provides the look and feel for a SecurityWarningDialog. These dialogs are
@@ -66,9 +57,15 @@ public class AccessWarningPane extends S
 public class AccessWarningPane extends SecurityDialogUI {
 
 	JCheckBox alwaysAllow;
-
+	Object[] extras;
+	
 	public AccessWarningPane(JComponent x) {
 		super(x);
+	}
+
+	public AccessWarningPane(JComponent x, Object[] extras) {
+		super(x);
+		this.extras = extras;
 	}
 
 	/**
@@ -103,33 +100,31 @@ public class AccessWarningPane extends S
 
 		//Top label
 		String topLabelText = "";
-		String propertyName = "";
 		switch (type) {
 			case READ_FILE:
 				topLabelText = R("SFileReadAccess");
-				propertyName = "OptionPane.warningIcon";
 				break;
 			case WRITE_FILE:
 				topLabelText = R("SFileWriteAccess");
-				propertyName = "OptionPane.warningIcon";
 				break;
 			case CLIPBOARD_READ:
 				topLabelText = R("SClipboardReadAccess");
-				propertyName = "OptionPane.warningIcon";
 				break;
 			case CLIPBOARD_WRITE:
 				topLabelText = R("SClipboardWriteAccess");
-				propertyName = "OptionPane.warningIcon";
 				break;
 			case PRINTER:
 				topLabelText = R("SPrinterAccess");
-				propertyName = "OptionPane.warningIcon";
 				break;
+			case NETWORK:
+				if (extras != null && extras.length >= 0)
+					topLabelText = R("SNetworkAccess", extras[0]);
+				else
+					topLabelText = R("SNetworkAccess", "(address here)");
 		}
 		
-		//TODO: Get system icons and add them to our dialogs.
-		//Icon icon = (Icon)DefaultLookup.get(optionPane,this,propertyName);
-		JLabel topLabel = new JLabel(htmlWrap(topLabelText));
+		ImageIcon icon = new ImageIcon((new sun.misc.Launcher()).getClassLoader().getResource("net/sourceforge/jnlp/resources/warning.png"));
+		JLabel topLabel = new JLabel(htmlWrap(topLabelText), icon, SwingConstants.LEFT);
 		topLabel.setFont(new Font(topLabel.getFont().toString(), 
 			Font.BOLD, 12));
 		JPanel topPanel = new JPanel(new BorderLayout());
@@ -183,6 +178,10 @@ public class AccessWarningPane extends S
         return JNLPRuntime.getMessage(key);
     }
 
+    private static String R(String key, Object param) {
+        return JNLPRuntime.getMessage(key, new Object[] {param});
+    }
+
 	protected String htmlWrap (String s) {
         return "<html>"+s+"</html>";
     }
diff -r 26bd96e2a20b -r 172f34f6f4b7 rt/net/sourceforge/jnlp/security/CertWarningPane.java
--- a/rt/net/sourceforge/jnlp/security/CertWarningPane.java	Fri Apr 04 09:56:54 2008 -0400
+++ b/rt/net/sourceforge/jnlp/security/CertWarningPane.java	Fri Apr 04 16:13:34 2008 -0400
@@ -39,6 +39,8 @@ package net.sourceforge.jnlp.security;
 
 import java.awt.*;
 import javax.swing.*;
+
+
 import java.awt.event.ActionListener;
 import java.awt.event.ActionEvent;
 import java.security.cert.Certificate;
@@ -128,9 +130,9 @@ public class CertWarningPane extends Sec
 			propertyName = "OptionPane.warningIcon";
 			break;
 		}
-		//TODO: Get system icons and add them to our dialogs.
-		//Icon icon = (Icon)DefaultLookup.get(optionPane,this,propertyName);
-		JLabel topLabel = new JLabel(htmlWrap(topLabelText));
+		ImageIcon icon = new ImageIcon((new sun.misc.Launcher())
+				.getClassLoader().getResource("net/sourceforge/jnlp/resources/warning.png"));
+		JLabel topLabel = new JLabel(htmlWrap(topLabelText), icon, SwingConstants.LEFT);
 		topLabel.setFont(new Font(topLabel.getFont().toString(), 
 				Font.BOLD, 12));
 		JPanel topPanel = new JPanel(new BorderLayout());
@@ -187,7 +189,6 @@ public class CertWarningPane extends Sec
 		JButton moreInfo = new JButton("More information...");
 		moreInfo.addActionListener(new MoreInfoButtonListener());
 		
-		//TODO: This should check if the X500Issuer is in the cacerts file.
 		if (((SecurityWarningDialog)optionPane).getJarSigner().getRootInCacerts())
 			bottomLabel = new JLabel(htmlWrap(R("STrustedSource")));
 		else
diff -r 26bd96e2a20b -r 172f34f6f4b7 rt/net/sourceforge/jnlp/security/MoreInfoPane.java
--- a/rt/net/sourceforge/jnlp/security/MoreInfoPane.java	Fri Apr 04 09:56:54 2008 -0400
+++ b/rt/net/sourceforge/jnlp/security/MoreInfoPane.java	Fri Apr 04 16:13:34 2008 -0400
@@ -73,7 +73,15 @@ public class MoreInfoPane extends Securi
 		errorPanel.setPreferredSize(new Dimension(400, 70*(numLabels)));
 
 		for (int i = 0; i < numLabels; i++) {
-			errorPanel.add(new JLabel(htmlWrap(details.get(i))));
+			ImageIcon icon = null;
+			if (details.get(i).equals(R("STrustedCertificate")))
+				icon = new ImageIcon((new sun.misc.Launcher())
+						.getClassLoader().getResource("net/sourceforge/jnlp/resources/info-small.png"));
+			else
+				icon = new ImageIcon((new sun.misc.Launcher())
+						.getClassLoader().getResource("net/sourceforge/jnlp/resources/warning-small.png"));
+
+			errorPanel.add(new JLabel(htmlWrap(details.get(i)), icon, SwingConstants.LEFT));
 		}
 
 		JPanel buttonsPanel = new JPanel(new BorderLayout());
@@ -92,6 +100,10 @@ public class MoreInfoPane extends Securi
         optionPane.add(main);
 	}
 
+    private static String R(String key) {
+        return JNLPRuntime.getMessage(key);
+    }
+    
 	/**
 	 * Needed to get word-wrap working in JLabels.
 	 */
diff -r 26bd96e2a20b -r 172f34f6f4b7 rt/net/sourceforge/jnlp/security/SecurityWarningDialog.java
--- a/rt/net/sourceforge/jnlp/security/SecurityWarningDialog.java	Fri Apr 04 09:56:54 2008 -0400
+++ b/rt/net/sourceforge/jnlp/security/SecurityWarningDialog.java	Fri Apr 04 16:13:34 2008 -0400
@@ -76,6 +76,7 @@ public class SecurityWarningDialog exten
         CLIPBOARD_READ,
         CLIPBOARD_WRITE,
         PRINTER,
+		NETWORK,
         VERIFIED,
         UNVERIFIED,
         SIGNING_ERROR



More information about the distro-pkg-dev mailing list