[9d1ab0]: docs / LazyImporter.html Maximize Restore History

Download this file

LazyImporter.html    707 lines (615 with data), 27.9 kB

  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
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.08 [en] (WinNT; U) [Netscape]">
<TITLE>LazyImporter Plugin</TITLE>
<!-- LazyImporter - jEdit Importing made easy! -->
</HEAD>
<BODY BGCOLOR="#FFFFFF">
&nbsp;
<TABLE BORDER=0 CELLSPACING=0 COLS=2 WIDTH="100%" BGCOLOR="#CCCCFF" summary="Header" >
<TR width="100%">
<TD VALIGN=TOP><B><FONT SIZE=+2>LazyImporter</FONT></B></TD>
<TD ALIGN=RIGHT VALIGN=TOP><B><FONT SIZE=-1>Version 1.07 (Aug 12, 2004)</FONT></B>
<BR><FONT SIZE=-1>By Matt Etheridge &lt;matt@etheridge.org>&nbsp;</FONT></TD>
</TR>
</TABLE>
<UL>
<LI>
<A HREF="#intro">Introduction</A></LI>
<LI>
<A HREF="#Using the LazyImporter Actions">Using the LazyImporter Actions</A></LI>
<LI>
<A HREF="#LazyImporter Options">LazyImporter Options</A></LI>
<LI>
<A HREF="#changes">Recent Changes</A></LI>
<LI>
<A HREF="#todo">To Do</A></LI>
<LI>
<A HREF="#feedback">Feedback</A></LI>
<LI>
<A HREF="#Notes">Notes</A></LI>
</UL>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=3 WIDTH="100%" summary="Introduction" >
<TR ALIGN=CENTER width="100%">
<TD WIDTH="100%" BGCOLOR="#7FB2FF"><A NAME="intro"></A><B><FONT COLOR="#FFFFFF"><FONT SIZE=+1>Introduction</FONT></FONT></B></TD>
</TR>
</TABLE>
<P>The LazyImporter plug-in provides useful tools for generating, organizing
and sorting import statements in a Java source file in JEdit.&nbsp; Actions
available include:
<UL>
<LI>
<A HREF="#Resolve Wildcard Imports">Resolving wildcard (package) imports</A></LI>
<LI>
<A HREF="#Remove Unused Imports">Remove unused imports</A></LI>
<LI>
<A HREF="#Resolve and Insert Missing Imports">Resolve and insert missing
imports</A></LI>
<LI>
<A HREF="#Convert Imports to Wildcard Imports">Convert imports to wildcard
(package) imports</A></LI>
<LI>
<A HREF="#Find Selected Import In Classpath">Find selected import in classpath</A></LI>
<LI>
<A HREF="#Import Class Under Cursor">Import class under cursor</A></LI>
<LI>
<A HREF="#QuickImport">QuickImport</A></LI>
</UL>
The grouping and sorting of the import statements can be configured.&nbsp;
Whenever the import statements are redrawn (most actions will do this),
they will be sorted and grouped according to the user's configuration.&nbsp;
This is described in more detail <A HREF="#LazyImporter Options">below</A>.
<P>This version requires (at least):
<UL>
<LI>
JDK 1.4.0</LI>
<LI>
jEdit 4.0 final</LI>
</UL>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=3 WIDTH="100%" summary="Tree Display" >
<TR ALIGN=CENTER width="100%">
<TD WIDTH="100%" BGCOLOR="#7FB2FF"><A NAME="Using the LazyImporter Actions"></A><B><FONT COLOR="#FFFFFF"><FONT SIZE=+1>Using
the LazyImporter Actions</FONT></FONT></B></TD>
</TR>
</TABLE>
<P>This section describes each of the tools provided by the LazyImporter
plugin in more detail.&nbsp; Each of these actions has a menu item by default,
but you can also add keyboard shortcuts for each of these actions (highly
recommended, especially for those actions used often).&nbsp; Note that
these actions will only work if the currently browsed file in JEdit is
a *.java file.
<P>NOTE: some actions work best when the Java file you are working on actually
compiles.&nbsp; These will be pointed out below.
<BR>&nbsp;
<P><A NAME="Resolve Wildcard Imports"></A><B><FONT SIZE=+1>Resolve Wildcard
Imports</FONT></B>
<P>This action attempts to resolve any wildcard (package) imports that
are present in the current Java source file.&nbsp; For example, if I had
the import:
<PRE><TT>&nbsp;&nbsp;&nbsp; import java.io.*;</TT></PRE>
and I was using the <TT>java.io.File</TT>, <TT>java.io.FileFilter</TT>
and <TT>java.io.IOException</TT> classes in the current Java source file,
invoking this action would replace the above wildcard import with the following:
<PRE><TT>&nbsp;&nbsp;&nbsp; import java.io.File;
&nbsp;&nbsp;&nbsp; import java.io.FileFilter;
&nbsp;&nbsp;&nbsp; import java.io.IOException;</TT></PRE>
When resolving these wildcard imports, the LazyImporter plugin uses the
classpath specified in the LazyImporter ClassPath options panel.&nbsp;
This is explained in more detail later.
<P>This action may not resolve the wildcard imports correctly if the class
does not compile.&nbsp; For example, if I had two import statements as
follows:
<PRE><TT>&nbsp;&nbsp;&nbsp; import java.util.*;
&nbsp;&nbsp;&nbsp; import java.awt.*;</TT></PRE>
and in the current Java source code I was using both java.util.List and
java.awt.List, the class will NOT compile because the imports are ambiguous.&nbsp;
If this action is invoked in this scenario, unpredictable import resolutions
will occur.
<P><I>NOTE: in this situation you can use the "Import Class Under Cursor"
action to explicitly choose which import statements to add to the class.</I>
<BR>&nbsp;
<P><A NAME="Remove Unused Imports"></A><B><FONT SIZE=+1>Remove Unused Imports</FONT></B>
<P>This action looks at all <I>explicit imports </I>(these are import statements
that import a class, not a wildcard (.*) package import) that are currently
in the Java source code, and removes those that are not used.&nbsp; As
with resolving wildcard imports, the LazyImporter plugin uses the classpath
specified in the LazyImport ClassPath options panel.
<BR>&nbsp;
<P><A NAME="Resolve and Insert Missing Imports"></A><B><FONT SIZE=+1>Resolve
and Insert Missing Imports</FONT></B>
<P>This action attempts to find any import statements that are missing
and, if any are found, will insert the import statements into the Java
source.&nbsp; The algorithm used to find any missing imports only searches
in those packages that are already imported (both explicit and wildcard
imports).&nbsp; If classes are being imported from many different packages,
this action could take a while.
<P>Of course, if your class compiles it means you have NO missing import
statements, so this action is not for that case.&nbsp; This action should
generally be used when you are importing multiple classes from packages
you already have explicit import statements for.&nbsp; So, if you use another
class from these packages, you can use this action to quickly resolve and
insert the import statement.
<P><I>NOTE: you can also use the "Import Class Under Cursor" action to
explicitly import a class.</I>
<BR>&nbsp;
<P><A NAME="Convert Imports to Wildcard Imports"></A><B><FONT SIZE=+1>Convert
Imports to Wildcard Imports</FONT></B>
<P>This action converts any explicit class imports to wildcard (package)
imports.&nbsp; For example, if I had the following imports:
<PRE><TT>&nbsp;&nbsp;&nbsp; import java.util.Date;
&nbsp;&nbsp;&nbsp; import java.util.StringBuffer;
&nbsp;&nbsp;&nbsp; import java.io.IOException;
&nbsp;&nbsp;&nbsp; import java.io.File;</TT></PRE>
this action would remove the explicit imports and insert the following
import statements:
<P><TT>&nbsp;&nbsp;&nbsp; import java.util.*;</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; import java.io.*;</TT>
<BR>&nbsp;
<P><A NAME="Find Selected Import In Classpath"></A><B><FONT SIZE=+1>Find
Selected Import In Classpath</FONT></B>
<P>If the cursor is currently over an import statement this action, when
invoked, displays the element(s) in the classpath where this class could
be imported from.&nbsp; The <I>first</I> element in the classpath will
be highlighted, as this is the one that will actually be used to load the
class.&nbsp; Subsequent classpath elements where this class is found are
also listed.
<P>For example, if the cursor was currently anywhere within the bounds
of the following import statement:
<PRE><TT>&nbsp;&nbsp;&nbsp; import java.util.Date;</TT></PRE>
a pop-up message window will appear showing the classpath element that
this class was imported from such as "<TT>D:\jdk1.3.1\jre\lib\rt.jar</TT>"
or "<TT>D:\classes</TT>".
<P>An example pop-up window is shown below:
<CENTER>
<P><IMG SRC="images/import-under-cursor.jpg" NOSAVE BORDER=0 HEIGHT=225 WIDTH=422></CENTER>
<P><I>NOTE: this action currently only works for explicit class imports!</I>
<BR>&nbsp;
<P><A NAME="Import Class Under Cursor"></A><B><FONT SIZE=+1>Import Class
Under Cursor</FONT></B>
<P>When the cursor is currently over a class name (ie. <I>List, StringBuffer</I>)
this action, when invoked, displays a pop-up list of possible imports (if
any are found).&nbsp; An import statement can be selected from the popup
list by pressing <TT>&lt;enter></TT> or double-clicking.&nbsp; The selected
import statement will be inserted into the class at the correct position.
<P>An example screenshot of the pop-up list of imports is shown below:
<CENTER><IMG SRC="images/popup-import-window.jpg" NOSAVE BORDER=0 HEIGHT=240 WIDTH=343></CENTER>
<P>If this action is invoked, and only <I>one</I> possible import statement
is found, this action can be configured insert the import statement without
popping up the list of imports (which would only have one import statement
anyway).&nbsp; This can be configured via the "Miscellaneous Options Panel".
<BR>&nbsp;
<P><A NAME="QuickImport"></A><B><FONT SIZE=+1>QuickImport</FONT></B>
<P>This action is really just a collection of some of the above actions
so that they can be performed in one hit, instead of invoking multiple
actions.&nbsp; The actions that are performed when you do a QuickImport
can be one (or more) of the following actions:
<UL>
<LI>
<A HREF="#Resolve Wildcard Imports">Resolve Wildcard Imports</A></LI>
<LI>
<A HREF="#Remove Unused Imports">Remove Unused Imports</A></LI>
<LI>
<A HREF="#Resolve and Insert Missing Imports">Resolve and Insert Missing
Imports</A></LI>
</UL>
The actions performed during a QuickImport can be specified in the "QuickImport
Options Pane".
<P><I>HINT: if you simply want to draw (and hence reorder and group your
imports according to your configuration) you can uncheck all of the above
three actions in the QuickImport Options pane.</I>
<BR>&nbsp;
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=3 WIDTH="99%" summary="JBrowse controls" >
<TR ALIGN=CENTER width="100%">
<TD WIDTH="100%" BGCOLOR="#7FB2FF"><A NAME="LazyImporter Options"></A><B><FONT COLOR="#FFFFFF"><FONT SIZE=+1>LazyImporter
Options</FONT></FONT></B></TD>
</TR>
</TABLE>
<P>The actions performed by the LazyImporter plugin are highly configurable.&nbsp;
These options can be changed using the <TT>Utilities -> Global Options
-> Plugin Options</TT> menu item in jEdit.
<P>This section describes each LazyImporter configuration panel in more
detail.&nbsp; The configurtion panels include:
<UL>
<LI>
<A HREF="#Classpath Options">Classpath Options</A></LI>
<LI>
<A HREF="#Ordering Options">Ordering Options</A></LI>
<LI>
<A HREF="#Layout Options">Layout Options</A></LI>
<LI>
<A HREF="#Miscellaneous Options">Miscellaneous Options</A></LI>
<LI>
<A HREF="#QuickImport Options">QuickImport Options</A></LI>
</UL>
<P><BR><A NAME="Classpath Options"></A><B><FONT SIZE=+1>Classpath Options</FONT></B>
<P>This option panel allows the user to set the classpath used by the LazyImporter
when resolving wildcard imports, resolving missing imports, finding the
selected import in the classpath and importing the class under the cursor.
<P>There are three main parts to this option panel:
<P><B><U>User Defined Class Path</U></B>
<P>The first part is a text area where the class path can be pasted/typed
in.&nbsp; This is a simple textual version of the classpath - the same
as what you may have as your CLASSPATH environment variable.
<BR>&nbsp;
<CENTER><TABLE BORDER COLS=1 WIDTH="79%" >
<TR>
<TD>
<CENTER><I>HINT: an easy way of getting this classpath string is to put
the following code somewhere in your java program:</I>
<BR><I><TT>&nbsp;&nbsp;&nbsp; System.out.println(System.getProperty("java.class.path"));</TT></I>
<BR><I>This will print the classpath to standard out.&nbsp; This string
can then be pasted into the user-defined classpath text area.</I></CENTER>
</TD>
</TR>
</TABLE></CENTER>
<P><I>NOTE: the ordering is important!&nbsp; When classes are loaded in
Java, the classloader always starts looking at the beginning of the classpath!</I>
<P>This part of the option panel also contains an option to choose class
path elements (jar / zip files or class directories) using a file chooser.&nbsp;
The file chooser will allow you to select multiple files/directories at
once.&nbsp; Any files/directories selected will be appended to the <I>end</I>
of the user-defined classpath.&nbsp; To open the file chooser, press the
"Select" button.
<P><B><U>Java Runtime Jar (rt.jar)</U></B>
<P>This part of the option pane allows the user to specify whether the
user wants to include an rt.jar (Java's runtime java archive) in the LazyImporter
classpath and, if so, where to find it.&nbsp; There are three options here:
<OL>
<LI>
Do not put the rt.jar in the classpath.</LI>
<LI>
Append an auto-detected rt.jar file (this is determined by the "java.home"
property) to the end of the classpath.</LI>
<LI>
Append a user-specified rt.jar file to the end of the classpath.&nbsp;
This option allows the user to enter the path of the rt.jar file to use.</LI>
</OL>
<I>NOTE: choices 2 and 3 will append the rt.jar file to the END of the
classpath.&nbsp; If you wish to put the rt.jar at the BEGINNING of the
classpath you can explicitly add it to the beginning of the user-defined
classpath text area.</I>
<P><B><U>Classpath Refresh Rate</U></B>
<P>This part of the option pane allows the user to specify how often the
classpath (specified above) should be refreshed.&nbsp; This refreshing
is important in certain cases, for example, if one of the classpath elements
was:
<P><TT>D:\classes</TT>
<P>... and, while programming in jEdit, I created a new Java class called
<TT>Test.java
</TT>and
compiled it to <TT>D:\classes</TT>.&nbsp; The LazyImporter plugin needs
to re-look at the classpath to pick up any new (like <TT>Test.class</TT>)
or removed classes.
<P>This part of the option pane lets the user specify how often the classpath
is refreshed in LazyImporter.&nbsp; The value entered is in seconds.&nbsp;
The default value is one minute (60 seconds).
<P>A screenshot of the LazyImporter Classpath Options panel is shown below:
<BR>&nbsp;
<P><BR>
<CENTER>
<P><IMG SRC="images/classpath-options.jpg" NOSAVE HEIGHT=446 WIDTH=574></CENTER>
<BR>&nbsp;
<P><BR>
<P><A NAME="Ordering Options"></A><B><FONT SIZE=+1>Ordering Options</FONT></B>
<P>This option panel allows the user to configure the ordering of import
statements when they are drawn back to the Java source.&nbsp; The following
sorting options are available:
<UL>
<LI>
<B>Sort Imports Alphabetically</B> - sorts the import statements in alphabetical
order.</LI>
<LI>
<B>Put Current Package Imports at Top</B> - puts the current package imports
at the top of the import list.&nbsp; (This is only meaningful if current
package imports are actually being inserted - this is specified in the
Miscellaneous Option Pane.</LI>
<LI>
<B>Separate Java Imports&nbsp; From Other Imports - </B>separates any java
imports (ie. those imports that start with java., javax. or com.sun.java.)
from all other imports.&nbsp; You can choose to put the java imports above
or below all other imports.</LI>
</UL>
A screenshot of the Ordering Options Panel is shown below:
<CENTER>
<P><IMG SRC="images/ordering-options.jpg" NOSAVE HEIGHT=221 WIDTH=571></CENTER>
<P><A NAME="Layout Options"></A><B><FONT SIZE=+1>Layout Options</FONT></B>
<P>LazyImporter supports two types of layout configuration, <I>automatic
</I>or
<I>manual</I>.&nbsp;
You can choose to have either:
<UL>
<LI>
Automatic layout configuration</LI>
<LI>
Manual layout configuration</LI>
<LI>
No layout configuration</LI>
</UL>
You cannot specify both types of configuration.
<P><B><U>Automatic Layout Configuration</U></B>
<P>This option panel allows the user to configure how the import statements
are grouped, and to define the spaces between each group.&nbsp; The grouping
mechanism is based upon the <I>level</I> of the import statement.&nbsp;
The level is defined by the number of <I>package names&nbsp;</I> in the
import statement.&nbsp; The level is used to determine <I>how many packages
we should match and group together.</I>&nbsp; Now, this can be a little
confusing to understand, so a preview panel is provided to show how changes
in the level (and grouping) will affect the drawing of the import statements.
<P>The grouping mechanism will be explained a little further with an example.&nbsp;
If the Java source file has the following import statements:
<PRE><TT>&nbsp;&nbsp;&nbsp; import java.util.ArrayList;
&nbsp;&nbsp;&nbsp; import java.util.List;
&nbsp;&nbsp;&nbsp; import javax.naming.Context;
&nbsp;&nbsp;&nbsp; import javax.rmi.PortableRemoteObject;</TT></PRE>
A grouping level of 0 would not group the import statements at all, so
they would look as they do above.&nbsp; However, if a grouping level of
1 was applied, the import statements would look like:
<PRE><TT>&nbsp;&nbsp;&nbsp; import java.util.ArrayList;
&nbsp;&nbsp;&nbsp; import java.util.List;</TT></PRE>
<PRE><TT>&nbsp;&nbsp;&nbsp; import javax.naming.Context;
&nbsp;&nbsp;&nbsp; import javax.rmi.PortableRemoteObject;</TT></PRE>
You can see that the import statements are now in two groups, based upon
the <I>first level</I> of package names. (<TT>java</TT>, <TT>javax</TT>).&nbsp;
If a grouping level of 2 was applied, the import statements would look
like:
<PRE><TT>&nbsp;&nbsp;&nbsp; import java.util.ArrayList;
&nbsp;&nbsp;&nbsp; import java.util.List;</TT></PRE>
<PRE><TT>&nbsp;&nbsp;&nbsp; import javax.naming.Context;</TT></PRE>
<PRE><TT>&nbsp;&nbsp;&nbsp; import javax.rmi.PortableRemoteObject;</TT></PRE>
Now the import statements are grouped according to the <I>first and second
level </I>of package names. (<TT>java.util</TT>, <TT>javax.naming</TT>,
<TT>javax.rmi</TT>).&nbsp;
This results in two import statements in the first group, and one each
in the subsequent two groups.
<P>The preview panel will help show you how the import statements will
be grouped at different levels.
<P>This option pane also allows you to define how many newlines are placed
in between each import statement group.&nbsp; This would normally be set
to only 1 newline, however, for some reason you may want more.
<P>A screenshot of this option pane is shown below:
<BR>&nbsp;
<P><BR>
<CENTER>
<P><IMG SRC="images/layout-options.jpg" NOSAVE HEIGHT=409 WIDTH=409></CENTER>
<BR>&nbsp;
<P><BR>
<P><I>NOTE: if you choose NO newlines between groups, the grouping level
you choose is irrelevant, and vice versa!</I>
<P><B><U>Manual Layout Configuration</U></B>
<P>Manual layout configuration allows the user to specify which groups
of imports are together and in what order.&nbsp; Blank lines can also be
configured to allow spaces to be inserted between groups of import statements
if required.&nbsp; An example of a manual layout configuration is as follows:
<PRE><TT>
org.etheridge
&lt;BLANK LINE>
* (all remaining imports)
</TT></PRE>
<P><BR>The above configuration would group all imports that start with
<TT>org.etheridge</TT>
at the top, and all remaining import statements under these, separated
by a single blank line.&nbsp; For example:
<PRE><TT>
import org.etheridge.lazyimporter.LazyImporterPlugin;
import org.etheridge.lazyimporter.gui.ImportListWindow;
import javax.swing.JWindow;
import java.util.Date;
import com.sun.java.util.collections.List;
</PRE></TT>
<P><I>NOTE: leading/trailing blank lines (at the top or bottom of the configuration
list) will be ignored!</I>
<P><I>NOTE: both the automatic and manual grouping (and sorting for that
matter) configuration you set will only take affect when you choose one
of the LazyImporter actions that REDRAW the import statements.</I>
<BR>&nbsp;
<P><A NAME="Miscellaneous Options"></A><B><FONT SIZE=+1>Miscellaneous Options</FONT></B>
<P>This option pane is for any miscellaneous options that did not belong
elsewhere.&nbsp; The options include:
<UL>
<LI>
<B>Display Imports From Current Package</B> - determines whether or not
you want to explicitly import classes from the current package of this
Java source file.&nbsp; Of course the Java compiler does NOT require you
to do this, however some build environments I've used in the past required
this, so I thought I'd include it.</LI>
<LI>
<B>Do Not Popup Window When Single Match Found</B> - if this option is
chosen, the popup import window will <I>not</I> be displayed if only one
matching import was found. (See the <A HREF="#Import Class Under Cursor">Import
Class Under Cursor</A> action for more information).</LI>
</UL>
A screenshot of this option pane is shown below:
<CENTER>
<P><IMG SRC="images/misc-options.jpg" NOSAVE HEIGHT=166 WIDTH=410></CENTER>
<P><A NAME="QuickImport Options"></A><B><FONT SIZE=+1>QuickImport Options</FONT></B>
<P>This option pane is used to define which LazyImporter actions should
be performed when the QuickImport action is invoked.&nbsp; Any combination
of the following actions can be chosen (including <I>all</I> or <I>none</I>):
<UL>
<LI>
<A HREF="#Resolve Wildcard Imports">Resolve Wildcard (Package) Imports</A></LI>
<LI>
<A HREF="#Remove Unused Imports">Remove Unused Imports</A></LI>
<LI>
<A HREF="#Resolve and Insert Missing Imports">Resolve and Insert Missing
Imports</A></LI>
</UL>
A screenshot of this option panel is shown below:
<CENTER>
<P><IMG SRC="images/quickimport-options.jpg" NOSAVE BORDER=0 HEIGHT=190 WIDTH=409></CENTER>
<P><I>NOTE: even if none of the above actions are chosen the imports will
still be redrawn according to the grouping and sorting rules defined in
the <A HREF="#Ordering Options">Ordering</A> and <A HREF="#Layout Options">Layout</A>
option panels.</I>
<BR>&nbsp;
<BR>&nbsp;
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=3 WIDTH="100%" summary="Recent Changes" >
<TR ALIGN=CENTER width="100%">
<TD WIDTH="100%" BGCOLOR="#7FB2FF"><A NAME="changes"></A><B><FONT COLOR="#FFFFFF"><FONT SIZE=+1>Recent
Changes</FONT></FONT></B></TD>
</TR>
</TABLE>
<UL>
<LI>
1.0 (Aug 5, 2003)</LI>
<UL>
<LI>
Initial Release</LI>
</UL>
<LI>
1.01 (Aug 16, 2003)</LI>
<UL>
<LI>
Added classpath refresh thread, so any new classes in the LazyImporter
classpath are picked up automatically.</LI>
<LI>
Added new configuration item in ClassPath Options pane to configure how
often the classpath is updated.</LI>
<LI>
Removed some System.err.printlns (doh!) ;)</LI>
<LI>
Removed some hard-coded visual strings and made them properties.</LI>
</UL>
<LI>
1.02 (Aug 22, 2003)</LI>
<UL>
<LI>
<I>Bug Fix</I>: added new post character (";").&nbsp; Some class usages
were not being found because of this.</LI>
<LI>
<I>Bug Fix</I>: as a result of some code refactoring, the rt.jar file was
not being added to the in-memory classpath until after the user has modified
the configurable classpath, this has now been fixed to happen at startup.</LI>
<LI>
<I>Bug Fix</I>: changed the pop-up window to be an undecorated JFrame,
as this works better in jdk1.4.</LI>
<LI>
NOTE: LazyImporter now only works in JDK >= 1.4.0</LI>
</UL>
<LI>
1.03 (Oct 19, 2003)</LI>
<UL>
<LI>
<I>Bug Fix</I>: added new pre/post character ("\t").&nbsp; Some class usages
were not being found because of this.</LI>
<LI>
<I>Bug Fix</I>: now works for interfaces - only ever worked on classes
before (der!)</LI>
<LI>
<I>Bug Fix</I>: when the "import classes from own package" option is chosen,
LazyImporter used to import the classe/interface's own class name, this
has been fixed.</LI>
<LI>
<I>Bug Fix</I>: in JDK1.4.1 onwards the pop-up import window would lose
focus as soon as it opened due to some changes in Java's handling of focusing
issues in JDK1.4.1.&nbsp; This has been fixed, but probably still needs
a major overhaul.</LI>
</UL>
<LI>
1.04 (Nov 08, 2003)</LI>
<UL>
<LI>
Updated to use the new jEdit 4.2 deferred loading mechanism (however the
plugin will still work in previous version of jEdit (as far as I can tell!
;)).</LI>
<LI>
<I>Bug Fix</I>: the pop-up window was not getting keyboard focus when it
opened, meaning users had to use the mouse to select the desired import
statement, this has been fixed. (Although it is still a little flakey!)
(Thanks Manfred).</LI>
<LI>
<I>Bug Fix</I>: fixed the properties file so that the version is up to
date.&nbsp; This was causing jEdit's plugin manager to always think LazyImporter
needed updating.</LI>
<LI>
<I>Enhancement Request</I>: when using the "Import Class Under Cursor"
option, you can now select the class (ie. select the word) you wish to
import, instead of having to place the cursor somewhere on the class name
(this will still work though).</LI>
</UL>
<LI>
1.05 (Nov 16, 2003)</LI>
<UL>
<LI>
<I>New Feature</I>: new ordering option to allow "java" imports (ie. java.*,
javax.*, com.sun.java.*) to be grouped either above or below all other
import statements.&nbsp; <I>(NOTE: this has replaced the current functionality
that was allowing package imports (ie. .* imports) to be grouped above/below
other imports).</I></LI>
<LI>
<I>New Feature</I>: the classpath options pane now has a button that, when
pressed, pops up a file chooser to allow the user to choose class path
elements (ie. *.jar, *.zip and class directories) to be appended to the
classpath.</LI>
<LI>
<I>Bug Fix</I>: removed stack trace when invalid classpath element was
specified (this has been replaced with a message in the activity log).</LI>
</UL>
<LI>
1.06 (Jan 19, 2004)</LI>
<UL>
<LI>
<I>New Feature</I>: now allows manual configuration of import grouping/layout.&nbsp;
Allows you to group and order import statements and configure the spacing
between them.</LI>
</UL>
<LI>
1.07 (Aug 12, 2004)</LI>
<UL>
<LI>
<I>Bug Fix</I>: fixed problem where "//" appeared in literal strings - does not hang anymore</LI>
<LI>
<I>Bug Fix</I>: fixed NullPointerException that occurred on MacOS X when opening the classpath options pane. This should now correctly find the classes.jar for Mac users. (anyone want to validate this for me??) ;)</LI>
</UL>
</UL>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=3 WIDTH="100%" summary="To Do" >
<TR ALIGN=CENTER width="100%">
<TD WIDTH="100%" BGCOLOR="#7FB2FF"><A NAME="todo"></A><B><FONT COLOR="#FFFFFF"><FONT SIZE=+1>To
Do</FONT></FONT></B></TD>
</TR>
</TABLE>
<P>Things I would like to do if I have the time:
<UL>
<LI>
Use some form of abstract syntax tree (AST) for finding Java syntax components
(instead of regular expressions and otherwise).</LI>
<LI>
Allow for configurable comments for each group of import statements. (does
anyone actually want this?)</LI>
<LI>
Graphical classpath configuration (instead/as well as text version)</LI>
</UL>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=3 WIDTH="100%" summary="Feedback" >
<TR ALIGN=CENTER width="100%">
<TD WIDTH="100%" BGCOLOR="#7FB2FF"><A NAME="feedback"></A><B><FONT COLOR="#FFFFFF"><FONT SIZE=+1>Feedback</FONT></FONT></B></TD>
</TR>
</TABLE>
<P>Feel free to email me, Matt Etheridge &lt;matt@etheridge.org> with any
bugs or general feedback.&nbsp; Otherwise try these:
<UL>
<LI>
jEdit-users mailing-list <I>&lt;jedit-users@lists.sourceforge.net>.</I></LI>
<LI>
jEdit-devel mailing-list <I>&lt;jedit-devel@lists.sourceforge.net>.</I></LI>
</UL>
<I>Thanks to Andre Kaplan for the inspiration for the layout of this help
file!</I>
<BR>&nbsp;
<BR>&nbsp;
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=3 WIDTH="100%" summary="Feedback" >
<TR ALIGN=CENTER width="100%">
<TD WIDTH="100%" BGCOLOR="#7FB2FF"><A NAME="Notes"></A><B><FONT COLOR="#FFFFFF"><FONT SIZE=+1>Notes</FONT></FONT></B></TD>
</TR>
</TABLE>
<UL>
<LI>
In case you were wondering, yes, I do now realise that there are currently
other great jEdit plugins that perform some of the things that the LazyImporter
plugin does (namely JImporter, AntHelper, JTools, more??).&nbsp; However,
the main reason I wrote this plugin was for my own programming practice
and experience, and I figure, "Why not share it?" :)</LI>
</UL>
</BODY>
</HTML>