Rev | Line | |
---|
[52] | 1 | package geniusweb.actions;
|
---|
| 2 |
|
---|
| 3 | import java.awt.event.ActionEvent;
|
---|
| 4 | import java.io.IOException;
|
---|
| 5 | import java.net.URI;
|
---|
| 6 | import java.net.URISyntaxException;
|
---|
| 7 | import java.util.logging.Level;
|
---|
| 8 |
|
---|
| 9 | import tudelft.utilities.logging.Reporter;
|
---|
| 10 |
|
---|
| 11 | public class HelpAction extends GuiAction {
|
---|
| 12 |
|
---|
| 13 | private String helpuri = "https://tracinsy.ewi.tudelft.nl/pubtrac/GeniusWeb/wiki/ProfileEditor";
|
---|
| 14 |
|
---|
| 15 | public HelpAction(Reporter log) {
|
---|
| 16 | super("Help", log);
|
---|
| 17 | putValue(SHORT_DESCRIPTION, "Open Help webpage");
|
---|
| 18 | // no accelerator key. Apple uses shift-command-questionmark
|
---|
| 19 | // however ? is not supported as shortcut key in java because
|
---|
| 20 | // "it's not on the primary layer"
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | @Override
|
---|
| 24 | public void actionPerformed(ActionEvent evt) {
|
---|
| 25 | try {
|
---|
| 26 | java.awt.Desktop.getDesktop().browse(new URI(helpuri));
|
---|
| 27 | } catch (IOException | URISyntaxException e) {
|
---|
| 28 | e.printStackTrace();
|
---|
| 29 | log.log(Level.SEVERE,
|
---|
| 30 | "Failed to open help webpage:" + e.getMessage());
|
---|
| 31 | }
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.