jEdit Community - Resources for users of the jEdit Text Editor

Java

Java-specific macros


A 'Go to definition' code browser macro. (Open_Selected_Class.bsh v1.3 by Steve Ewart)
Submitted by sewart on Wednesday, 12 May, 2004 - 20:08
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: 2830

Fold Java (Fold_Java.bsh v1.10 by Robert Fletcher)
Submitted by rfletch6 on Tuesday, 16 December, 2003 - 11:17
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: 2104

getter/setter macro for Java/C++ (gettersetter.bsh v0.91 by John Gellene, Francis Dobi)
Submitted by francisdobi on Monday, 7 June, 2004 - 08:52
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: 2336

Javadoc Comment Stubs (Javadoc-1.0.zip v1.0 by Craig Slusher)
Submitted by sleek on Monday, 16 August, 2004 - 04:04
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: 1780

Javadoc Commenter (Write_Javadoc_Comment.bsh v1.0 by Damien Radtke)
Submitted by kog on Monday, 9 November, 2009 - 16:42
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: 1134

javaIndent.bsh v1.0 by Pierre Grimaud
Submitted by pieroxy on Saturday, 21 October, 2006 - 13:53
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: 1182

JDocs Search (JDocs_Search.bsh v1.0 by Lee Turner)
Submitted by lturner on Wednesday, 15 September, 2004 - 14:03
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: 1699

Load Classes To Instantiate (Load_Classes2Instantiate.bsh v1.1 by Jakub (Kuba) Holy)
Submitted by malyvelky on Sunday, 6 February, 2005 - 13:57
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:
  1. Open the macro in a buffer and evaluate the buffer in beanshell to make the functions available
  2. theClassHashtable = loadClassFromFile();
  3. myClass = theClassHashtable.get("mypackage.MyClass");
  4. a) - no-argument constructor:
    myObj = myClass.newInstance();
  5. 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: 1800

There are 480 downloads in our database
User login
Browse archives
« April 2024  
MoTuWeThFrSaSu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   82348
Context Free Art (*.cfdg)   0.31   46055
JBuilder scheme   .001   18495
BBEdit scheme   1.0   18116
ColdFusion scheme   1.0   18024
R Edit Mode - extensive version   0.1   17473
Advanced HTML edit mode   1.0   16206
Matlab Edit Mode   1.0   16068
jEdit XP icons   1.0   15229
XP icons for jEdit   1.1   14293