;;; ecb-jde.el: ECB JDE integrations
;; Copyright (C) 2003 Jesper Nordenberg
;; Copyright (C) 2003 Free Software Foundation, Inc.
;; Copyright (C) 2003 Klaus Berndl <firstname.lastname@example.org>
;; Author: Klaus Berndl <email@example.com>
;; Maintainer: Klaus Berndl <firstname.lastname@example.org>
;; Keywords: java, class, browser
;; This program is free software; you can redistribute it and/or modify it
;; under the terms of the GNU General Public License as published by the Free
;; Software Foundation; either version 2, or (at your option) any later
;; This program is distributed in the hope that it will be useful, but WITHOUT
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
;; more details.
;; You should have received a copy of the GNU General Public License along
;; with GNU Emacs; see the file COPYING. If not, write to the Free Software
;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
;; Contains code for JDEE integrations into ECB or vice versa
;; JDEE is available at http://jdee.sunsite.dk/
;; For the ChangeLog of this file see the CVS-repository. For a complete
;; history of the ECB-package see the file NEWS.
(defun ecb-jde-display-class-at-point ()
"Displays in the ECB-methods-buffer the contents \(methods, attributes
etc...) of the class which contains the definition of the \"thing\" under
point \(this can be a variablename, classname, methodname, attributename).
This function needs the same requirements to work as the method-completion
feature of JDE \(see `jde-complete-at-point')!. The source-file is searched
first in `jde-sourcepath', then in `jde-global-classpath', then in $CLASSPATH,
then in current-directory.
Works only for classes where the source-code \(i.e. the *.java-file) is
(when (and ecb-minor-mode
(equal major-mode 'jde-mode))
(thing-of-interest (thing-at-point 'symbol))
(pair (save-excursion (end-of-thing 'symbol)
(if (and class-to-open (stringp class-to-open))
(setq java-file-name (jde-open-find-java-file-name
(if (not java-file-name)
(ecb-error "Can not find the sourcecode-file for \"%s\""
;; TODO: Klaus Berndl <email@example.com>:
;; The following two lines of code are the only difference
;; between this function and `jde-open-class-at-point'.
;; Therefore it would be nice if the whole stuff necessary
;; for finding the source-file of `thing-of-interest' would
;; be extracted in an own function of JDE.
;; we have found the java-sourcefile. So let�s display its
;; contents in the method-buffer of ECB
(ecb-set-selected-source java-file-name nil t))))
(ecb-error "Can not parse the thing at point!")))
(message "You need JDE >= 2.2.6 and Senator for using this feature!"))))
(defun ecb-jde-show-class-source (unqual-class)
"Calls `jde-show-class-source' for UNQUAL-CLASS and returns t if no error
(when (eq major-mode 'jde-mode)
(defun ecb-jde-open-class-at-point-ff-function (filename &optional wildcards)
"Special handling of the class opening at point JDE feature. This function
calls the value of `jde-open-class-at-point-find-file-function' with activated
(if (and (boundp 'jde-open-class-at-point-find-file-function)
(defun ecb-jde-gen-class-buffer (dir filename)
"Calls `jde-gen-class-buffer' for the file FILENAME in DIR. If this function
is not available then `find-file' is called."
(let ((file (concat dir "/" filename)))
(if (fboundp 'jde-gen-class-buffer)
(when (locate-library "efc")
(if (boundp 'efc-dialog-show-before-hook)
(function (lambda ()
(if (boundp 'efc-dialog-close-after-hook)
(function (lambda ()
;;; ecb-jde.el ends here