Initial Commit
[packages] / xemacs-packages / jde / lisp / jde-help.el
1 ;;; jde-help.el
2 ;; $Revision: 1.72 $ 
3
4 ;; Author: Paul Kinnucan <paulk@mathworks.com>, Phillip Lord <plord@hgmp.mrc.ac.uk>
5 ;; Maintainer: Paul Kinnucan
6 ;; Keywords: java, tools
7
8 ;; Copyright (C) 1999, 2001, 2002, 2003, 2004 Paul Kinnucan.
9
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
14
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 ;; GNU General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
24
25 (require 'beanshell)
26 (require 'jde-widgets)
27 (require 'eieio)
28 (require 'jde-util)
29
30 ;; (makunbound 'jde-help-docsets)
31 (defcustom jde-help-docsets (list (list "JDK API" "" nil))
32   "*Lists collections of HTML files documenting Java classes. 
33 This list is used by the `jde-help-class' command to find help for 
34 a class. You can specify the following information for each docset:
35
36 Docset type
37
38   The following types are valid: 
39
40   * JDK API
41
42     JDK API documentation created by JDK developer (e.g., Sun)
43
44   * User (javadoc)
45
46     User collection in javadoc format.
47
48   * User (not javadoc)
49
50     User collection not in javadoc format.
51
52 Docset directory
53
54    Directory containing the collection, e.g., d:/jdk1.3/docs/api.  If
55    the docset type is `JDK API' and this field is the empty string, the
56    JDE looks for the docset in the `docs/api' subdirectory of the directory
57    returned by `jde-get-jdk-dir'. The docset directory may be located on
58    a remote system in which case this field should specify the URL of the
59    docset directory, e.g., http://www.javasoft.com/j2se/1.3/docs/api. The
60    GNU utility, wget, or the w3 function `url-file-exists' must be
61    installed on your system to find javadoc pages located on remote
62    systems. Native Windows and cygwin ports of wget are readily available
63    on the Internet. Make sure that wget is in Emacs `exec-path' before
64    attempting to access documentation on remote systems. See
65    `jde-help-remote-file-exists-function' for more information.
66
67 Doc lookup function
68
69    Should specify a function that accepts a fully qualified class name, 
70    e.g., java.awt.String, and a docset directory and returns a path to 
71    an HTML file that documents that class, e.g., 
72    d:/jdk1.2/docs/api/java/awt/String.html. This field must be specified
73    for non-javadoc collections. It is ignored for javadoc colletions.
74 "
75   :group 'jde-project
76   :type '(repeat 
77           (list
78            (radio-button-choice
79             :format "%t \n%v"
80             :tag "Docset type:"
81             (const "JDK API")
82             (const "User (javadoc)")
83             (const "User (not javadoc)"))
84            (file :tag "Docset directory")
85            ;;(symbol :tag "Doc lookup function")
86            (choice :tag "Doc lookup function" 
87                    (const nil)
88                    function))))
89
90 (defcustom jde-help-use-frames t   
91    "A non-nil value makes the functions:`jde-help-symbol',   
92  `jde-help-class-member' and `jde-help-class' use frames when displaying    
93  the html javadocs."   
94    :group 'jde-project   
95    :type 'boolean)   
96   
97 ;;(makunbound 'jde-help-remote-file-exists-function)
98 (defcustom jde-help-remote-file-exists-function (list "wget")
99   "Specifies the function the jde uses to retrieve remote documents.
100 wget is a Unix utility available on Windows as part of the Cygwin
101 package. `url-file-exists' is part of the url Emacs Lisp library,
102 which is included in the Emacs w3 package."
103   :group 'jde-project
104   :type '(list
105           (radio-button-choice
106            :format "%t \n%v"
107            :tag "Function:"
108            (const "wget")
109            (const "url-file-exists")))
110   :set '(lambda (sym val)
111           (if (and
112                (string= (car val) "url-file-exists")
113                (locate-library "url"))
114                (autoload 'url-file-exists "url" nil nil nil))
115           (set-default sym val)))
116
117 ;; (makunbound 'jde-help-wget-tries)
118 (defcustom jde-help-wget-tries nil
119   "Specifies the number of times that the JDEE should try getting
120 documentation from a remote site This option applies only if wget is
121 the`jde-help-remote-file-exists-function'. It sets wget's --tries 
122 command-line option. It is helpful in situations where
123 one of the the sites in `jde-help-docsets' is not always reachable."
124   :group 'jde-project
125   :type '(choice (const :tag "Try once" :value nil)
126                  (const :tag "Never stop trying" :value 0)
127                  (integer :tag "Number of retries" :value 1)))
128
129 ;; (makunbound 'jde-help-wget-timeout)
130 (defcustom jde-help-wget-timeout nil
131   "Specifies the length of time that the JDEE should wait for a remote site
132 to respond to a request for a document. This option applies only if wget is
133 the`jde-help-remote-file-exists-function'. It sets wget's --timeout 
134 command-line option. It is helpful in situations where
135 one of the the sites in `jde-help-docsets' is not always reachable."
136   :group 'jde-project
137   :type '(choice (const :tag "Default (900 s.)" :value nil)
138                  (const :tag "Disable timeout checking" :value 0)
139                  (integer :tag "Timeout (seconds)" :value 900)))
140
141 (defcustom jde-help-wget-command-line-options nil
142   "Specifies additional options (beyond --spider, --tries and
143 --timeout) to pass to wget, if wget is used for
144 `jde-help-remote-file-exists-function'."
145   :group 'jde-project
146   :type 'string)
147
148 ;; (makunbound 'jde-help-browser-function)
149 (defcustom jde-help-browser-function "browse-url"
150   "Specifies the function that the JDEE uses to display
151 HTML pages."
152   :group 'jde-project
153   :type '(choice
154           (const :tag "browse-url" :value "browse-url")
155           (const :tag "w3m-browse-url" :value "w3m-browse-url")
156           (function :tag "Other" :value identity)))
157
158
159 (defun jde-file-to-url (file)
160   "Convert FILE path to a URL. If FILE is a DOS path, this
161 function replaces the colon in the drive specifier with a
162 vertical bar (|) because both Internet Explorer and Netscape
163 accept the resulting URL whereas Netscape does not accept
164 a drive specifier with a colon."
165   (if (or (string-match "http:" file)
166           (string-match "file:" file))
167       file
168     (format "file://localhost%s"
169             (let ((file (jde-convert-cygwin-path file)))
170               ;; Check for DOS path.
171               (if (string-match "[a-zA-Z]:" file)
172                   (concat "/" (substitute ?| ?: file))
173                 file)))))
174
175
176 (defun jde-help-docset-get-type (docset)
177   (nth 0 docset))
178
179 (defun jde-help-docset-get-dir (docset)
180   (let ((path (nth 1 docset)))
181     (if (or (string-match "http:" path)
182             (string= path ""))
183         path
184       (jde-normalize-path path 'jde-help-docsets))))
185
186 (defun jde-help-docset-get-lookup-function (docset)
187   (nth 2 docset))
188
189 (defun jde-help-find-javadoc (class docset-dir)
190   "Searches DOCSET-DIR for the javadoc HTML page
191 for CLASS and, if found, returns the URL of the
192 javadoc page for CLASS. This function uses the function
193 specified by `jde-help-remote-file-exists-function'
194 to verify the existence of pages located on remote systems."
195   (let ((class-path
196          (concat (substitute ?/ ?. class) ".html")) 
197         url)
198     (cond
199      ((string-match "http:" docset-dir)
200       (setq url (concat docset-dir "/" class-path))
201              (if (string= 
202                   (car jde-help-remote-file-exists-function) 
203                   "url-file-exists")
204           (if (fboundp 'url-file-exists)
205               (if (not
206                    (url-file-exists url))
207                   (setq url nil))
208             (error "Cannot find url-file-exists function"))
209         (if (executable-find 
210              (if (eq system-type 'windows-nt) "wget.exe" "wget"))
211             (if (not
212                  (string-match
213                   "200"
214                   (shell-command-to-string
215                    (concat "wget --spider "
216                            (if jde-help-wget-tries
217                                (concat "--tries=" jde-help-wget-tries))
218                            (if jde-help-wget-timeout
219                                (concat "--timeout=" jde-help-wget-timeout))
220                            jde-help-wget-command-line-options
221                            " " url))))
222                 (setq url nil))
223           (error
224            (concat "Cannot find wget. This utility is needed "
225                    "to access javadoc on remote systems.")))))
226      (t
227       (let ((doc-path
228              (expand-file-name class-path docset-dir)))
229         (if (file-exists-p doc-path)
230             (setq url (jde-file-to-url doc-path))))))
231     url))
232
233 (defun jde-help-get-root-dir (docfile)
234   "Returns the javadoc root directory of docfile"
235   (if jde-help-docsets
236       (let ((docsets jde-help-docsets)
237             dir)
238         (while docsets
239           (let ((docset (car docsets)))
240             (setq dir (jde-help-docset-get-dir docset))
241             (if (and
242                  (or (not dir)
243                      (string= dir ""))
244                  (string= (jde-help-docset-get-type docset) "JDK API"))
245                 (setq dir (expand-file-name "docs/api" (jde-get-jdk-dir))))
246             (setq dir (jde-file-to-url (concat dir "/")))                    
247             (if (string-match dir docfile)
248                 (setq docsets nil)
249               (setq docsets (cdr docsets)))))
250           dir)))
251         
252 (defun jde-help-get-doc (class) 
253 "Gets URL to the HTML file for CLASS where CLASS is a 
254 qualified class name."
255   (if class
256       (if jde-help-docsets
257         (let ((paths
258                (mapcar
259                 (lambda (docset)
260                   (cond
261                    ((string= (jde-help-docset-get-type docset) "JDK API")
262                     (let ((dir (jde-help-docset-get-dir docset)))
263                       (if (string= dir "")
264                           (progn
265                             (setq dir (expand-file-name "docs/api" (jde-get-jdk-dir)))
266                             (if (not (file-exists-p dir))
267                                 (error "Cannot find default JDK API doc directory: %s"
268                                        dir))))
269                       (jde-help-find-javadoc class dir)))
270                    ((string= (jde-help-docset-get-type docset) "User (javadoc)")
271                     (jde-help-find-javadoc
272                      class
273                       (jde-help-docset-get-dir docset))) 
274                    (t
275                     (apply
276                      (jde-help-docset-get-lookup-function docset)
277                      class
278                      (list (jde-help-docset-get-dir docset))))))
279                 jde-help-docsets)))
280           (setq paths (delq nil paths))
281           ;; Return first file found.
282           (if paths (car paths) paths))
283         (error "%s" "Help error: No docsets available. See jde-help-docsets."))))
284
285
286 (defun jde-help-symbol-internal (class &optional method-name)
287   (let ((classinfo (jde-complete-get-classinfo class))
288         (doc-file (jde-help-get-doc class))
289         method-signature member pos)
290     (if (and method-name classinfo)
291         (setq method-signature (jde-complete-find-all-completions
292                                 (list class method-name)
293                                 classinfo)))
294     (if method-signature
295         (progn 
296           (setq member (caar method-signature))
297           (setq pos (string-match " : " member))
298           (if pos 
299               (setq member (substring member 0 pos)))))
300     (if doc-file
301         (jde-help-show-class-member-doc doc-file member)
302       (message "Error: cannot find documentation for class %s " class))))
303
304 (defun jde-help-symbol ()
305   "Displays help for a symbol. The symbol may reference an object, a
306 class, or a method or field. If the symbol references a class, this
307 function displays the javadoc for the class. If the symbol references
308 an object, this method displays the javadoc for the class of the
309 object. If the symbol references a field or a method, this function
310 displays the javadoc for the class of the object of which the field or
311 method is a member at the point where the method of field is
312 documented."
313   (interactive)
314   (condition-case err
315       (let* ((parse-result (jde-help-parse-symbol-at-point))
316              (unqualified-name (thing-at-point 'symbol))
317              (class-name (jde-parse-get-qualified-name unqualified-name t))
318              (pair (jde-parse-java-variable-at-point)))
319         (if (not class-name)
320             (if parse-result
321                 (progn
322                   (setq unqualified-name  (car parse-result))
323                   (setq class-name (jde-parse-get-qualified-name unqualified-name t)))))
324         (if class-name
325             (jde-help-symbol-internal class-name (cdr parse-result))
326           (if (not (string= (car pair) ""))
327               (progn
328                 (setq class-name (jde-parse-get-qualified-name (car pair) t))
329                 (jde-help-symbol-internal class-name unqualified-name))
330             (message "Error: cannot find class '%s' on the current classpath." unqualified-name))))
331     (error
332      (message "%s" (error-message-string err)))))
333   
334
335 (defun jde-help-show-document (doc-url &rest args)
336   "Displays DOC-URL in the browser specified by `jde-help-browser-function'."
337   (let ((browser-function
338          (cond
339           ((functionp jde-help-browser-function)
340            jde-help-browser-function)
341           ((string= jde-help-browser-function "w3m-browse-url")
342            'w3m-browse-url)
343           (t
344            'browse-url))))
345   (apply browser-function doc-url args)))
346
347 (defun jde-help-parse-symbol-at-point ()
348   "Returns (cons TYPE MEMBER) where TYPE is the declared type of
349 the object referenced by the (qualified) name at point and MEMBER is the
350 field or method referenced by the name if qualified."
351   (let ((parse-result (jde-parse-qualified-name-at-point)))
352     (if parse-result
353         (let* ((qualifier (car parse-result))
354                (name (cdr parse-result))
355                (obj (if qualifier qualifier name))
356                (member (if qualifier name)))
357           (if (not
358                (and 
359                 qualifier
360                 (string-match "[.]" qualifier)))
361               (let ((declared-type (car (jde-parse-declared-type-of obj))))
362                 (if declared-type
363                     (cons declared-type  member))))))))
364
365 (defun jde-help-class (&optional class-name)
366   "Return help for CLASS."
367   (interactive)
368   (let* ((class
369           (or class-name
370              (read-from-minibuffer "Class: " (thing-at-point 'symbol))))
371          (fq-class-name
372           (jde-parse-select-qualified-class-name class))
373          (doc-file 
374           (if fq-class-name
375               (jde-help-get-doc fq-class-name))))
376     (if doc-file 
377         (jde-help-show-class-member-doc doc-file)
378       (message "Error: cannot find documentation for %s" class))))
379
380
381 (defun jde-help-show-class-member-doc (docfile &optional member)
382   "Show DOCFILE in the browser defined by `jde-help-browser-function'
383 where DOCFILE is the class and MEMBER is the anchor for a class
384 member. If the `jde-help-browser-function' is is not w3m-browse-url, 
385 this function creates a temporary HTML file that redirects the
386 browser to DOCFILE. This is a workaround made necessary by the fact
387 that the default browser function for Windows uses the Windows
388 ShellExecute function to invoke Internet Explorer and for some reason
389 ShellExecute does not pass the anchor to IE. If `jde-help-use-frames'
390 is nonnil, this function creates a metafile that displays the 
391 multiframe version of the standard Javadoc page."
392   (let* ((anchor (if member (concat docfile "#" member)
393                   docfile))
394          (doc-url (jde-file-to-url anchor)))
395     (unless (string= jde-help-browser-function "w3m-browse-url")
396       (let* ((temp-directory (jde-temp-directory))
397              (metafile (expand-file-name "jde_meta.html" temp-directory))
398              (buff (find-file-noselect metafile nil t))
399              (standard-output buff)
400              (pos (string-match "[^/]*$" docfile))
401              (root (jde-help-get-root-dir docfile)))
402         (if buff
403             (progn
404               (save-excursion
405                 (set-buffer buff)
406                 (erase-buffer)
407                 (if jde-help-use-frames
408                     (progn
409                       (princ "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">\n")
410                       (princ "<html>\n<head>\n")
411                       (princ "<title>JDE javadoc window</title>\n</head>\n")
412                       (princ "<frameset cols=\"20%,80%\" onload=\"window.focus()\">\n")
413                       (princ "<frameset rows=\"30%,70%\">\n")
414                       (princ 
415                        (format "<frame src=\"%soverview-frame.html\" name=\"packageListFrame\">\n"
416                                root))
417                       (princ
418                        (format "<frame src=\"%spackage-frame.html\" name=\"packageFrame\">\n"
419                                (substring docfile 0 pos)))
420                       (princ 
421                        (format "<frame src=\"%sallclasses-frame.html\" name=\"packageFrame\">\n"
422                              root))
423                       (princ "</frameset>\n")
424                       (princ
425                        (format "<frame src=\"%s\" name=\"classFrame\">\n" doc-url))
426                       (princ "</frameset>\n")
427                       (princ "</html>\n"))
428                   (progn
429                     (princ "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n")
430                     (princ "<html>\n<head>\n")
431                     (princ 
432                      (format "<meta http-equiv=\"Refresh\" content=\"0; URL=%s\">\n"  doc-url))
433                              (princ "</head>\n<body onload=\"window.focus()\">\n</body>\n</html>")))
434                 (save-buffer)
435                 (kill-buffer buff))
436               (setq doc-url metafile))
437           (error "Unable to create a temporary file in %s directory."
438                  temporary-file-directory))))
439     (jde-help-show-document doc-url)))
440
441 (defun jde-help-popup-class-member-menu (class &optional title)
442   "Popup a menu of the fields and methods defined by CLASS.
443 Return the member selected by the user."
444   (let ((classinfo 
445           (jde-complete-get-classinfo class)))  
446     (if classinfo
447         (let (pos 
448               (pair 
449                (if (= (length classinfo) 1)
450                    ;; if only one item match, return it 
451                    (car classinfo)
452                  
453                  (if (eq jde-complete-function 'jde-complete-menu)
454                      ;; delegates menu handling to imenu :-) Popup window at
455                      ;; text cursor
456                      (imenu--mouse-menu classinfo  
457                                         (jde-cursor-posn-as-event) 
458                                         (or title "Class Members"))
459                    (assoc (completing-read (or title "Completion: ")
460                                            classinfo)
461                           classinfo)))))
462           (setq pos (string-match " : " (car pair)))
463           (if pos
464               (substring (car pair) 0 pos)
465             (cdr pair)))
466       (message "Class %s has no members." class))))
467
468 (defun jde-help-class-member (&optional class-name)
469   "Pop up a menu of the fields and methods of CLASS.
470 Then search `jde-help-docsets' for javadoc for CLASS. If found, 
471 point the browser to the doc for the selected method or
472 field. Note: this command does not check whether the doc
473 for CLASS actually documents the selected class member."
474   (interactive)
475   (let* ((class
476          (or class-name
477              (read-from-minibuffer "Class: " (thing-at-point 'symbol))))
478          (fq-class-name
479           (jde-parse-select-qualified-class-name class))
480          (doc-file (jde-help-get-doc fq-class-name)))
481     (if doc-file 
482         (let ((member (jde-help-popup-class-member-menu fq-class-name)))
483           (if member
484               (jde-help-show-class-member-doc doc-file member)))
485       (message "Error: cannot find documentation for %s" fq-class-name))))
486
487
488 (defun jde-help-get-jdk-doc-url ()
489   "Gets a URL for the JDK documentation."
490   (cond
491    ((string= jde-jdk-doc-url "")
492     (let ((path (expand-file-name "docs/index.html" (jde-get-jdk-dir))))
493       (if (file-exists-p path)
494           path
495         (error "Cannot find JDK documentation at default location: "
496                path))))
497    ((string-match "http:" jde-jdk-doc-url)
498     (if (or (and
499              (fboundp 'url-file-exists)
500              (not (url-file-exists jde-jdk-doc-url)))
501             (and
502              (executable-find (if (eq system-type 'windows-nt) "wget.exe" "wget"))
503              (not (string-match "200"
504                                 (shell-command-to-string
505                                  (concat "wget --spider "
506                                          (if jde-help-wget-tries
507                                              (concat "--tries=" jde-help-wget-tries))
508                                          (if jde-help-wget-timeout
509                                              (concat "--timeout=" jde-help-wget-timeout))
510                                          jde-help-wget-command-line-options
511                                          " " jde-jdk-doc-url))))))      
512         (error "JDK doc does not exist at jde-jdk-doc-url value: %s" jde-jdk-doc-url))
513     jde-jdk-doc-url)
514    ((string-match "file://" jde-jdk-doc-url)
515     (let ((path (substring jde-jdk-doc-url 7)))
516       (if (file-exists-p path)
517           path
518         (error "JDK doc does not exist at jde-jdk-doc-url value file://%s" path))))
519    ((not (string-match jde-jdk-doc-url ""))
520     (let ((path (jde-normalize-path jde-jdk-doc-url)))
521       (if (file-exists-p path)
522           path
523         (error "JDK doc does not exist at jde-jdk-doc-url value %s" path))))
524    (t
525     (let ((path (expand-file-name "docs/index.html" 
526                                   (jde-normalize-path (jde-get-jdk-dir)))))
527       (if (file-exists-p path)
528           path
529         (error "Cannot find JDK doc. Please set jde-jdk-directory or jde-jdk-doc-url"))))))
530
531 ;;;###autoload
532 (defun jde-help-beanshell ()
533   "Displays the BeanShell documentation."
534   (interactive)
535     (browse-url 
536     "http://www.beanshell.org/manual/contents.html"
537      (if (boundp 
538          'browse-url-new-window-flag)
539          browse-url-new-window-flag
540        browse-url-new-window-p)))
541
542 ;;;###autoload
543 (defun jde-help-browse-jdk-doc ()
544   "Displays the JDK doc in a web browser. This function uses the URL
545 stored in the variable jde-jdk-doc-url to locate the JDK documentation."
546   (interactive)
547   (browse-url 
548    (jde-help-get-jdk-doc-url)
549    (if (boundp 
550         'browse-url-new-window-flag)
551        browse-url-new-window-flag
552      browse-url-new-window-p)))
553
554 (provide 'jde-help)
555
556 ;; $Log: jde-help.el,v $
557 ;; Revision 1.72  2004/11/25 05:48:20  jslopez
558 ;; Fixes regression bug to jde-help-class-member caused by modification to
559 ;; jde-complete-function.
560 ;;
561 ;; Revision 1.71  2004/10/06 05:10:38  paulk
562 ;; Removed dead code.
563 ;;
564 ;; Revision 1.70  2004/10/06 05:07:43  paulk
565 ;; Fixes bug that caused generation of an extra slash in  URLs for local files on UNIX systems.
566 ;;
567 ;; Revision 1.69  2004/10/06 04:33:58  paulk
568 ;; Add jde-help-browser-function customization variable.
569 ;;
570 ;; Revision 1.68  2004/09/27 04:49:18  paulk
571 ;; Fix jde-help-show-class-member-doc so that it creates a metafile only
572 ;; if the user is using the default Windows browser, i.e., Internet
573 ;; Explorer. This change allows the JDEE to use w3m (specifically,
574 ;; w3m-browse-url) to display Javadoc.
575 ;;
576 ;; Revision 1.67  2004/08/25 12:28:33  paulk
577 ;; Add jde-help-beanshell.
578 ;;
579 ;; Revision 1.66  2004/08/01 11:59:04  paulk
580 ;; Fixed jde-help-show-class-member-doc to call jde-help-show-document from the JDEE buffer instead of the temp buffer to ensure that JDEE customizations are in effect, in particular, browse-url-browser-function. Thanks to Dan Katz.
581 ;;
582 ;; Revision 1.65  2004/03/04 04:43:31  paulk
583 ;; Adds the jde-help-wget-tries, jde-help-wget-timeout, and jde-help-wget-command-line-options
584 ;; variables. Thanks to Nick Sieger.
585 ;;
586 ;; Revision 1.64  2003/08/28 05:18:15  paulk
587 ;; Add jde-help-get-jdk-doc-url function.
588 ;;
589 ;; Revision 1.63  2003/07/15 01:25:06  paulk
590 ;; Use jde-temp-directory to get directory for temporary files.
591 ;;
592 ;; Revision 1.62  2003/02/25 15:01:02  jslopez
593 ;; Modifies jde-parse-get-qualified-name to take an extra parameters.
594 ;; If it does not find the qualified name it tries importing the class.
595 ;; And updates a few places where it is call to do that.
596 ;;
597 ;; Revision 1.61  2003/01/12 05:52:44  paulk
598 ;; Some HTML validity tweaks to jde_meta.html and add window.focus() so the
599 ;; browser window gets raised when new content is loaded into it.
600 ;; Thanks to Ville Skytt\81รค <scop@xemacs.org>.
601 ;;
602 ;; Revision 1.60  2002/12/14 04:36:10  paulk
603 ;; The jde-help-show-class-member-doc now opens the jde-metafile.html helper file as a raw file. This avoids loading any html modes associated with html files on a user's system. This in turn fixes a bug whereby displaying JAVA API doc triggers loading of html32-mode which in turn turns on transient mark mode. Thanks to James Cox for this fix.
604 ;;
605 ;; Revision 1.59  2002/09/16 05:05:58  paulk
606 ;; Cygwin Emacs compatibility fix. Check for Cygwin Emacs when processing paths. Thanks
607 ;; to Klaus Berndl.
608 ;;
609 ;; Revision 1.58  2002/07/01 04:52:11  paulk
610 ;; - Moved jde-open-class-source, jde-show-superclass-source, jde-show-interface-source from jde-help.el
611 ;;   to jde-open-source.el.
612 ;;
613 ;; - Removed jde-open-source-for-symbol because it has been superceded by jde-open-class-at-point.
614 ;;
615 ;; Revision 1.57  2002/06/25 15:17:05  jslopez
616 ;; Fixes logic error in jde-help-symbol-internal.
617 ;; It was calling jde-help-show-class-member-doc with an empty doc-file.
618 ;;
619 ;; Revision 1.56  2002/05/29 04:51:15  paulk
620 ;; jde-file-to-url now correctly converts cygwin paths to URLs.
621 ;; Thanks to Michael Lipp <michael.lipp@danet.de>.
622 ;;
623 ;; Revision 1.55  2002/05/13 06:50:35  paulk
624 ;; Removed jde-open-base-class-source as it has been superceded by jde-show-superclass-source.
625 ;;
626 ;; Revision 1.54  2002/04/17 00:13:13  jslopez
627 ;; Updates jde-open-base-class-source to not prompt the user.
628 ;; Updates the use of the variable jde-complete-use-menu.
629 ;;
630 ;; Revision 1.53  2002/04/16 03:17:07  jslopez
631 ;; Integrates jde-open-source.
632 ;;
633 ;; Revision 1.52  2002/03/31 07:49:50  paulk
634 ;; Renamed jde-db-source-directories. The new name is jde-sourcepath.
635 ;;
636 ;; Revision 1.51  2002/03/29 12:49:18  paulk
637 ;; Adds jde-show-interface-source and jde-show-superclass-source. Thanks to
638 ;; Sandip Chitale <sandip.chitale@blazesoft.com>
639 ;;
640 ;; Revision 1.50  2002/03/18 03:50:33  paulk
641 ;; XEmacs compatibility fix to jde-help-show-class-member-doc. Thanks to
642 ;; Dr. Volker Zell <Dr.Volker.Zell@oracle.com>.
643 ;;
644 ;; Revision 1.49  2002/01/28 07:39:00  paulk
645 ;; Updated jde-file-to-url to insert `localhost' into URL.
646 ;;
647 ;; Revision 1.48  2002/01/23 07:23:26  paulk
648 ;; Added jde-open-source-for-symbol functon. Thanks to "Max Rydahl Andersen" <max@eos.dk>.
649 ;;
650 ;; Revision 1.47  2001/12/19 07:51:34  paulk
651 ;; jde-help-show-class-member-doc now kills the temporary buffer for jde_meta.html.
652 ;;
653 ;; Revision 1.46  2001/12/12 05:26:15  paulk
654 ;; Fixed a small bug in jde-help-get-root-dir.
655 ;;
656 ;; Revision 1.45  2001/12/04 05:30:11  paulk
657 ;; Updated to reflect change in dialog class package name prefix from jde- to efc-.
658 ;;
659 ;; Revision 1.44  2001/11/25 06:59:50  paulk
660 ;; Changed doc look up function field in jde-help-docsets to offer a choice between
661 ;; a value of nil and a function. Thanks to Miles Bader.
662 ;;
663 ;; Revision 1.43  2001/11/25 04:39:32  paulk
664 ;; * Restored and extended jde-help-use-frames. Thanks to Javier Lopez.
665 ;; * Changed type of lookup function field of jde-help-docsets from function to
666 ;;   symbol because customize apparently does not support nil as a function
667 ;;   type.
668 ;;
669 ;; Revision 1.42  2001/11/24 15:15:51  paulk
670 ;; * Added a JDK API option to jde-help-docsets and made it the default. This option
671 ;;   specifies the API doc for the currently selected JDK (specified by jde-jdk,
672 ;;   $JAVA_VERSION, or $PATH).
673 ;;
674 ;; Revision 1.41  2001/11/18 06:40:17  paulk
675 ;; Fixed typo in jde-help-docsets.
676 ;;
677 ;; Revision 1.40  2001/11/16 20:14:08  jslopez
678 ;; Fixes bug in jde-help-show-class-member-doc
679 ;; caused by spaces.
680 ;;
681 ;; Revision 1.39  2001/11/14 11:58:52  jslopez
682 ;; Adds customization variable jde-help-use-frames.
683 ;; Modifies the functions jde-help-symbol, jde-help-class,
684 ;; jde-help-class-member to make use of this new variable.
685 ;;
686 ;; Revision 1.38  2001/11/09 03:16:22  jslopez
687 ;; Enhanced jde-help-symbol to handle static calls.
688 ;; i.e. ResourceBundle.getBundle
689 ;;
690 ;; Revision 1.37  2001/11/05 04:58:08  paulk
691 ;; Cosmetic.
692 ;;
693 ;; Revision 1.36  2001/10/31 08:58:44  paulk
694 ;; Emacs 21 compatibility fix: added support for browse-url-new-window-flag variable (replaces browse-url-new-window-p in Emacs 21).
695 ;;
696 ;; Revision 1.35  2001/10/28 17:44:22  jslopez
697 ;; Modifies jde-help-symbol to position the javadoc at the point
698 ;; where the method or field is documented.
699 ;;
700 ;; Revision 1.34  2001/10/28 16:09:38  jslopez
701 ;; Modify jde-help-class-member to use the
702 ;; minubuffer for completion when jde-complete-use-menu is nil
703 ;;
704 ;; Revision 1.33  2001/10/26 06:41:56  paulk
705 ;; Updated to reflect the new modal behavior of jde-option-dialog.
706 ;;
707 ;; Revision 1.32  2001/10/01 19:45:52  jslopez
708 ;; Fixed bug in jde-help-browse-jdk-doc, that was calling jde-normalize-path with no arguments, when
709 ;; jde-jdk-doc-url does not start with http://, file://, or equal to "".
710 ;;
711 ;; Revision 1.31  2001/08/30 04:10:28  paulk
712 ;; Moved jde-browse-jdk-doc to this library and renamed it jde-help-browse-jdk-doc. The command command now looks for the JDK doc at jde-jdk-directory/docs/index.html if it cannot find the doc at jde-jdk-doc-url. The command now also checks for the existence of the doc locally or on the web and errors out if it cannot find it.
713 ;;
714 ;; Revision 1.30  2001/08/10 06:14:01  paulk
715 ;; * Add support for cygwin paths to jde-file-to-url.
716 ;;
717 ;; Revision 1.29  2001/08/09 04:46:55  paulk
718 ;; * XEmacs compatibility fix. Now accommodates the way XEmacs specifies the temp directory. Thanks to Dr. Volker Zell.
719 ;;
720 ;; * Now replaces the colon in the DOS drive prefix with a vertical bar when forming URL's. This is done to accommodate Netscape.
721 ;;
722 ;; Revision 1.28  2001/08/08 05:56:12  paulk
723 ;; Removed prompt from jde-help-symbol.
724 ;;
725 ;; Revision 1.27  2001/08/08 05:22:18  paulk
726 ;; Adds jde-help-class-member command.
727 ;;
728 ;; Revision 1.26  2001/08/04 05:30:20  paulk
729 ;; Fixed jde-help-symbol so that it prompts you to enter the symbol. Also, if more than once class of the same name exists, prompts you to select the appropriate class.
730 ;;
731 ;; Revision 1.25  2001/06/12 07:18:55  paulk
732 ;; Changed jde-parse-declared-type-of to return a qualified type.
733 ;; Thanks to "Evan Easton" <evan@eeaston.com> .
734 ;;
735 ;; Revision 1.24  2001/05/31 05:14:39  paulk
736 ;; Provide support for per-project caching of class data in the Beanshell. Thanks to Matt Conway.
737 ;;
738 ;; Revision 1.23  2001/05/31 02:25:39  paulk
739 ;; User can now force the JDE to use either wget or url-file-exists to verify existence of a remote file.
740 ;; Thanks to Luis Miguel Hernanz Iglesias <luish@germinus.com> for suggesting this enhancement.
741 ;;
742 ;; Revision 1.22  2001/04/19 04:39:41  paulk
743 ;; Fixed regression error caused by normalizing paths. Now checks to ensure that path is local before trying to normalize it.
744 ;;
745 ;; Revision 1.21  2001/04/16 05:53:51  paulk
746 ;; Normalized paths.
747 ;;
748 ;; Revision 1.20  2001/04/08 04:11:40  paulk
749 ;; jde-help-find-javadoc now uses url-file-exists (from the w3 package) if it is in your load-path. Otherwise, it uses wget. Thanks to Knut Wannheden <wannhedenk@post.ch> and  klaus.berndl@sdm.de for this fix.
750 ;;
751 ;; Revision 1.19  2001/03/29 02:46:52  paulk
752 ;; Replaced jde-find-exec with executable-find, which is defined by executable.el available with both the Emacs and XEmacs distributions.
753 ;;
754 ;; Revision 1.18  2001/03/27 17:49:33  paulk
755 ;; Eliminate dependency on which package by including the function jde-find-exec and replacing references to the which command with jde-find-exec. Thanks to klaus.berndl@sdm.de for suggesting this change and providing the implementation of jde-find-exec.
756 ;;
757 ;; Revision 1.17  2001/03/27 16:44:50  paulk
758 ;; Updated to require which package. Removed extraneous definition of jde-help-find-javadoc. Thanks to klaus.berndl@sdm.de and Brad Giaccio <bgiaccio@psrw.com> for reporting these problems.
759 ;;
760 ;; Revision 1.16  2001/03/12 05:30:15  paulk
761 ;; Can now access javadoc anywhere on the Web. Thanks to Adrian Robert <arobert@polexis.com> for providing the initial version of this enhancement.
762 ;;
763 ;; Revision 1.15  2001/02/04 01:31:13  paulk
764 ;; Changed declaration of customized variables to permit completion of paths.
765 ;;
766 ;; Revision 1.14  2000/10/08 12:55:39  paulk
767 ;; *** empty log message ***
768 ;;
769 ;; Revision 1.13  2000/08/12 04:47:10  paulk
770 ;; Fixed regression error in jde-help-symbol-at-point.
771 ;;
772 ;; Revision 1.12  2000/02/09 05:06:49  paulk
773 ;; Replaced jde-help-class with jde-help-symbol method. The new method
774 ;; gets help for the symbol at point. The symbol may refer to a class,
775 ;; an object, or a method or field.
776 ;;
777 ;; Revision 1.11  2000/02/01 04:11:56  paulk
778 ;; ReleaseNotes.txt
779 ;;
780 ;; Revision 1.10  2000/01/18 07:11:25  paulk
781 ;; Added jde-show-class-source. Thanks to Phil Lord for the initial
782 ;; implementation of this command.
783 ;;
784 ;; Revision 1.9  2000/01/15 08:06:25  paulk
785 ;; Eliminated some globally bound symbols.
786 ;;
787 ;; Revision 1.8  1999/09/30 04:46:10  paulk
788 ;; Fixed typo spotted by David Biesack.
789 ;;
790 ;; Revision 1.7  1999/09/18 03:26:39  paulk
791 ;; Now prepends "file://" to doc file when invoking browse-url. Hopefully
792 ;; this will fix the problem reported by one user where the browser
793 ;; prepends http://www to doc file path.
794 ;;
795 ;; Revision 1.6  1999/08/20 00:44:43  paulk
796 ;; Corrected spelling of Phillip Lord's name.
797 ;;
798 ;; Revision 1.5  1999/06/26 00:00:12  paulk
799 ;; Type javadoc now sufficient to specify both Java 1 and Java 2 javadoc docsets.
800 ;;
801 ;; Revision 1.4  1999/06/25 01:38:17  paulk
802 ;; Enhanced to support doc collections of any type.
803 ;;
804 ;; Revision 1.3  1999/06/17 22:27:33  paulk
805 ;; Bug fix.
806 ;;
807 ;; Revision 1.2  1999/06/17 21:53:05  paulk
808 ;; Eliminated separate customization group for help variables.
809 ;;
810 ;; Revision 1.1  1999/06/17 21:47:15  paulk
811 ;; Initial revision
812 ;;
813
814 ;; End of jde-help.el