1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-11-11 20:05:03 -05:00

Replace hardcoded strings

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@507 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-04-07 12:39:09 +00:00
parent 619ac82f59
commit e4a985b24a
6 changed files with 19 additions and 13 deletions

View File

@ -35,7 +35,7 @@ public class AboutFrame extends JFrame {
imageLabel.setIcon(icon); imageLabel.setIcon(icon);
JPanel imagePanel = new JPanel(); JPanel imagePanel = new JPanel();
imagePanel.add(imageLabel); imagePanel.add(imageLabel);
add("West", imagePanel); add(BorderLayout.WEST, imagePanel);
} catch (IOException e) { } catch (IOException e) {
DavGatewayTray.error("Unable to create icon", e); DavGatewayTray.error("Unable to create icon", e);
} }
@ -66,7 +66,7 @@ public class AboutFrame extends JFrame {
JPanel mainPanel = new JPanel(); JPanel mainPanel = new JPanel();
mainPanel.add(jEditorPane); mainPanel.add(jEditorPane);
add("Center", mainPanel); add(BorderLayout.CENTER, mainPanel);
JPanel buttonPanel = new JPanel(); JPanel buttonPanel = new JPanel();
JButton ok = new JButton("OK"); JButton ok = new JButton("OK");
@ -79,7 +79,7 @@ public class AboutFrame extends JFrame {
buttonPanel.add(ok); buttonPanel.add(ok);
add("South", buttonPanel); add(BorderLayout.SOUTH, buttonPanel);
pack(); pack();
setResizable(false); setResizable(false);

View File

@ -10,7 +10,9 @@ import java.awt.event.ActionListener;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.security.cert.X509Certificate; import java.security.cert.X509Certificate;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.text.DateFormat;
import java.util.Date; import java.util.Date;
import java.util.Locale;
/** /**
* Accept certificate dialog * Accept certificate dialog
@ -36,7 +38,7 @@ public class AcceptCertificateDialog extends JDialog {
public AcceptCertificateDialog(X509Certificate certificate) { public AcceptCertificateDialog(X509Certificate certificate) {
setAlwaysOnTop(true); setAlwaysOnTop(true);
String sha1Hash = DavGatewayX509TrustManager.getFormattedHash(certificate); String sha1Hash = DavGatewayX509TrustManager.getFormattedHash(certificate);
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy"); DateFormat formatter = DateFormat.getDateInstance(DateFormat.MEDIUM);
setTitle("DavMail: Accept certificate ?"); setTitle("DavMail: Accept certificate ?");
try { try {

View File

@ -328,7 +328,7 @@ public class SettingsFrame extends JFrame {
tabbedPane.add("Advanced", advancedPanel); tabbedPane.add("Advanced", advancedPanel);
add("Center", tabbedPane); add(BorderLayout.CENTER, tabbedPane);
JPanel buttonPanel = new JPanel(); JPanel buttonPanel = new JPanel();
JButton cancel = new JButton("Cancel"); JButton cancel = new JButton("Cancel");
@ -388,7 +388,7 @@ public class SettingsFrame extends JFrame {
buttonPanel.add(cancel); buttonPanel.add(cancel);
buttonPanel.add(help); buttonPanel.add(help);
add("South", buttonPanel); add(BorderLayout.SOUTH, buttonPanel);
pack(); pack();
//setResizable(false); //setResizable(false);

View File

@ -18,6 +18,10 @@ import java.awt.event.ActionListener;
* Tray icon handler based on java 1.6 * Tray icon handler based on java 1.6
*/ */
public class AwtGatewayTray implements DavGatewayTrayInterface { public class AwtGatewayTray implements DavGatewayTrayInterface {
protected static final String TRAY2_PNG = "tray2.png";
protected static final String TRAY_PNG = "tray.png";
protected static final String TRAYINACTIVE_PNG = "trayinactive.png";
protected AwtGatewayTray() { protected AwtGatewayTray() {
} }
@ -126,9 +130,9 @@ public class AwtGatewayTray implements DavGatewayTrayInterface {
// get the SystemTray instance // get the SystemTray instance
SystemTray tray = SystemTray.getSystemTray(); SystemTray tray = SystemTray.getSystemTray();
image = DavGatewayTray.loadImage("tray.png"); image = DavGatewayTray.loadImage(TRAY_PNG);
image2 = DavGatewayTray.loadImage("tray2.png"); image2 = DavGatewayTray.loadImage(TRAY2_PNG);
inactiveImage = DavGatewayTray.loadImage("trayinactive.png"); inactiveImage = DavGatewayTray.loadImage(TRAYINACTIVE_PNG);
// create a popup menu // create a popup menu
PopupMenu popup = new PopupMenu(); PopupMenu popup = new PopupMenu();

View File

@ -192,8 +192,8 @@ public class FrameGatewayTray implements DavGatewayTrayInterface {
} }
image = DavGatewayTray.loadImage("tray.png"); image = DavGatewayTray.loadImage("tray.png");
image2 = DavGatewayTray.loadImage("tray2.png"); image2 = DavGatewayTray.loadImage(AwtGatewayTray.TRAY2_PNG);
inactiveImage = DavGatewayTray.loadImage("trayinactive.png"); inactiveImage = DavGatewayTray.loadImage(AwtGatewayTray.TRAYINACTIVE_PNG);
mainFrame = new JFrame(); mainFrame = new JFrame();
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

View File

@ -143,8 +143,8 @@ public class SwtGatewayTray implements DavGatewayTrayInterface {
awtImage = DavGatewayTray.loadImage("tray.png"); awtImage = DavGatewayTray.loadImage("tray.png");
image = loadSwtImage("tray.png"); image = loadSwtImage("tray.png");
image2 = loadSwtImage("tray2.png"); image2 = loadSwtImage(AwtGatewayTray.TRAY2_PNG);
inactiveImage = loadSwtImage("trayinactive.png"); inactiveImage = loadSwtImage(AwtGatewayTray.TRAYINACTIVE_PNG);
trayItem.setImage(image); trayItem.setImage(image);