[593] | 1 | package net.oni2.aeinstaller.gui.about;
|
---|
| 2 |
|
---|
| 3 | import java.awt.event.ActionEvent;
|
---|
| 4 | import java.awt.event.KeyEvent;
|
---|
| 5 | import java.util.ResourceBundle;
|
---|
| 6 |
|
---|
| 7 | import javax.swing.AbstractAction;
|
---|
| 8 | import javax.swing.JComponent;
|
---|
| 9 | import javax.swing.JDialog;
|
---|
| 10 | import javax.swing.JLabel;
|
---|
| 11 | import javax.swing.KeyStroke;
|
---|
| 12 |
|
---|
| 13 | import net.oni2.aeinstaller.gui.HTMLLinkLabel;
|
---|
| 14 |
|
---|
| 15 | import org.javabuilders.BuildResult;
|
---|
| 16 | import org.javabuilders.swing.SwingJavaBuilder;
|
---|
| 17 |
|
---|
| 18 | /**
|
---|
| 19 | * @author Christian Illy
|
---|
| 20 | */
|
---|
| 21 | public class AboutDialog extends JDialog {
|
---|
| 22 | private static final long serialVersionUID = 1632257865019785612L;
|
---|
| 23 |
|
---|
| 24 | private ResourceBundle bundle = ResourceBundle.getBundle(getClass()
|
---|
| 25 | .getName());
|
---|
| 26 | @SuppressWarnings("unused")
|
---|
| 27 | private BuildResult result = SwingJavaBuilder.build(this, bundle);
|
---|
| 28 |
|
---|
| 29 | private JLabel lblAppversion;
|
---|
| 30 | private HTMLLinkLabel txtLinks;
|
---|
| 31 |
|
---|
| 32 | /**
|
---|
| 33 | * Open the dialog
|
---|
| 34 | */
|
---|
| 35 | public AboutDialog() {
|
---|
| 36 | lblAppversion.setText("v"
|
---|
| 37 | + SwingJavaBuilder.getConfig().getResource("appversion"));
|
---|
| 38 |
|
---|
| 39 | txtLinks.setText(bundle.getString("Links"));
|
---|
| 40 |
|
---|
| 41 | pack();
|
---|
| 42 |
|
---|
| 43 | AbstractAction closeAction = new AbstractAction() {
|
---|
| 44 |
|
---|
| 45 | private static final long serialVersionUID = 1L;
|
---|
| 46 |
|
---|
| 47 | public void actionPerformed(ActionEvent arg0) {
|
---|
| 48 | dispose();
|
---|
| 49 | }
|
---|
| 50 | };
|
---|
| 51 | KeyStroke ksCtrlW = KeyStroke
|
---|
| 52 | .getKeyStroke('W', KeyEvent.CTRL_DOWN_MASK);
|
---|
| 53 | getRootPane()
|
---|
| 54 | .getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
|
---|
| 55 | .put(ksCtrlW, "close");
|
---|
| 56 | getRootPane().getActionMap().put("close", closeAction);
|
---|
| 57 | }
|
---|
| 58 |
|
---|
| 59 | }
|
---|