You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by tw...@apache.org on 2007/01/03 16:04:30 UTC

svn commit: r492172 - /incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/annot_view/MainFrame.java

Author: twgoetz
Date: Wed Jan  3 07:04:29 2007
New Revision: 492172

URL: http://svn.apache.org/viewvc?view=rev&rev=492172
Log:
Jira UIMA-117: CVD manual menu item gives invalid URL error.

https://issues.apache.org/jira/browse/UIMA-117

Modified:
    incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/annot_view/MainFrame.java

Modified: incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/annot_view/MainFrame.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/annot_view/MainFrame.java?view=diff&rev=492172&r1=492171&r2=492172
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/annot_view/MainFrame.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/annot_view/MainFrame.java Wed Jan  3 07:04:29 2007
@@ -1371,25 +1371,28 @@
 
     public void actionPerformed(ActionEvent event) {
       try {
-        String manFileName = "/html_manual/casvisualdebugger.htm";
-        if (manFileName == null) {
-          String msg = "Can't find manual since system property\n"
-                  + "gladis.manual.file is not set.";
-          JOptionPane.showMessageDialog(MainFrame.this, msg, "Error loading manual",
-                  JOptionPane.ERROR_MESSAGE);
-          return;
-        }
+        String manFileName = "tools/tools.html";
         JFrame manFrame = new JFrame("CVD Manual");
         JEditorPane editorPane = new JEditorPane();
         editorPane.setEditable(false);
         editorPane.addHyperlinkListener(new Hyperactive());
-        URL manURL = MainFrame.class.getResource(manFileName);
+        URL manURL = ClassLoader.getSystemResource(manFileName);
+        if (manURL == null) {
+          String msg = "Can't find manual. The manual is loaded via the classpath,\n" +
+          		"so make sure the manual folder is in the classpath.";
+          JOptionPane.showMessageDialog(MainFrame.this, msg, "Error loading manual",
+                  JOptionPane.ERROR_MESSAGE);
+          return;
+        }
         editorPane.setPage(manURL);
         JScrollPane scrollPane = new JScrollPane(editorPane);
         scrollPane.setPreferredSize(new Dimension(700, 800));
         manFrame.setContentPane(scrollPane);
         manFrame.pack();
-        manFrame.show();
+        manFrame.setVisible(true);
+        URL cvdLinkUrl = new URL(manURL.toString() + "#ugr.tools.cvd");
+        HyperlinkEvent e = new HyperlinkEvent(editorPane, HyperlinkEvent.EventType.ACTIVATED, cvdLinkUrl);
+        editorPane.fireHyperlinkUpdate(e);
       } catch (Exception e) {
         handleException(e);
       }