Java
Java-specific macros
A 'Go to definition' code browser macro. (Open_Selected_Class.bsh v1.3 by Steve Ewart)
Submitted by Wednesday, 12 May, 2004 - 20:08
on
Highlight a class name, run the macro and it will automatically open the source for that class.
Similar to "Go to definition" in Visual Studio. Very useful when browsing source code. Could not imagine coding Java in JEdit without this.
It can access many different source paths; your projects source, JDK source, etc. Just modify the 'searchPath' at the top of the macro to reflect where your JDK source code (or any source code) is located.
Source code for the highlighted class will be opened if:
The cursor is on a class name in any part of the file AND
there is a import for the class OR
there is a wildcard import containing the class OR
the class is in the current package (current directory) OR
the class is in the java.lang source directory (searchPath must be set)
the class is in a different project than current project (searchPath must be set)
The cursor is on a line with an import statement
A fully qualified class is highlighted (not necessarily an import statement)
Limitations:
It cannot open a file if the package cannot be appended to any part of the current file's directory structure.
It only works with java files, other languages are not supported.
Will only find (scroll to) inner classes if it is in an import.
Updated on 02/03/2007 - 23:09
Downloads: 2834
Fold Java (Fold_Java.bsh v1.10 by Robert Fletcher)
Submitted by Tuesday, 16 December, 2003 - 11:17
on
Adds explicit folds around imports, static initializers, methods, constructors and inner classes in a Java buffer. The opening folds are appropriately labelled. methods of anonymous inner classes, etc. are also folded. The only known limitation is the macro doesn't pick up methods, constructors & inner classes that are package protected (i.e. have no public|protected|private declaration).
This is basically a macro version of the LazyFolds plugin (the plugin can work for modes other than Java).
Updated on 12/18/2003 - 21:34
Downloads: 2106
getter/setter macro for Java/C++ (gettersetter.bsh v0.91 by John Gellene, Francis Dobi)
Submitted by Monday, 7 June, 2004 - 08:52
on
This is the modified version of the Make_Get_and_Set_Methods.bsh included with jEdit 4.1.
It can handle assignment in declaration. (The one provided with some jEdit versions can't handle this)
Can generate javadoc works with static and boolean fields.
See usage notes in macro.
0.91: Fixed static field recognition.
Updated on 10/24/2004 - 11:43
Downloads: 2339
Javadoc Comment Stubs (Javadoc-1.0.zip v1.0 by Craig Slusher)
Submitted by Monday, 16 August, 2004 - 04:04
on
This is a set of macros which you can use to generate Javadoc-style comments very easily. Just bind the 3 macros to some convenient keys, and you're all set!
Updated on 08/16/2004 - 04:04
Downloads: 1783
Javadoc Commenter (Write_Javadoc_Comment.bsh v1.0 by Damien Radtke)
Submitted by Monday, 9 November, 2009 - 16:42
on
This is a Java macro that writes Javadoc comments for you. It searches upwards from the cursor for a "public", "protected", or "private" keyword, requests input via a series of input boxes, and when you're finished inserts a new Javadoc-formatted comment in the correct position.
Updated on 11/09/2009 - 16:42
Downloads: 1136
javaIndent.bsh v1.0 by Pierre Grimaud
Submitted by Saturday, 21 October, 2006 - 13:53
on
This macro will ident the selected lines in the current buffer. The identation of the first line will serve as a reference.
Note that the code isn't changed, just some whitespaces added (or removed) at the beginning of each lines.
Line 38 and 67 to 81 you can configure your preferred indentation sizes.
Updated on 10/21/2006 - 13:53
Downloads: 1186
JDocs Search (JDocs_Search.bsh v1.0 by Lee Turner)
Submitted by Wednesday, 15 September, 2004 - 14:03
on
Beanshell macro to search JDocs (http://www.jdocs.com). It utilises the InfoViewer Plugin to display the jdocs page and can work a selection in the jEdit textarea or prompt you for a search item if no selection is made.
Updated on 09/15/2004 - 14:03
Downloads: 1701
Load Classes To Instantiate (Load_Classes2Instantiate.bsh v1.1 by Jakub (Kuba) Holy)
Submitted by Sunday, 6 February, 2005 - 13:57
on
Load compiled classes not on the class path whose instances you want to create.
This macro is useful for users of BeanShell - it defines a function that loads compiled classes and returns them in a hashtable.
Load classes given by the user into a Hashtable mapping full class name to Class. Either all classes under a given directory are loaded (see loadAllClassesRecurs( packageBaseDirName )) or the user is presented with a browser to select the classes to load (ctrl+click for multiple selection!!!; see loadClassesWithBrowser(view)) and then is asked to say what's the directory part of the path and what's a fully qualified name of one of the selected classes.
USAGE:
Notice: This macro is not intended to be run directly. Instead, you open it in a buffer, evaluate it and use its methods from beanshell.
See the source file for an example of a script to setup instances of classes I want to test, for help with file browser and additional info. Inside I refer to this script under the name Load_Classes2Instantiate while your is probalby named Load_Classes_To_Instantiate
CHANGELOG:
Updated the example script to load & instantiate classes to test.
Load classes given by the user into a Hashtable mapping full class name to Class. Either all classes under a given directory are loaded (see loadAllClassesRecurs( packageBaseDirName )) or the user is presented with a browser to select the classes to load (ctrl+click for multiple selection!!!; see loadClassesWithBrowser(view)) and then is asked to say what's the directory part of the path and what's a fully qualified name of one of the selected classes.
USAGE:
- Open the macro in a buffer and evaluate the buffer in beanshell to make the functions available
- theClassHashtable = loadClassFromFile();
- myClass = theClassHashtable.get("mypackage.MyClass");
- a) - no-argument constructor:
myObj = myClass.newInstance(); - b) - constructor taking an integer and string:
myObj = myClass.getConstructor(new Class[]{Integer.TYPE, String.class})
.newInstance( new Object[]{ 5, "xx" });
Notice: This macro is not intended to be run directly. Instead, you open it in a buffer, evaluate it and use its methods from beanshell.
See the source file for an example of a script to setup instances of classes I want to test, for help with file browser and additional info. Inside I refer to this script under the name Load_Classes2Instantiate while your is probalby named Load_Classes_To_Instantiate
CHANGELOG:
Updated the example script to load & instantiate classes to test.
Updated on 02/06/2005 - 17:26
Downloads: 1804
There are 480 downloads in our database