aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net
diff options
context:
space:
mode:
Diffstat (limited to 'netx/net')
-rw-r--r--netx/net/sourceforge/jnlp/cache/CacheDirectory.java111
-rw-r--r--netx/net/sourceforge/jnlp/cache/DirectoryNode.java167
-rw-r--r--netx/net/sourceforge/jnlp/controlpanel/CachePane.java232
-rw-r--r--netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java120
-rw-r--r--netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java37
-rw-r--r--netx/net/sourceforge/jnlp/resources/Messages.properties18
6 files changed, 666 insertions, 19 deletions
diff --git a/netx/net/sourceforge/jnlp/cache/CacheDirectory.java b/netx/net/sourceforge/jnlp/cache/CacheDirectory.java
new file mode 100644
index 0000000..9468ba2
--- /dev/null
+++ b/netx/net/sourceforge/jnlp/cache/CacheDirectory.java
@@ -0,0 +1,111 @@
+/* CacheDirectory.java -- Traverse the given directory and return the leafs.
+ Copyright (C) 2010 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+package net.sourceforge.jnlp.cache;
+
+import java.io.File;
+import java.util.ArrayList;
+
+public class CacheDirectory {
+ /**
+ * Get the structure of directory for keeping track of the protocol and
+ * domain.
+ *
+ * @param root Location of cache directory.
+ */
+ public static void getDirStructure(DirectoryNode root) {
+ for (File f : root.getFile().listFiles()) {
+ DirectoryNode node = new DirectoryNode(f.getName(), f, root);
+ if (f.isDirectory() || (!f.isDirectory() && !f.getName().endsWith(".info")))
+ root.addChild(node);
+ if (f.isDirectory())
+ getDirStructure(node);
+ }
+ }
+
+ /**
+ * Get all the leaf nodes.
+ *
+ * @param root The point where we want to start getting the leafs.
+ * @return An ArrayList of DirectoryNode.
+ */
+ public static ArrayList<DirectoryNode> getLeafData(DirectoryNode root) {
+ ArrayList<DirectoryNode> temp = new ArrayList<DirectoryNode>();
+ for (DirectoryNode f : root.getChildren()) {
+ if (f.isDir())
+ temp.addAll(getLeafData(f));
+ else if (!f.getName().endsWith(".info"))
+ temp.add(f);
+ }
+ return temp;
+ }
+
+ /**
+ * Removes empty folders in the current directory.
+ *
+ * @param root File pointing at the beginning of directory.
+ * @return True if something was deleted.
+ */
+ public static boolean cleanDir(File root) {
+ boolean delete = true;
+ for (File f : root.listFiles()) {
+ if (f.isDirectory())
+ cleanDir(f);
+ else
+ delete = false;
+ }
+ if (delete)
+ System.out.println("Delete -- " + root);
+ // root.delete();
+ return true;
+ }
+
+ /**
+ * This will recursively remove the parent folders if they are empty.
+ *
+ * @param fileNode
+ */
+ public static void cleanParent(DirectoryNode fileNode) {
+ DirectoryNode parent = fileNode.getParent();
+ if (parent.getParent() == null)
+ return; // Don't delete the root.
+ if (parent.getChildren().size() == 0) {
+ parent.getFile().delete();
+ parent.getParent().removeChild(parent);
+ cleanParent(parent);
+ }
+ }
+}
diff --git a/netx/net/sourceforge/jnlp/cache/DirectoryNode.java b/netx/net/sourceforge/jnlp/cache/DirectoryNode.java
new file mode 100644
index 0000000..ba4f41a
--- /dev/null
+++ b/netx/net/sourceforge/jnlp/cache/DirectoryNode.java
@@ -0,0 +1,167 @@
+/* DirectoryNode.java -- Structure for maintaining the cache directory tree.
+ Copyright (C) 2010 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+*/
+package net.sourceforge.jnlp.cache;
+
+import java.io.File;
+import java.util.ArrayList;
+
+public class DirectoryNode {
+ private String name;
+ private File path;
+ private ArrayList<DirectoryNode> childNodes;
+ private DirectoryNode parent = null;
+ private File infoFile;
+
+ /**
+ * Create a new instance of DirectoryNode.
+ *
+ * @param name Name representing this node.
+ * @param absPathToNode Absolute path to this node given as a String.
+ * @param parent The parent node.
+ */
+ public DirectoryNode(String name, String absPathToNode, DirectoryNode parent) {
+ this(name, new File(absPathToNode), parent);
+ }
+
+ /**
+ * Create a new instance of DirectoryNode.
+ *
+ * @param name Name representing this node.
+ * @param absPathToNode Absolute path to this node as a File.
+ * @param parent The parent node.
+ */
+ public DirectoryNode(String name, File absPathToNode, DirectoryNode parent) {
+ this(name, absPathToNode, null, parent);
+ }
+
+ /**
+ * Create a new instance of DirectoryNode.
+ *
+ * @param name Name representing this node.
+ * @param absPathToNode Absolute path to this node given as a File.
+ * @param childNodes List of children nodes.
+ * @param parent The parent node.
+ */
+ public DirectoryNode(String name, File absPathToNode, ArrayList<DirectoryNode> childNodes, DirectoryNode parent) {
+ this.name = name;
+ this.path = absPathToNode;
+ this.childNodes = childNodes;
+ if (this.childNodes == null)
+ this.childNodes = new ArrayList<DirectoryNode>();
+ this.parent = parent;
+ if (!isDir())
+ this.infoFile = new File(this.getFile().getAbsolutePath().concat(".info"));
+ }
+
+ /**
+ * Append the given node to the list of child nodes.
+ *
+ * @param node Node to be appended.
+ */
+ public void addChild(DirectoryNode node) {
+ try {
+ childNodes.add(node);
+ } catch (NullPointerException e) {
+ this.childNodes = new ArrayList<DirectoryNode>();
+ this.childNodes.add(node);
+ }
+ }
+
+ /**
+ * Removes the node specified.
+ *
+ * @param node Node to be removed from the list of children
+ * @return true if this list of children contained the specified element
+ */
+ public boolean removeChild(DirectoryNode node) {
+ return this.childNodes.remove(node);
+ }
+
+ /**
+ * Retrieve the name of this node.
+ *
+ * @return Name of this node.
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ public String toString() {
+ return this.name;
+ }
+
+ /**
+ * Retrieve the file associated with this node.
+ *
+ * @return File that is associated with this node.
+ */
+ public File getFile() {
+ return path;
+ }
+
+ /**
+ * Retrieve the parent node.
+ *
+ * @return DirectoryNode representing the parent of the current node.
+ */
+ public DirectoryNode getParent() {
+ return parent;
+ }
+
+ /**
+ * Retrieves the list of child nodes.
+ *
+ * @return ArrayList of type DirectoryNode containing all the child nodes.
+ */
+ public ArrayList<DirectoryNode> getChildren() {
+ return this.childNodes;
+ }
+
+ /**
+ * Check if this node is a directory.
+ *
+ * @return True if node is directory.
+ */
+ public boolean isDir() {
+ return path.isDirectory();
+ }
+
+ public File getInfoFile() {
+ return this.infoFile;
+ }
+
+}
diff --git a/netx/net/sourceforge/jnlp/controlpanel/CachePane.java b/netx/net/sourceforge/jnlp/controlpanel/CachePane.java
new file mode 100644
index 0000000..b9c9cff
--- /dev/null
+++ b/netx/net/sourceforge/jnlp/controlpanel/CachePane.java
@@ -0,0 +1,232 @@
+/* CachePane.java -- Displays the specified folder and allows modification to its content.
+Copyright (C) 2010 Red Hat
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package net.sourceforge.jnlp.controlpanel;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JDialog;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.ListSelectionModel;
+import javax.swing.table.DefaultTableModel;
+
+import net.sourceforge.jnlp.cache.CacheDirectory;
+import net.sourceforge.jnlp.cache.DirectoryNode;
+import net.sourceforge.jnlp.config.DeploymentConfiguration;
+import net.sourceforge.jnlp.runtime.Translator;
+
+public class CachePane extends JPanel {
+
+ JDialog parent;
+ DeploymentConfiguration config;
+ private String location;
+ private JComponent defaultFocusComponent;
+ DirectoryNode root;
+ String[] columns = { Translator.R("CVCPColName"),
+ Translator.R("CVCPColPath"),
+ Translator.R("CVCPColType"),
+ Translator.R("CVCPColDomain"),
+ Translator.R("CVCPColSize"),
+ Translator.R("CVCPColLastModified") };
+ JTable cacheTable;
+
+ /**
+ * Creates a new instance of the CachePane.
+ *
+ * @param parent The parent dialog that uses this pane.
+ * @param config The DeploymentConfiguration file.
+ */
+ public CachePane(JDialog parent, DeploymentConfiguration config) {
+ super(new BorderLayout());
+ this.parent = parent;
+ this.config = config;
+ location = config.getProperty(DeploymentConfiguration.KEY_USER_CACHE_DIR);
+
+ addComponents();
+ }
+
+ /**
+ * Add components to the pane.
+ */
+ private void addComponents() {
+ JPanel topPanel = new JPanel(new GridBagLayout());
+ GridBagConstraints c = new GridBagConstraints();
+ c.fill = GridBagConstraints.BOTH;
+
+ DefaultTableModel model = new DefaultTableModel(columns, 0) {
+ public boolean isCellEditable(int row, int column) {
+ return false;
+ }
+ };
+
+ cacheTable = new JTable(model);
+ cacheTable.setAutoCreateRowSorter(true);
+ cacheTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ cacheTable.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN);
+ cacheTable.setPreferredScrollableViewportSize(new Dimension(600, 200));
+ cacheTable.setFillsViewportHeight(true);
+ JScrollPane scrollPane = new JScrollPane(cacheTable);
+
+ populateTable();
+
+ c.weightx = 1;
+ c.weighty = 1;
+ c.gridx = 0;
+ c.gridy = 0;
+ topPanel.add(scrollPane, c);
+ this.add(topPanel, BorderLayout.CENTER);
+ this.add(createButtonPanel(), BorderLayout.SOUTH);
+
+ }
+
+ /**
+ * Create the buttons panel.
+ *
+ * @return JPanel containing the buttons.
+ */
+ private Component createButtonPanel() {
+ JPanel buttonPanel = new JPanel(new GridLayout(1, 0));
+ JPanel leftPanel = new JPanel(new FlowLayout(FlowLayout.LEADING));
+ JPanel rightPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING));
+
+ List<JButton> buttons = new ArrayList<JButton>();
+
+ JButton deleteButton = new JButton(Translator.R("CVCPButDelete"));
+ deleteButton.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ int row = cacheTable.getSelectedRow();
+ try {
+ if (row == -1 || row > cacheTable.getRowCount() - 1)
+ return;
+ int modelRow = cacheTable.convertRowIndexToModel(row);
+ DirectoryNode fileNode = ((DirectoryNode) cacheTable.getModel().getValueAt(modelRow, 0));
+ if (fileNode.getFile().delete()) {
+ fileNode.getParent().removeChild(fileNode);
+ fileNode.getInfoFile().delete();
+ ((DefaultTableModel) cacheTable.getModel()).removeRow(modelRow);
+ cacheTable.getSelectionModel().setSelectionInterval(row, row);
+ CacheDirectory.cleanParent(fileNode);
+ }
+ } catch (Exception exception) {
+ //ignore
+ }
+ }
+ });
+ buttons.add(deleteButton);
+
+ JButton refreshButton = new JButton(Translator.R("CVCPButRefresh"));
+ refreshButton.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ populateTable();
+ }
+ });
+ buttons.add(refreshButton);
+
+ JButton doneButton = new JButton(Translator.R("ButDone"));
+ doneButton.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ parent.dispose();
+ }
+ });
+
+ int maxWidth = 0;
+ int maxHeight = 0;
+ for (JButton button : buttons) {
+ maxWidth = Math.max(button.getMinimumSize().width, maxWidth);
+ maxHeight = Math.max(button.getMinimumSize().height, maxHeight);
+ }
+
+ int wantedWidth = maxWidth + 10;
+ int wantedHeight = maxHeight;
+ for (JButton button : buttons) {
+ button.setPreferredSize(new Dimension(wantedWidth, wantedHeight));
+ leftPanel.add(button);
+ }
+
+ doneButton.setPreferredSize(new Dimension(wantedWidth, wantedHeight));
+ rightPanel.add(doneButton);
+ buttonPanel.add(leftPanel);
+ buttonPanel.add(rightPanel);
+
+ return buttonPanel;
+ }
+
+ /**
+ * Populate the table with fresh data. Any manual updates to the cache
+ * directory will be updated in the table.
+ */
+ private void populateTable() {
+ ((DefaultTableModel) cacheTable.getModel()).setRowCount(0); //Clears the table
+ for (Object[] v : generateData(root))
+ ((DefaultTableModel) cacheTable.getModel()).addRow(v);
+ }
+
+ /**
+ * This creates the data for the table.
+ *
+ * @param root The location of cache data.
+ * @return ArrayList containing an Object array of data for each row in the table.
+ */
+ private ArrayList<Object[]> generateData(DirectoryNode root) {
+ root = new DirectoryNode("Root", location, null);
+ CacheDirectory.getDirStructure(root);
+ ArrayList<Object[]> data = new ArrayList<Object[]>();
+
+ for (DirectoryNode type : root.getChildren()) {
+ for (DirectoryNode domain : type.getChildren()) {
+ for (DirectoryNode leaf : CacheDirectory.getLeafData(domain)) {
+ Object[] o = { leaf,
+ leaf.getFile().getAbsolutePath(),
+ type,
+ domain,
+ leaf.getFile().length(),
+ new SimpleDateFormat("MM/dd/yyyy").format(leaf.getFile().lastModified()) };
+ data.add(o);
+ }
+ }
+ }
+
+ return data;
+ }
+
+ /**
+ * Put focus onto default button.
+ */
+ public void focusOnDefaultButton() {
+ if (defaultFocusComponent != null) {
+ defaultFocusComponent.requestFocusInWindow();
+ }
+ }
+}
diff --git a/netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java b/netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java
new file mode 100644
index 0000000..0508981
--- /dev/null
+++ b/netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java
@@ -0,0 +1,120 @@
+/* CacheViewer.java -- Display the GUI for viewing and deleting cache files.
+Copyright (C) 2010 Red Hat
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package net.sourceforge.jnlp.controlpanel;
+
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Frame;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Toolkit;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import javax.swing.JDialog;
+
+import net.sourceforge.jnlp.config.DeploymentConfiguration;
+import net.sourceforge.jnlp.runtime.Translator;
+
+/**
+ * This class will provide a visual way of viewing cache.
+ *
+ * @author Andrew Su (asu@redhat.com, andrew.su@utoronto.ca)
+ *
+ */
+public class CacheViewer extends JDialog {
+
+ private boolean initialized = false;
+ private static final String dialogTitle = Translator.R("CVCPDialogTitle");
+ private DeploymentConfiguration config; // Configuration file which contains all the settings.
+ CachePane topPanel;
+
+ /**
+ * Creates a new instance of the cache viewer.
+ *
+ * @param config Deployment configuration file.
+ */
+ public CacheViewer(DeploymentConfiguration config) {
+ super((Frame) null, dialogTitle, true); // Don't need a parent.
+ this.config = config;
+
+ /* Prepare for adding components to dialog box */
+ Container contentPane = getContentPane();
+ contentPane.setLayout(new GridBagLayout());
+
+ GridBagConstraints c = new GridBagConstraints();
+ c.fill = GridBagConstraints.BOTH;
+ c.weightx = 1;
+ c.weighty = 1;
+ c.gridx = 0;
+ c.gridy = 0;
+ topPanel = new CachePane(this, this.config);
+ contentPane.add(topPanel, c);
+
+ pack();
+
+ /* Set focus to default button when first activated */
+ WindowAdapter adapter = new WindowAdapter() {
+ private boolean gotFocus = false;
+
+ public void windowGainedFocus(WindowEvent we) {
+ // Once window gets focus, set initial focus
+ if (!gotFocus) {
+ topPanel.focusOnDefaultButton();
+ gotFocus = true;
+ }
+ }
+ };
+ addWindowFocusListener(adapter);
+
+ initialized = true;
+ }
+
+ /**
+ * Display the cache viewer.
+ *
+ * @param config Configuration file.
+ * @throws Exception
+ */
+ public static void showCacheDialog(final DeploymentConfiguration config) throws Exception {
+ CacheViewer psd = new CacheViewer(config);
+ psd.setResizable(true);
+ psd.centerDialog();
+ psd.setVisible(true);
+ psd.dispose();
+ }
+
+ /**
+ * Check whether the dialog has finished being created.
+ *
+ * @return True if dialog is ready to be displayed.
+ */
+ public boolean isInitialized() {
+ return initialized;
+ }
+
+ /**
+ * Center the dialog box.
+ */
+ private void centerDialog() {
+ Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
+ Dimension dialogSize = getSize();
+
+ setLocation((screen.width - dialogSize.width) / 2, (screen.height - dialogSize.height) / 2);
+ }
+}
diff --git a/netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java b/netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java
index 9ed954b..bab888b 100644
--- a/netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java
+++ b/netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java
@@ -19,7 +19,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package net.sourceforge.jnlp.controlpanel;
import java.awt.BorderLayout;
-import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
@@ -27,15 +26,11 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import javax.naming.ConfigurationException;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JComponent;
-import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JPanel;
@@ -43,6 +38,7 @@ import javax.swing.JSlider;
import javax.swing.JSpinner;
import javax.swing.JTextField;
import javax.swing.SpinnerNumberModel;
+import javax.swing.SwingUtilities;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
@@ -54,9 +50,6 @@ import net.sourceforge.jnlp.runtime.Translator;
* This is provided as a pane for inside the Panel itself, can also be used to
* display as a dialog.
* TODO: Add functionality:
- * Delete Cache.
- * Restore Defaults.
- * View Cache.
*
* @author Andrew Su (asu@redhat.com, andrew.su@utoronto.ca)
*
@@ -189,13 +182,27 @@ public class TemporaryInternetFilesPanel extends NamedBorderPanel implements Cha
diskSpacePanel.add(spCacheSize, c);
JPanel buttonDeleteRestore = new JPanel(new FlowLayout(FlowLayout.TRAILING));
- JButton bDelete = new JButton(Translator.R("TIFPDeleteFiles") + "...");
- JButton bRestore = new JButton(Translator.R("TIFPRestoreDefaults"));
- //TODO: Add functionality to restore and delete. Also need to add a view button!
- bDelete.setEnabled(false);
- bRestore.setEnabled(false);
- buttonDeleteRestore.add(bDelete);
- buttonDeleteRestore.add(bRestore);
+ JButton bViewFiles = new JButton(Translator.R("TIFPViewFiles"));
+ bViewFiles.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ CacheViewer.showCacheDialog(config);
+ } catch (Exception e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+
+ }
+ });
+ }
+
+ });
+ buttonDeleteRestore.add(bViewFiles);
c.weighty = 0;
c.gridx = 0;
diff --git a/netx/net/sourceforge/jnlp/resources/Messages.properties b/netx/net/sourceforge/jnlp/resources/Messages.properties
index 2c376ff..fc4a196 100644
--- a/netx/net/sourceforge/jnlp/resources/Messages.properties
+++ b/netx/net/sourceforge/jnlp/resources/Messages.properties
@@ -12,6 +12,8 @@ ButMoreInformation=More Information...
ButOk=OK
ButProceed=Proceed
ButRun=Run
+ButApply=Apply
+ButDone=Done
AFileOnTheMachine=a file on the machine
AlwaysAllowAction=Always allow this action
Usage=Usage:
@@ -371,7 +373,18 @@ TIFPNone=None
TIFPMax=Max
TIFPCacheSize=Set the amount of disk space for storing temporary files
TIFPDeleteFiles=Delete files
-TIFPRestoreDefaults=Restore defaults
+TIFPViewFiles=View files...
+
+# Control Panel - Cache Viewer
+CVCPDialogTitle=Cache Viewer
+CVCPButRefresh=Refresh
+CVCPButDelete=Delete
+CVCPColLastModified=Last Modified
+CVCPColSize=Size (Bytes)
+CVCPColDomain=Domain
+CVCPColType=Type
+CVCPColPath=Path
+CVCPColName=Name
# Control Panel - Misc.
CPJRESupport=IcedTea-Web currently does not support the use of multiple JREs.
@@ -392,6 +405,3 @@ CLResetDescription=Resets the value for property-name to it\'s default value
CLInfoDescription=Shows more information about the given property
CLCheckDescription=Shows any properties that have been defined but are not recognized by IcedTea Web
CLHelpDescription=The itweb-settings tool allows a user to modify, view and check configuration. \nTo use the GUI, do not pass any arguments. To use the CLI mode, pass in the approrpiate command and parameters. For help with a particular command, try: {0} command help
-
-# Buttons
-ButApply=Apply