projects
/
jkeytool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adapt to i18n changes, move language properties to application directory.
[jkeytool.git]
/
src
/
net
/
pterodactylus
/
jkeytool
/
gui
/
swing
/
SwingInterface.java
diff --git
a/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java
b/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java
index
8a79747
..
b67ce84
100644
(file)
--- a/
src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java
+++ b/
src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java
@@
-34,10
+34,12
@@
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JMenuBar;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
+import javax.swing.JToolBar;
import net.pterodactylus.jkeytool.core.Core;
import net.pterodactylus.jkeytool.gui.Interface;
import net.pterodactylus.jkeytool.main.Main;
import net.pterodactylus.jkeytool.core.Core;
import net.pterodactylus.jkeytool.gui.Interface;
import net.pterodactylus.jkeytool.main.Main;
+import net.pterodactylus.util.i18n.I18n;
import net.pterodactylus.util.i18n.gui.I18nAction;
import net.pterodactylus.util.i18n.gui.I18nMenu;
import net.pterodactylus.util.swing.StatusBar;
import net.pterodactylus.util.i18n.gui.I18nAction;
import net.pterodactylus.util.i18n.gui.I18nMenu;
import net.pterodactylus.util.swing.StatusBar;
@@
-52,6
+54,9
@@
public class SwingInterface implements Interface {
/** The core to control. */
private Core core;
/** The core to control. */
private Core core;
+ /** The I18n container. */
+ private I18n i18n = new I18n("jkeytool", SwingInterface.class);
+
/** The main frame. */
private JFrame mainFrame = new JFrame("jkeytool " + Main.getVersion());
/** The main frame. */
private JFrame mainFrame = new JFrame("jkeytool " + Main.getVersion());
@@
-91,14
+96,14
@@
public class SwingInterface implements Interface {
//
private void createActions() {
//
private void createActions() {
- createKeyStoreAction = new I18nAction("jkeytool.action.createKeyStore") {
+ createKeyStoreAction = new I18nAction(
i18n,
"jkeytool.action.createKeyStore") {
@SuppressWarnings("synthetic-access")
public void actionPerformed(ActionEvent actionEvent) {
createKeyStore();
}
};
@SuppressWarnings("synthetic-access")
public void actionPerformed(ActionEvent actionEvent) {
createKeyStore();
}
};
- quitAction = new I18nAction("jkeytool.action.quit") {
+ quitAction = new I18nAction(
i18n,
"jkeytool.action.quit") {
/**
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
/**
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
@@
-112,6
+117,7
@@
public class SwingInterface implements Interface {
private void createFrame() {
mainFrame.setJMenuBar(createMenubar());
private void createFrame() {
mainFrame.setJMenuBar(createMenubar());
+ mainFrame.getContentPane().add(createToolbar(), BorderLayout.PAGE_START);
mainFrame.getContentPane().add(createCenterPanel(), BorderLayout.CENTER);
mainFrame.getContentPane().add(statusBar, BorderLayout.PAGE_END);
mainFrame.pack();
mainFrame.getContentPane().add(createCenterPanel(), BorderLayout.CENTER);
mainFrame.getContentPane().add(statusBar, BorderLayout.PAGE_END);
mainFrame.pack();
@@
-129,7
+135,7
@@
public class SwingInterface implements Interface {
private JMenuBar createMenubar() {
JMenuBar menubar = new JMenuBar();
private JMenuBar createMenubar() {
JMenuBar menubar = new JMenuBar();
- JMenu fileMenu = new I18nMenu("jkeytool.menu.file");
+ JMenu fileMenu = new I18nMenu(
i18n,
"jkeytool.menu.file");
menubar.add(fileMenu);
fileMenu.add(createKeyStoreAction);
fileMenu.addSeparator();
menubar.add(fileMenu);
fileMenu.add(createKeyStoreAction);
fileMenu.addSeparator();
@@
-138,6
+144,15
@@
public class SwingInterface implements Interface {
return menubar;
}
return menubar;
}
+ private JToolBar createToolbar() {
+ JToolBar toolbar = new JToolBar();
+
+ toolbar.add(createKeyStoreAction);
+ toolbar.add(quitAction);
+
+ return toolbar;
+ }
+
//
// INTERFACE Interface
//
//
// INTERFACE Interface
//