View Javadoc

1   // %4067251681:hoplugins.teamAnalyzer.ui.controller%
2   package hoplugins.teamAnalyzer.ui.controller;
3   
4   import hoplugins.Commons;
5   
6   import hoplugins.teamAnalyzer.executor.UnixExec;
7   import hoplugins.teamAnalyzer.executor.WindowsExec;
8   
9   import java.awt.event.ActionEvent;
10  import java.awt.event.ActionListener;
11  
12  
13  /***
14   * Action listener for the help menu item
15   *
16   * @author <a href=mailto:draghetto@users.sourceforge.net>Massimiliano Amato</a>
17   */
18  public class HelpItemListener implements ActionListener {
19      //~ Methods ------------------------------------------------------------------------------------
20  
21      /***
22       * Action performed event listener Lauch a script that open the guide
23       *
24       * @param arg0 the event
25       */
26      public void actionPerformed(ActionEvent arg0) {
27          String osName = System.getProperty("os.name");
28          String language = Commons.getModel().getHelper().getLanguageName();
29  
30          if (osName.equals("Windows 95")) {
31              String[] cmd = new String[4];
32  
33              cmd[0] = "command.com";
34              cmd[1] = "/C";
35              cmd[2] = "hoplugins//teamAnalyzer//guide.bat";
36              cmd[3] = language;
37              WindowsExec.showGuide(cmd);
38          } else if (osName.startsWith("Windows")) {
39              String[] cmd = new String[4];
40  
41              cmd[0] = "cmd.exe";
42              cmd[1] = "/C";
43              cmd[2] = "hoplugins//teamAnalyzer//guide.bat";
44              cmd[3] = language;
45              WindowsExec.showGuide(cmd);
46          } else {
47              String[] cmd = new String[3];
48  
49              cmd[0] = "sh";
50              cmd[1] = "./hoplugins/teamAnalyzer/guide.sh";
51              cmd[2] = language;
52              UnixExec.showGuide(cmd);
53          }
54      }
55  }