RE: BanInfo wizard anyone?

2002-12-06 Thread Nick Sieger
> >> The translation layer could handle things like the java method
> >> signature returning, say, a hashmap.  The layer could have a
> >> hashmap to alist converter.
> > 
> > I've actually got a working prototype of a generic
> > interface/translation layer that does just that.  For now, I'm
> > calling it JUCI (JDEE Universal Communication Interface).  It
> > allows elisp to call java and java to call back to elisp in a
> > standard manner.  It's still very alpha.  One (minor, IMHO)
> > drawback is that it requires JDK 1.3 or greater, because I'm
> > making use of the java.lang.reflect.Proxy mechanism.
[..elided...]
> 
> I see.  You aren't referencing the beanshell here.  Are you
> opening up a direct connection to a JVM?

Well, I didn't, but the beanshell is still directly involved.  Elisp
sends strings to the beanshell which invokes java code, and java code
invokes interfaces which, through a proxy, print lisp forms back to
stdout and are evaluated by `bsh-eval-r'.

/Nick



Help with emacs and jdee!

2002-12-06 Thread Rodrigo Coutinho Correia

hello,

i'm trying to use jde within emacs lisp, i want to call
(jde-compile) in a temp buffer and then after that, call
(bsh-eval ...) to reload this last compiled class...

the thing is that without (bsh-eval ...) everything goes
smoothly but when i insert (bsh-eval ...) things don't work!
i try to put (message ...) inside all functions that are
called with hook jde-compile-finish-hook and them doesn't seem
to be called... i'm guessing that (jde-compile) is not
synchronous or something and (bsh-eval ...) is called
before the real computation inside (jde-compile) is done!
(i'm thinkig that there is a problem with the process filters
 they change inside the jde-compile and things gets messed up
 when i call (bsh-eval ...) after (jde-compile))


but when i added (bsh-eval ...) inside the jde-compile-finish-hook
with (add-hook 'jde-compile-finish-hook '(lambda (buf msg)
(bsh-eval ...))
things seem to work... but i didn't want things like this
because this changes for all .java files and i want only for
the current .java temp file



why can something like

(progn
  (jde-compile)
  (bsh-eval (concat "reloadClasses(\""
java-temp-file-name
"\");")))

work?


thanks in advance (for anything),
rodrigo




ps: i have all last versions of required software!
emacs version 21.1
red-hat 7.3




Re: Newbie has been stuck for weeks tryig to get stop on breakpoint.

2002-12-06 Thread Andrew Hyatt

You do not need to start the program from JDE to debug it.  You can
start it any way you want (as long as it has those -Xdebug etc java
params) and attach to it.  This seems to be working for you.

First of all, don't do Display->Variable.  Just ignore the whole
Display menu.  At any rate, you can't display anything until you hit a
breakpoint.

It looks like your breakpoint is set, and is getting resolved.  It
must be valid.  Either your program simply isn't running into it (this
would happen if you set it on statup code, since you have
"suspend=n". ) or somethng else is happening.  

Everything you included looks good, so I'm guessing you probably
simply aren't running into it.  If you are getting any error in
attaching or setting the breakpoint, go to the Options menu and set it
to debug on error.  Then try again, and send the stack trace.


Christopher Mark Balz <[EMAIL PROTECTED]> writes:

> I've been posting once every 10 days for weeks, and hope someone can
> point me in the right direction.
> 
> Problem:
> ---
> Not able to get any use out of jdebug yet.
> 
> With What:
> -
> Windows 2000 Service Pack 3, Java 1.4 SDK, Tomcat 3.3 Servlet Engine,
> GNU Emacs 21.2.1, JDE 2.2.8, a web application that I'm trying to
> debug, compiled with -g option, running Tomcat from startup.bat with
> normal successful operation, have TOMCAT_OPTS set to:
>  -Xdebug -Xnoagent
> -Xrunjdwp:transport=dt_socket,address=6001,server=y,suspend=n
> 
> Description:
> ---
> I've gotten as far as successfully attaching to the Tomcat (v3.3)
> Server process.  See below for output.  The web application that I am
> trying to debug does not seem to stop at the breakpoint I set.  When I
> try to Display->Variable, I get an obscure error message referring to
> an 'unbound slot'.
> 
> Other Stuff that May Matter:
> ---
> On the JDE FAQ page, I noticed that it recommended starting the web
> server from the JDE.  Since tomcat.bat and tomcat.sh are a few hundred
> lines long, I don't know if this is the best option.  Is it necessary?
> 
> I found the simplified Tomcat startup commands in startup.sh, created
> a project file, and set the variables indicated in the FAQ entry.  But
> then on JDE->Run App, it used javaw (?I am not using AWT) and the -v
> option, which crashed the starting of the vm.  Any comments?
> 
> Thank You in Advance!
> 
> 
> Debugger Output
> ---
> 
> *** Debugger Output for Process 6001(1) ***
> 
> Attached to process on port 6001 of local host.
> Attached VM (socket) Java Debug Interface (Reference Implementation)
> version 1.4
> Java Debug Wire Protocol (Reference Implementation) version 1.4
> JVM Debug Interface version 1.2
> JVM version 1.4.0 (Java HotSpot(TM) Client VM, mixed mode)
> Running 6001.
> Setting breakpoint at line 390 in QueryOutput.java.
> Resolved breakpoint set in QueryOutput.java at line 390.
> Cleared breakpoint at line 390 in file QueryOutput.java
> Setting breakpoint at line 390 in QueryOutput.java.
> Resolved breakpoint set in QueryOutput.java at line 390.
> -- 
> ". . . / This Cabinet is formd of Gold / And Pearl & Crystal shining bright
> And within it opens into a World / . . .
> Another England there I saw / Another London with its Tower
> Another Thames & other Hills / And another pleasant Surrey Bower
> . . ."
> - from "The Crystal Cabinet", a poem by William Blake.
> 
> 
> -- 
> ". . . / This Cabinet is formd of Gold / And Pearl & Crystal shining bright
> And within it opens into a World / . . .
> Another England there I saw / Another London with its Tower
> Another Thames & other Hills / And another pleasant Surrey Bower
> . . ."
> - from "The Crystal Cabinet", a poem by William Blake.




Newbie has been stuck for weeks tryig to get stop on breakpoint.

2002-12-06 Thread Christopher Mark Balz
I've been posting once every 10 days for weeks, and hope someone can 
point me in the right direction.

Problem:
---
Not able to get any use out of jdebug yet.

With What:
-
Windows 2000 Service Pack 3, Java 1.4 SDK, Tomcat 3.3 Servlet Engine, 
GNU Emacs 21.2.1, JDE 2.2.8, a web application that I'm trying to debug, 
compiled with -g option, running Tomcat from startup.bat with normal 
successful operation, have TOMCAT_OPTS set to:
-Xdebug -Xnoagent 
-Xrunjdwp:transport=dt_socket,address=6001,server=y,suspend=n

Description:
---
I've gotten as far as successfully attaching to the Tomcat (v3.3) Server 
process.  See below for output.  The web application that I am trying to 
debug does not seem to stop at the breakpoint I set.  When I try to 
Display->Variable, I get an obscure error message referring to an 
'unbound slot'.

Other Stuff that May Matter:
---
On the JDE FAQ page, I noticed that it recommended starting the web 
server from the JDE.  Since tomcat.bat and tomcat.sh are a few hundred 
lines long, I don't know if this is the best option.  Is it necessary?

I found the simplified Tomcat startup commands in startup.sh, created a 
project file, and set the variables indicated in the FAQ entry.  But 
then on JDE->Run App, it used javaw (?I am not using AWT) and the -v 
option, which crashed the starting of the vm.  Any comments?

Thank You in Advance!


Debugger Output
---

*** Debugger Output for Process 6001(1) ***

Attached to process on port 6001 of local host.
Attached VM (socket) Java Debug Interface (Reference Implementation) 
version 1.4
Java Debug Wire Protocol (Reference Implementation) version 1.4
JVM Debug Interface version 1.2
JVM version 1.4.0 (Java HotSpot(TM) Client VM, mixed mode)
Running 6001.
Setting breakpoint at line 390 in QueryOutput.java.
Resolved breakpoint set in QueryOutput.java at line 390.
Cleared breakpoint at line 390 in file QueryOutput.java
Setting breakpoint at line 390 in QueryOutput.java.
Resolved breakpoint set in QueryOutput.java at line 390.
--
". . . / This Cabinet is formd of Gold / And Pearl & Crystal shining bright
And within it opens into a World / . . .
Another England there I saw / Another London with its Tower
Another Thames & other Hills / And another pleasant Surrey Bower
. . ."
- from "The Crystal Cabinet", a poem by William Blake.


--
". . . / This Cabinet is formd of Gold / And Pearl & Crystal shining bright
And within it opens into a World / . . .
Another England there I saw / Another London with its Tower
Another Thames & other Hills / And another pleasant Surrey Bower
. . ."
- from "The Crystal Cabinet", a poem by William Blake.



Re: optimizing imports

2002-12-06 Thread Jeffery B. Rancier
"Bibighaus, Alexander" <[EMAIL PROTECTED]> writes:

> i want to optimize my imports, for example removing duplicates, removing unused 
>packages
> etc. 
> 
>  
> 
> does JDE provide this functionality anywhere?

Type M-x jde-import TAB
Jeff





Compiling JSP

2002-12-06 Thread Glen Cordrey



Is there a way, 
using html-helper-mode with mmm mode configured for JDE support, to compile a 
jsp?
First I'm assuming 
I'd need to identify a JSP compiler to use, and I don't see a way to do so 
I suspect
the capability 
doesn't exist. If it does could someone point me to it, and if not has anyone 
written any
elisp to do 
this?
 
As a fallback I'm 
going to try using the ant jspc target, but then I'll have to include my target 
in each build.xml
I 
create.
 
Glen 
Cordrey  
Convera  
voice: (410) 740-8800 x1150   www.convera.com
fax:    (410) 740-8810
 
 


Re: BanInfo wizard anyone?

2002-12-06 Thread Galen Boyer
On Fri, 6 Dec 2002, [EMAIL PROTECTED] wrote:
> 
>> From: news [mailto:[EMAIL PROTECTED]]On Behalf Of Galen
>> Boyer Sent: Friday, December 06, 2002 8:45 AM To:
>> [EMAIL PROTECTED] Subject: Re: BanInfo wizard anyone?

[...]

>> The translation layer could handle things like the java method
>> signature returning, say, a hashmap.  The layer could have a
>> hashmap to alist converter.
> 
> I've actually got a working prototype of a generic
> interface/translation layer that does just that.  For now, I'm
> calling it JUCI (JDEE Universal Communication Interface).  It
> allows elisp to call java and java to call back to elisp in a
> standard manner.  It's still very alpha.  One (minor, IMHO)
> drawback is that it requires JDK 1.3 or greater, because I'm
> making use of the java.lang.reflect.Proxy mechanism.
> 
> My plan in the near term is to use it to try to integrate
> Transmogrify, which requires that the editor implement a 'Hook'
> interface for getting info like the current position of the
> cursor, list of files in the project, etc.
> 
> Calling java from elisp is straightforward; you create a java
> interface containing the methods you wish to call from elisp
> and an implementation of that interface that has a default
> constructor:
> 
> public interface MyHelper {
>   Object doSomething(Object arg);
> }
> 
> public class MyHelperImpl implements MyHelper {
>   public MyHelperImpl() {}
> 
>   public Object doSomething(Object arg) {
> // ...
>   }
> }
> 
> On the elisp side, all you would need to do is declare a defun
> like this:
> 
> (defun my-helper-do-something (arg)
>   (jde-juci-invoke-java "MyHelperImpl" "doSomething"))
> 
> 
> For java code that calls elisp, you declare just an interface.
> On the elisp side, you implement that interface by creating a
> defun with a name following certain conventions and a matching
> arglist:
> 
> public interface MyPrompt {
>   String getUserInput();
> }
> 
> (defun my-prompt-get-user-input ()
>   (read-from-minibuffer "Input: "))
> 
> 
> // java code that invokes elisp
> 
>   Prompt prompt = (Prompt)
> jde.juci.ConnectionFactory.getConnection(MyPrompt.class);
>   String result = promt.getUserInput();
> 
> This will cause emacs to enter the minibuffer, capture the
> user-entered string, and return it to the java code.
> 
> My hope is that the JDEE community will find this approach
> useful and that I can find enough time to clean up the code,
> document it and make it robust.  I'd appreciate any feedback.

I see.  You aren't referencing the beanshell here.  Are you
opening up a direct connection to a JVM?

-- 
Galen Boyer





RE: BanInfo wizard anyone?

2002-12-06 Thread Nick Sieger
> From: news [mailto:[EMAIL PROTECTED]]On Behalf Of Galen Boyer
> Sent: Friday, December 06, 2002 8:45 AM
> To: [EMAIL PROTECTED]
> Subject: Re: BanInfo wizard anyone?
> 
> 
> On Fri, 6 Dec 2002, [EMAIL PROTECTED] wrote:
> > Another idea would be to add options to the jde-jeval
> > function or new commands to
> > 
> >   * evaluate a bsh expression (e.g., a script invocation)
> > and insert the result in a new Java source buffer
> > 
> >   * evaluate a bsh expression and insert the result at
> > point in the current buffer
> > 
> > This would make it easey for users who are not proficient
> > in Lisp to use BeanShell scripts (i.e., Java) to
> > generate Java source code inside Emacs.
> 
> Maybe there could be a translation layer from beanshell/java to
> elisp?  If this were in place, the call for java help from the
> non-elisp guy could go something like, you could present a java
> interface that you would like implemented by someone.  They could
> run off and code java and hand back their code.  Your interface
> could then run through your beanshell-to-elisp translation layer
> and the elisp guys could make it happen in Emacs.
> 
> The translation layer could handle things like the java method
> signature returning, say, a hashmap.  The layer could have a
> hashmap to alist converter.

I've actually got a working prototype of a generic interface/translation
layer that does just that.  For now, I'm calling it JUCI (JDEE Universal
Communication Interface).  It allows elisp to call java and java to call
back to elisp in a standard manner.  It's still very alpha.  One (minor,
IMHO) drawback is that it requires JDK 1.3 or greater, because I'm
making use of the java.lang.reflect.Proxy mechanism.

My plan in the near term is to use it to try to integrate Transmogrify,
which requires that the editor implement a 'Hook' interface for getting
info like the current position of the cursor, list of files in the
project, etc.

Calling java from elisp is straightforward; you create a java interface
containing the methods you wish to call from elisp and an implementation
of that interface that has a default constructor:

public interface MyHelper {
  Object doSomething(Object arg);
}

public class MyHelperImpl implements MyHelper {
  public MyHelperImpl() {}

  public Object doSomething(Object arg) {
// ...
  }
}

On the elisp side, all you would need to do is declare a defun like
this:

(defun my-helper-do-something (arg)
  (jde-juci-invoke-java "MyHelperImpl" "doSomething"))


For java code that calls elisp, you declare just an interface.  On the
elisp side, you implement that interface by creating a defun with a name
following certain conventions and a matching arglist:

public interface MyPrompt {
  String getUserInput();
}

(defun my-prompt-get-user-input ()
  (read-from-minibuffer "Input: "))


// java code that invokes elisp

  Prompt prompt = (Prompt)
jde.juci.ConnectionFactory.getConnection(MyPrompt.class);
  String result = promt.getUserInput();

This will cause emacs to enter the minibuffer, capture the user-entered
string, and return it to the java code.

My hope is that the JDEE community will find this approach useful and
that I can find enough time to clean up the code, document it and make
it robust.  I'd appreciate any feedback.

> Then, also, there could be cool things like Elisp debugging
> switching to java debugging when the debugger hits the
> translation layer.

Whoa, there.  Cool idea, but more than I can digest right now :)

/Nick



Re[2]: Senator->Analyze->Speedbar Class Browser error

2002-12-06 Thread Eric M. Ludlam
>>> Raul Acevedo <[EMAIL PROTECTED]> seems to think that:
>Eric M. Ludlam wrote:
>
> > >If I select Senator -> Analyze -> Speedbar Class Browser, I get an
> > >error: "Symbol's function definition is void:
> > >semanticdb-find-nonterminal-by-token".  Any ideas what this is about?
> > 
> >   You need have semanticdb enabled for that class browser to work.
> >   This commonly is enabled when you have
> >   `semantic-turn-useful-things-on' set when you installed semantic.
>
>I have (setq semantic-load-turn-everything-on t) enabled, presumably
>that's what I need.  Is this correct?
>
> >   The program you found is supposed to show your classes, and the
> >   inheritance between them.  It only works after semanticdb has
> >   "seen" all the files you are interested in so it can correlate the
> >   tags.  My copy in CVS seems to have developed a speedbar refresh
> >   problem.  I'll have to investigate more.
>
>How do I get semanticdb to do this?

