diff --git a/src/org/dclermonte/siba/SibaException.java b/src/org/dclermonte/siba/SibaException.java index 4700f71..b20fa8e 100644 --- a/src/org/dclermonte/siba/SibaException.java +++ b/src/org/dclermonte/siba/SibaException.java @@ -30,8 +30,8 @@ public class SibaException extends Exception private static final long serialVersionUID = 2909630770291570845L; /** - * - */ + * + */ public SibaException() { super(); diff --git a/src/org/dclermonte/siba/gui/AboutDialog.java b/src/org/dclermonte/siba/gui/AboutDialog.java index 4649f64..ed1cfe9 100644 --- a/src/org/dclermonte/siba/gui/AboutDialog.java +++ b/src/org/dclermonte/siba/gui/AboutDialog.java @@ -39,6 +39,7 @@ import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextPane; +import org.dclermonte.siba.gui.utils.GUIToolBox; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -110,7 +111,7 @@ public class AboutDialog extends JDialog txtpnSimpleBackupDveloppeur.setBackground(Color.GREEN); txtpnSimpleBackupDveloppeur.setFont(new Font("Dialog", Font.BOLD, 14)); txtpnSimpleBackupDveloppeur.setContentType("text/html"); - txtpnSimpleBackupDveloppeur.setText(AboutDialogUtils.aboutDialog()); + txtpnSimpleBackupDveloppeur.setText(GUIToolBox.aboutDialog()); panel.add(txtpnSimpleBackupDveloppeur); { JLabel lblNewLabel = new JLabel(""); diff --git a/src/org/dclermonte/siba/gui/AboutDialogUtils.java b/src/org/dclermonte/siba/gui/AboutDialogUtils.java deleted file mode 100644 index f9467ac..0000000 --- a/src/org/dclermonte/siba/gui/AboutDialogUtils.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2016 Didier Clermonté - * Copyright (C) 2016 Christian Pierre Momon - * - * This file is part of Siba. - * - * Siba is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ -package org.dclermonte.siba.gui; - -import java.io.File; -import java.io.IOException; -import java.nio.charset.Charset; -import java.util.ResourceBundle; - -import org.apache.commons.io.FileUtils; - -/** - * - * @author Didier Clermonté (dclermonte@april.org) - * - */ -public class AboutDialogUtils -{ - private static ResourceBundle BUNDLE = ResourceBundle.getBundle("org.dclermonte.siba.gui.messages"); //$NON-NLS-1$ - - /** - * - * @return - * @throws IOException - */ - public static String aboutDialog() throws IOException - { - String result = null; - - String about = BUNDLE.getString("AboutDialog"); - File aboutFile = new File(AboutDialog.class.getResource("/org/dclermonte/siba/gui/" + about).getFile()); - result = FileUtils.readFileToString(aboutFile, (Charset) null); - - return result; - } -} diff --git a/src/org/dclermonte/siba/gui/BackupPanel.java b/src/org/dclermonte/siba/gui/BackupPanel.java index 6aa8791..fea5e44 100644 --- a/src/org/dclermonte/siba/gui/BackupPanel.java +++ b/src/org/dclermonte/siba/gui/BackupPanel.java @@ -54,7 +54,7 @@ import com.jgoodies.forms.layout.RowSpec; public class BackupPanel extends JPanel { private static final long serialVersionUID = 4714383090458639282L; - private static ResourceBundle BUNDLE = ResourceBundle.getBundle("org.dclermonte.siba.gui.messages"); //$NON-NLS-1$ + private static final ResourceBundle BUNDLE = ResourceBundle.getBundle("org.dclermonte.siba.gui.messages"); //$NON-NLS-1$ private JTextField sourceDirectoryField; private JTextField targetDirectoryField; diff --git a/src/org/dclermonte/siba/gui/CheckPanel.java b/src/org/dclermonte/siba/gui/CheckPanel.java index e496aac..d190cb4 100644 --- a/src/org/dclermonte/siba/gui/CheckPanel.java +++ b/src/org/dclermonte/siba/gui/CheckPanel.java @@ -114,9 +114,9 @@ public class CheckPanel extends JPanel Component horizontalGlue = Box.createHorizontalGlue(); panel.add(horizontalGlue); - JButton ButtonCheck = new JButton(BUNDLE.getString("CheckPanel.btnNewButton_1.text")); //$NON-NLS-1$ - panel.add(ButtonCheck); - ButtonCheck.addActionListener(new ActionListener() + JButton btnCheck = new JButton(BUNDLE.getString("CheckPanel.btnNewButton_1.text")); //$NON-NLS-1$ + panel.add(btnCheck); + btnCheck.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) @@ -157,7 +157,7 @@ public class CheckPanel extends JPanel } } }); - ButtonCheck.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + btnCheck.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); Component horizontalGlue1 = Box.createHorizontalGlue(); panel.add(horizontalGlue1); diff --git a/src/org/dclermonte/siba/gui/SibaGUI.java b/src/org/dclermonte/siba/gui/SibaGUI.java index 80a156c..4c48884 100644 --- a/src/org/dclermonte/siba/gui/SibaGUI.java +++ b/src/org/dclermonte/siba/gui/SibaGUI.java @@ -143,7 +143,6 @@ public class SibaGUI logger.debug("Failed to set the system LookAndFeel."); } } - /* UIManager.setLookAndFeel("com.sun.java.swing.plaf.metal.MetalLookAndFeel"); */ logger.debug("Activated lookAndFeel: {} ", UIManager.getLookAndFeel().getName()); // Set default locale. diff --git a/src/org/dclermonte/siba/gui/utils/GUIToolBox.java b/src/org/dclermonte/siba/gui/utils/GUIToolBox.java index 42ff8c8..a6af5a0 100644 --- a/src/org/dclermonte/siba/gui/utils/GUIToolBox.java +++ b/src/org/dclermonte/siba/gui/utils/GUIToolBox.java @@ -19,11 +19,18 @@ */ package org.dclermonte.siba.gui.utils; +import java.io.File; +import java.io.IOException; +import java.nio.charset.Charset; import java.util.ArrayList; import java.util.List; +import java.util.ResourceBundle; import javax.swing.UIManager; +import org.apache.commons.io.FileUtils; +import org.dclermonte.siba.gui.AboutDialog; + /** * Some utility * @@ -32,6 +39,24 @@ import javax.swing.UIManager; */ public class GUIToolBox { + private static final ResourceBundle BUNDLE = ResourceBundle.getBundle("org.dclermonte.siba.gui.messages"); //$NON-NLS-1$ + + /** + * + * @return + * @throws IOException + */ + public static String aboutDialog() throws IOException + { + String result = null; + + String about = BUNDLE.getString("AboutDialog"); + File aboutFile = new File(AboutDialog.class.getResource("/org/dclermonte/siba/gui/" + about).getFile()); + result = FileUtils.readFileToString(aboutFile, (Charset) null); + + return result; + } + public static List availableLookAndFeels() { List result; diff --git a/src/org/dclermonte/siba/model/SibaUtils.java b/src/org/dclermonte/siba/model/SibaUtils.java index 286a1ac..d707651 100644 --- a/src/org/dclermonte/siba/model/SibaUtils.java +++ b/src/org/dclermonte/siba/model/SibaUtils.java @@ -63,7 +63,7 @@ public class SibaUtils } /** - * + * * @param md5 * @param fileName * @param target @@ -196,7 +196,7 @@ public class SibaUtils in = new FileReader(choosenFile); BufferedReader bufferedReader = new BufferedReader(in); String line = bufferedReader.readLine(); - String fileNameToString = new String(); + String fileNameToString; fileNameToString = line.substring(33); in.close(); if (choosenFile.isAbsolute())