Author: bombe
Date: 2008-06-22 20:49:33 +0000 (Sun, 22 Jun 2008)
New Revision: 20626

Modified:
   trunk/apps/jSite/src/de/todesbaum/jsite/application/Project.java
   trunk/apps/jSite/src/de/todesbaum/jsite/gui/NodeManagerPage.java
   trunk/apps/jSite/src/de/todesbaum/jsite/gui/ProjectFilesPage.java
Log:
version 0.4.12.1
fix Italian translation
add note for translators
some code cleanups

Modified: trunk/apps/jSite/src/de/todesbaum/jsite/application/Project.java
===================================================================
--- trunk/apps/jSite/src/de/todesbaum/jsite/application/Project.java    
2008-06-22 16:56:22 UTC (rev 20625)
+++ trunk/apps/jSite/src/de/todesbaum/jsite/application/Project.java    
2008-06-22 20:49:33 UTC (rev 20626)
@@ -30,7 +30,7 @@
  * @author David Roden <dr at todesbaum.dyndns.org>
  * @version $Id$
  */
-public class Project implements Comparable {
+public class Project implements Comparable<Project> {

        protected String name;
        protected String description;
@@ -192,7 +192,7 @@
        public String toString() {
                return name;
        }
-       
+
        private String shortenURI(String uri) {
                if (uri.startsWith("freenet:")) {
                        uri = uri.substring("freenet:".length());
@@ -252,12 +252,12 @@
                this.fileOptions.clear();
                this.fileOptions.putAll(fileOptions);
        }
-       
+
        /**
         * {@inheritDoc}
         */
-       public int compareTo(Object o) {
-               return name.compareToIgnoreCase(((Project) o).name);
+       public int compareTo(Project project) {
+               return name.compareToIgnoreCase(project.name);
        }

        /**

Modified: trunk/apps/jSite/src/de/todesbaum/jsite/gui/NodeManagerPage.java
===================================================================
--- trunk/apps/jSite/src/de/todesbaum/jsite/gui/NodeManagerPage.java    
2008-06-22 16:56:22 UTC (rev 20625)
+++ trunk/apps/jSite/src/de/todesbaum/jsite/gui/NodeManagerPage.java    
2008-06-22 20:49:33 UTC (rev 20626)
@@ -107,6 +107,7 @@
        private void createActions() {
                addNodeAction = new 
AbstractAction(I18n.getMessage("jsite.node-manager.add-node")) {

+                       @SuppressWarnings("synthetic-access")
                        public void actionPerformed(ActionEvent actionEvent) {
                                addNode();
                        }
@@ -114,6 +115,7 @@

                deleteNodeAction = new 
AbstractAction(I18n.getMessage("jsite.node-manager.delete-node")) {

+                       @SuppressWarnings("synthetic-access")
                        public void actionPerformed(ActionEvent actionEvent) {
                                deleteNode();
                        }
@@ -251,14 +253,14 @@
        // ACTIONS
        //

-       protected void addNode() {
+       private void addNode() {
                Node node = new Node("localhost", 9481, 
I18n.getMessage("jsite.node-manager.new-node"));
                nodeListModel.addElement(node);
                wizard.setNextEnabled(true);
                fireNodesUpdated(getNodes());
        }

-       protected void deleteNode() {
+       private void deleteNode() {
                Node node = getSelectedNode();
                if (node == null) {
                        return;

Modified: trunk/apps/jSite/src/de/todesbaum/jsite/gui/ProjectFilesPage.java
===================================================================
--- trunk/apps/jSite/src/de/todesbaum/jsite/gui/ProjectFilesPage.java   
2008-06-22 16:56:22 UTC (rev 20625)
+++ trunk/apps/jSite/src/de/todesbaum/jsite/gui/ProjectFilesPage.java   
2008-06-22 20:49:33 UTC (rev 20626)
@@ -35,7 +35,6 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
-import java.util.Map.Entry;

 import javax.swing.AbstractAction;
 import javax.swing.Action;
@@ -79,19 +78,19 @@
  */
 public class ProjectFilesPage extends TWizardPage implements ActionListener, 
ListSelectionListener, DocumentListener, FileScannerListener, ChangeListener {

-       protected Project project;
+       private Project project;

-       protected Action scanAction;
-       protected Action editContainerAction;
-       protected Action addContainerAction;
-       protected Action deleteContainerAction;
+       private Action scanAction;
+       private Action editContainerAction;
+       private Action addContainerAction;
+       private Action deleteContainerAction;

-       protected JList projectFileList;
+       private JList projectFileList;
        private JCheckBox defaultFileCheckBox;
        private JCheckBox fileOptionsInsertCheckBox;
        private JTextField fileOptionsCustomKeyTextField;
        private JComboBox fileOptionsMIMETypeComboBox;
-       protected DefaultComboBoxModel containerComboBoxModel;
+       private DefaultComboBoxModel containerComboBoxModel;
        private JComboBox fileOptionsContainerComboBox;
        private JSpinner replaceEditionRangeSpinner;
        private JCheckBox replacementCheckBox;
@@ -110,6 +109,7 @@
        private void createActions() {
                scanAction = new 
AbstractAction(I18n.getMessage("jsite.project-files.action.rescan")) {

+                       @SuppressWarnings("synthetic-access")
                        public void actionPerformed(ActionEvent actionEvent) {
                                actionScan();
                        }
@@ -119,6 +119,7 @@

                addContainerAction = new 
AbstractAction(I18n.getMessage("jsite.project-files.action.add-container")) {

+                       @SuppressWarnings("synthetic-access")
                        public void actionPerformed(ActionEvent actionEvent) {
                                actionAddContainer();
                        }
@@ -128,6 +129,7 @@

                editContainerAction = new 
AbstractAction(I18n.getMessage("jsite.project-files.action.edit-container")) {

+                       @SuppressWarnings("synthetic-access")
                        public void actionPerformed(ActionEvent actionEvent) {
                                actionEditContainer();
                        }
@@ -137,6 +139,7 @@

                deleteContainerAction = new 
AbstractAction(I18n.getMessage("jsite.project-files.action.delete-container")) {

+                       @SuppressWarnings("synthetic-access")
                        public void actionPerformed(ActionEvent actionEvent) {
                                actionDeleteContainer();
                        }
@@ -146,6 +149,7 @@

                I18nContainer.getInstance().registerRunnable(new Runnable() {

+                       @SuppressWarnings("synthetic-access")
                        public void run() {
                                scanAction.putValue(Action.NAME, 
I18n.getMessage("jsite.project-files.action.rescan"));
                                scanAction.putValue(Action.SHORT_DESCRIPTION, 
I18n.getMessage("jsite.project-files.action.rescan.tooltip"));
@@ -260,6 +264,7 @@

                I18nContainer.getInstance().registerRunnable(new Runnable() {

+                       @SuppressWarnings("synthetic-access")
                        public void run() {
                                fileOptionsLabel.setText("<html><b>" + 
I18n.getMessage("jsite.project-files.file-options") + "</b></html>");
                                
defaultFileCheckBox.setText(I18n.getMessage("jsite.project-files.default"));
@@ -303,14 +308,14 @@
                return files;
        }

-       protected void rebuildContainerComboBox() {
+       private void rebuildContainerComboBox() {
                /* scan files for containers */
                List<String> files = getProjectFiles();
                List<String> containers = new ArrayList<String>(); // 
ComboBoxModel
                // sucks. No
                // contains()!
                containers.add("");
-               for (String filename: files) {
+               for (String filename : files) {
                        String container = 
project.getFileOption(filename).getContainer();
                        if (!containers.contains(container)) {
                                containers.add(container);
@@ -318,7 +323,7 @@
                }
                Collections.sort(containers);
                containerComboBoxModel.removeAllElements();
-               for (String container: containers) {
+               for (String container : containers) {
                        containerComboBoxModel.addElement(container);
                }
        }
@@ -327,7 +332,7 @@
        // ACTIONS
        //

-       protected void actionScan() {
+       private void actionScan() {
                projectFileList.clearSelection();
                projectFileList.setListData(new Object[0]);

@@ -340,7 +345,7 @@
                new Thread(fileScanner).start();
        }

-       protected void actionAddContainer() {
+       private void actionAddContainer() {
                String containerName = JOptionPane.showInputDialog(wizard, 
I18n.getMessage("jsite.project-files.action.add-container.message") + ":", 
null, JOptionPane.INFORMATION_MESSAGE);
                if (containerName == null) {
                        return;
@@ -353,7 +358,7 @@
                fileOptionsContainerComboBox.setSelectedItem(containerName);
        }

-       protected void actionEditContainer() {
+       private void actionEditContainer() {
                String selectedFilename = (String) 
projectFileList.getSelectedValue();
                FileOption fileOption = project.getFileOption(selectedFilename);
                String oldContainerName = fileOption.getContainer();
@@ -367,7 +372,7 @@
                        return;
                }
                List<String> files = getProjectFiles();
-               for (String filename: files) {
+               for (String filename : files) {
                        fileOption = project.getFileOption(filename);
                        if (fileOption.getContainer().equals(oldContainerName)) 
{
                                fileOption.setContainer(containerName);
@@ -377,11 +382,11 @@
                fileOptionsContainerComboBox.setSelectedItem(containerName);
        }

-       protected void actionDeleteContainer() {
+       private void actionDeleteContainer() {
                if (JOptionPane.showConfirmDialog(wizard, 
I18n.getMessage("jsite.project-files.action.delete-container.message"), null, 
JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE) == 
JOptionPane.OK_OPTION) {
                        String containerName = (String) 
fileOptionsContainerComboBox.getSelectedItem();
                        List<String> files = getProjectFiles();
-                       for (String filename: files) {
+                       for (String filename : files) {
                                FileOption fileOption = 
project.getFileOption(filename);
                                if 
(fileOption.getContainer().equals(containerName)) {
                                        fileOption.setContainer("");
@@ -397,6 +402,7 @@
                        final List<String> files = fileScanner.getFiles();
                        SwingUtilities.invokeLater(new Runnable() {

+                               @SuppressWarnings("synthetic-access")
                                public void run() {
                                        
projectFileList.setListData(files.toArray(new String[files.size()]));
                                        projectFileList.clearSelection();
@@ -411,7 +417,7 @@
                                        entriesToRemove.add(filename);
                                }
                        }
-                       for (String filename: entriesToRemove) {
+                       for (String filename : entriesToRemove) {
                                project.setFileOption(filename, null);
                        }
                } else {
@@ -419,6 +425,7 @@
                }
                SwingUtilities.invokeLater(new Runnable() {

+                       @SuppressWarnings("synthetic-access")
                        public void run() {
                                wizard.setPreviousEnabled(true);
                                wizard.setNextEnabled(!error);


Reply via email to