If semanticdb is enabled (Use `global-semanticdb-minor-mode' to toggle
it on and off)  All you have to do then is visit those files you care
about in an Emacs buffer.  Semanticdb takes care of the rest.

> >   A future version of semantic will have a bridge API enabling the
> >   possibility of semantic programs querying .class files via whatever
> >   mechanism some JDE hacker may choose to use.
>
>Well, I have no idea what that means, but it sounds cool.   :)
  [ ... ]

That was a reminder to those developing cool new JDEE features that
I'm thinking about them, and want to make their lives easier.

Eric

-- 
  Eric Ludlam: [EMAIL PROTECTED], [EMAIL PROTECTED]
   Home: http://www.ludlam.netSiege: www.siege-engine.com
Emacs: http://cedet.sourceforge.net   GNU: www.gnu.org



Re: BanInfo wizard anyone?

2002-12-06 Thread Galen Boyer
On Fri, 6 Dec 2002, [EMAIL PROTECTED] wrote:
> Another idea would be to add options to the jde-jeval
> function or new commands to
> 
>   * evaluate a bsh expression (e.g., a script invocation)
> and insert the result in a new Java source buffer
> 
>   * evaluate a bsh expression and insert the result at
> point in the current buffer
> 
> This would make it easey for users who are not proficient
> in Lisp to use BeanShell scripts (i.e., Java) to
> generate Java source code inside Emacs.

Maybe there could be a translation layer from beanshell/java to
elisp?  If this were in place, the call for java help from the
non-elisp guy could go something like, you could present a java
interface that you would like implemented by someone.  They could
run off and code java and hand back their code.  Your interface
could then run through your beanshell-to-elisp translation layer
and the elisp guys could make it happen in Emacs.

The translation layer could handle things like the java method
signature returning, say, a hashmap.  The layer could have a
hashmap to alist converter.

Then, also, there could be cool things like Elisp debugging
switching to java debugging when the debugger hits the
translation layer.

-- 
Galen Boyer





RE: Problem saving key-bindings

2002-12-06 Thread Olle Sundblad
Should maybe have mentioned that I use jde v2.3.0

/Olle

> -Original Message-
> From: Olle Sundblad [mailto:[EMAIL PROTECTED]]
> Sent: den 6 december 2002 17:03
> To: [EMAIL PROTECTED]
> Subject: Problem saving key-bindings
>
>
> Hi,
>
> I encountered a problem when I tried to set some personal key-bindings. It
> wouldn't save and after some trying and searching I think I found
> the cause:
> line 135 in jde.el refers to an undefiend function
> jde-db-menu-debug-applet.
>
>...
>(cons "[?\C-c ?\C-v ?\C-t]" 'jde-db-menu-debug-applet)
>...
>
> I couldn't find any other references to that funciton in any other elisp
> files so I guess the line should just be deleted, and after doing that
> everything started working.
>
>
> /Olle
>
>
>




Problem saving key-bindings

2002-12-06 Thread Olle Sundblad
Hi,

I encountered a problem when I tried to set some personal key-bindings. It
wouldn't save and after some trying and searching I think I found the cause:
line 135 in jde.el refers to an undefiend function jde-db-menu-debug-applet.

   ...
   (cons "[?\C-c ?\C-v ?\C-t]" 'jde-db-menu-debug-applet)
   ...

I couldn't find any other references to that funciton in any other elisp
files so I guess the line should just be deleted, and after doing that
everything started working.


/Olle




optimizing imports

2002-12-06 Thread Bibighaus, Alexander



i want to optimize 
my imports, for example removing duplicates, removing unused packages etc.  

 
does JDE provide 
this functionality anywhere?


Re: BeanInfo wizard anyone?

2002-12-06 Thread Ole Arndt
Christian Mercat <[EMAIL PROTECTED]> writes:

>  >  > http://www.entrelacs.net/home/Java/beanInfoMaker.html
>  >  > http://www.entrelacs.net/home/Java/beanInfoMaker.bsh
>  >  >
>  >  > I have no idea how to make it work from within JDE,
>  >
>  > Put the beanInfoMaker.bsh script in the
>  > jde/java/bsh-commands/bsh/commands/ directory. Start the BeanShell
>  > (M-x bsh) and enter the beanInfoMaker command at the BeanShell command
>  > line in the BeanShell, e.g.,
>  >
>  > % beanInfoMaker("mybeans.MyBean");
>  >
>  > The ability to easily write and run Java scripts from within
>  > Emacs is one of the more little known and appreciated features of the
>  > JDEE.
> 
>  ...
> I don't know how to make a wizard out of this script, that is get the
> buffer name MyClass.java, create a new buffer name MyClassBeanInfo.java
> and yank the result of the script into it. Without having to type
> anything in the bsh, like a proper wizard should do. That's what I
> meant.

Ok, quick `n dirty:

(defun jde-gen-beaninfo (classname)
  "Generate a beaninfo class for the given full qualified classname."
  (interactive "sEnter classname: ")
  (let ((class (concat classname ".class"))
(filename (jde-open-get-java-file-name (concat classname "BeanInfo"
(find-file filename)
(jde-gen-call-bsh (concat "beanInfoMaker(" class ")"

(defun jde-gen-call-bsh (command)
  "call `command' in the beanshell and insert result at point."
  (interactive "sCommand: ")
  (insert (jde-jeval (concat "print(" command ");") nil)))


put this in your .emacs or wherever, then type "M-x jde-gen-beaninfo".

Ole

-- 
Ole Arndt http://www.cegedim-deutschland.de
---
Living on Earth may be expensive, but it includes an annual free trip
around the Sun.





Re: BanInfo wizard anyone?

2002-12-06 Thread Paul Kinnucan
Paul Kinnucan writes:
 > Hi Christian,
 > 
 > The basic trick to integrating a bsh script with the
 > JDEE is to have the script write a Lisp form to
 > standard out and then invoke the script via the JDEE's
 > jde-eval function. The jde-eval function sends 
 > an arbitrary beanshell expresion via standard I/O
 > to the beanshell and then evaluates the response,
 > assuming that it is a Lisp form. For example, in
 > your case, you would have to modify your script to
 > print its result instead of returning the result
 > as a string. Then, you could write the following
 > Lisp:
 > 
 > (defun make-bean-info (class) 
 >   (interactive)
 >(let ((info-src
 > (jde-eval 
 > (concat "makeBeanInfo(\" class "\");"
 > (message info-src)))
 > 

Actually the name of the function is jde-jeval-r.

 > This function generates the bean info source and
 > displays it in the minibuffer. Obviously, it be
 > better to create it in a new source buffer, which
 > is easily done but I just wanted to illustrate
 > the basic idea. There are lots of examples in the
 > JDE lisp code base, e.g., in jde-wiz.el and
 > jde-gen.el, of how to create source buffers via
 > Lisp.
 > 
 > As a result of your email, I'm now thinking of renaming and
 > restructuring the beanshell script directory (presently
 > java/bsh_commands as follows
 > 
 > java
 >   bsh_scripts
 > bsh
 >   commands
 >   jde_scripts
 > 
 > The commands subdirectory would contain scripts
 > intended to be run as commands from the bsh
 > command line. The jde_scripts directory would
 > contain scripts used to implement functionality
 > invoked via jde-eval. The directories would
 > facilitate command-line and jde-eval versions of the
 > same script.

Another idea would be to add options to the jde-jeval
function or new commands to

  * evaluate a bsh expression (e.g., a script invocation)
and insert the result in a new Java source buffer

  * evaluate a bsh expression and insert the result at
point in the current buffer

This would make it easey for users who are not proficient
in Lisp to use BeanShell scripts (i.e., Java) to
generate Java source code inside Emacs.

- Paul

 > 
 > Hope this helps.
 > 
 > - Paul
 > 
 > Christian Mercat writes:
 >  > >  > http://www.entrelacs.net/home/Java/beanInfoMaker.html
 >  > >  > http://www.entrelacs.net/home/Java/beanInfoMaker.bsh
 >  > >  > 
 >  > >  > I have no idea how to make it work from within JDE, 
 >  > > 
 >  > > Put the beanInfoMaker.bsh script in the
 >  > > jde/java/bsh-commands/bsh/commands/ directory. Start the BeanShell
 >  > > (M-x bsh) and enter the beanInfoMaker command at the BeanShell command
 >  > > line in the BeanShell, e.g.,
 >  > > 
 >  > > % beanInfoMaker("mybeans.MyBean");
 >  > > 
 >  > > The ability to easily write and run Java scripts from within
 >  > > Emacs is one of the more little known and appreciated features of the
 >  > > JDEE.
 >  > 
 >  > I use this feature absolutely _everyday_ and I love it very dearly, it's 
 >  > so mighty and powerful! Thanks again for giving it to us (and thanks to 
 >  > Pat Niemeyer, a great benefactor for us, I always light up a candle for 
 >  > him). The point I wanted to make is:
 >  > 
 >  > I don't know how to make a wizard out of this script, that is get the 
 >  > buffer name MyClass.java, create a new buffer name MyClassBeanInfo.java 
 >  > and yank the result of the script into it. Without having to type 
 >  > anything in the bsh, like a proper wizard should do. That's what I meant.
 >  > 
 >  > Another thing about the BeanShell, I said that jedit revolves around it, 
 >  > basically everything you do is a message sent to the buffer object 
 >  > through the bsh. Their community has created a wealth of scripts (in 
 >  > bsh, that is in loosely typed java) which emulate (really) most of the 
 >  > behaviours I love in JDE. We might have a look how to interface their 
 >  > work into JDE through the bsh to add functionalities without lisp. I 
 >  > mean I don't know how to send e-lisp commands to emacs from the bsh. If 
 >  > I could, then I would be able to make really powerful things without 
 >  > lisp, in plain java. But then I may as well switch to jedit altogether 
 >  > ;-) I won't, just teasing!
 >  > 
 >  > Christian Mercat
 >  > 
 >  > 
 >  > 




Re: BanInfo wizard anyone?

2002-12-06 Thread Paul Kinnucan
Hi Christian,

The basic trick to integrating a bsh script with the
JDEE is to have the script write a Lisp form to
standard out and then invoke the script via the JDEE's
jde-eval function. The jde-eval function sends 
an arbitrary beanshell expresion via standard I/O
to the beanshell and then evaluates the response,
assuming that it is a Lisp form. For example, in
your case, you would have to modify your script to
print its result instead of returning the result
as a string. Then, you could write the following
Lisp:

(defun make-bean-info (class) 
  (interactive)
   (let ((info-src
(jde-eval 
(concat "makeBeanInfo(\" class "\");"
(message info-src)))

This function generates the bean info source and
displays it in the minibuffer. Obviously, it be
better to create it in a new source buffer, which
is easily done but I just wanted to illustrate
the basic idea. There are lots of examples in the
JDE lisp code base, e.g., in jde-wiz.el and
jde-gen.el, of how to create source buffers via
Lisp.

As a result of your email, I'm now thinking of renaming and
restructuring the beanshell script directory (presently
java/bsh_commands as follows

java
  bsh_scripts
bsh
  commands
  jde_scripts

The commands subdirectory would contain scripts
intended to be run as commands from the bsh
command line. The jde_scripts directory would
contain scripts used to implement functionality
invoked via jde-eval. The directories would
facilitate command-line and jde-eval versions of the
same script.

Hope this helps.

- Paul

Christian Mercat writes:
 > >  > http://www.entrelacs.net/home/Java/beanInfoMaker.html
 > >  > http://www.entrelacs.net/home/Java/beanInfoMaker.bsh
 > >  > 
 > >  > I have no idea how to make it work from within JDE, 
 > > 
 > > Put the beanInfoMaker.bsh script in the
 > > jde/java/bsh-commands/bsh/commands/ directory. Start the BeanShell
 > > (M-x bsh) and enter the beanInfoMaker command at the BeanShell command
 > > line in the BeanShell, e.g.,
 > > 
 > > % beanInfoMaker("mybeans.MyBean");
 > > 
 > > The ability to easily write and run Java scripts from within
 > > Emacs is one of the more little known and appreciated features of the
 > > JDEE.
 > 
 > I use this feature absolutely _everyday_ and I love it very dearly, it's 
 > so mighty and powerful! Thanks again for giving it to us (and thanks to 
 > Pat Niemeyer, a great benefactor for us, I always light up a candle for 
 > him). The point I wanted to make is:
 > 
 > I don't know how to make a wizard out of this script, that is get the 
 > buffer name MyClass.java, create a new buffer name MyClassBeanInfo.java 
 > and yank the result of the script into it. Without having to type 
 > anything in the bsh, like a proper wizard should do. That's what I meant.
 > 
 > Another thing about the BeanShell, I said that jedit revolves around it, 
 > basically everything you do is a message sent to the buffer object 
 > through the bsh. Their community has created a wealth of scripts (in 
 > bsh, that is in loosely typed java) which emulate (really) most of the 
 > behaviours I love in JDE. We might have a look how to interface their 
 > work into JDE through the bsh to add functionalities without lisp. I 
 > mean I don't know how to send e-lisp commands to emacs from the bsh. If 
 > I could, then I would be able to make really powerful things without 
 > lisp, in plain java. But then I may as well switch to jedit altogether 
 > ;-) I won't, just teasing!
 > 
 > Christian Mercat
 > 
 > 
 > 




Re: BeanInfo wizard anyone?

2002-12-06 Thread Christian Mercat
>  > http://www.entrelacs.net/home/Java/beanInfoMaker.html
>  > http://www.entrelacs.net/home/Java/beanInfoMaker.bsh
>  >
>  > I have no idea how to make it work from within JDE,
>
> Put the beanInfoMaker.bsh script in the
> jde/java/bsh-commands/bsh/commands/ directory. Start the BeanShell
> (M-x bsh) and enter the beanInfoMaker command at the BeanShell command
> line in the BeanShell, e.g.,
>
> % beanInfoMaker("mybeans.MyBean");
>
> The ability to easily write and run Java scripts from within
> Emacs is one of the more little known and appreciated features of the
> JDEE.

I use this feature absolutely _everyday_ and I love it very dearly, it's
so mighty and powerful! Thanks again for giving it to us (and thanks to
Pat Niemeyer, a great benefactor for us, I always light up a candle for
him). The point I wanted to make is:

I don't know how to make a wizard out of this script, that is get the
buffer name MyClass.java, create a new buffer name MyClassBeanInfo.java
and yank the result of the script into it. Without having to type
anything in the bsh, like a proper wizard should do. That's what I meant.

Another thing about the BeanShell, I said that jedit revolves around it,
basically everything you do is a message sent to the buffer object
through the bsh. Their community has created a wealth of scripts (in
bsh, that is in loosely typed java) which emulate (really) most of the
behaviours I love in JDE. We might have a look how to interface their
work into JDE through the bsh to add functionalities without lisp. I
mean I don't know how to send e-lisp commands to emacs from the bsh. If
I could, then I would be able to make really powerful things without
lisp, in plain java. But then I may as well switch to jedit altogether
;-) I won't, just teasing!

Christian Mercat

PS Sorry Paul I intended to send it solely to the list.