sandip chitale's blog    Sandip Chitale's blog (scblog)
NOTE: I have moved many of my modules to NetBeans Plugin Portal . Please check there for latest versions of modules described on this blog.
20061016 Monday October 16, 2006

PathEditor component for editing CLASSPATH or PATH

Here is a simple PathEditor component that can be used to edit classpath-like structures i.e. Java CLASSPATH or PATH environment variable.

The label shows the name of the path being edited. The list shows the entries - one entry per row.

Usage

Actions:

  • Delete - delete the selected entries
  • Clear - delete all entries
  • Move up - move slected entry up
  • Move down - move selected entry down
  • Copy - copy the current path to system clipboard
  • View - view the current path (allows copying). The path is shown in a textarea in a dialog. The text is preselected text for easy copying.
  • Edit - copy the selected entries from the list to the textfield for editing. Replace action can be used to replace the edited entries.
    • Double clicking on the list copies the selected entry to the textfield
  • Replace - Replace selected entries with entries in the text field.
  • Add - add new entries to the end of the list or after the last selected entry (if any)
    • Typing ENTER in the textfield adds the entries in the text field
  • Select - browse and select entries using file chooser

Toolbar (hidden at the bottom of split pane). This is an advanced usage.

  • : - use : as the path separator
  • ; - use ; as the path separator

To Run

Simply download the PathEditor.jar and execute:

> java -jar PathEditor.jar

Programatic Usage

PathEditor pe = new PathEditor();
PathEditor pe = new PathEditor("CLASSPATH", "c:\lib\classes;");
PathEditor pe = new PathEditor("PATH", "c:\bin;c:\usr\bin", PathEditor.PATH_TYPE.PATH);
// show it in some UI
String classpath = pe.getClassPath();

To Hack

PathEditor Netbeans Project

TODO

  • Drag and Drop editing
  • I18N
  • Publish JavaDoc
  • java.net project

DISCLAIMER: This code is experimental. So no guarantees. Use the code at your own risk.


Posted by sandipchitale ( Oct 16 2006, 07:44:39 PM PDT ) Permalink Comments [1]


Trackback URL: http://blogs.sun.com/scblog/entry/a_patheditor_for_editing_classpath
Comments:

Yes! I remembered this one. I think I will use it. Thanks.

Posted by Ramon on November 27, 2007 at 09:46 AM PST #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed








« November 2009
SunMonTueWedThuFriSat
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
     
       
Today

Get NetBeans 5.5

Locations of visitors to this page

Today's Page Hits: 126


XML
All
/Creator
/General
/Hobby
/Java
/JavaScript
/Mozilla
/NetBeans
/Ubuntu
/VisualWeb
/VisualWebPack
/Web 2.0

XML
All
/Creator
/General
/Hobby
/Java
/JavaScript
/Mozilla
/NetBeans
/Ubuntu
/VisualWeb
/VisualWebPack
/Web 2.0

scblog
scblog