The first set of methods in this class, documented below, display various common dialog boxes. The remainder deal with various miscellaneous user interface-related tasks.
public static void message( | Component | comp, |
String | prefix, | |
Object[] | args) ; |
public static void error( | Component | comp, |
String | prefix, | |
Object[] | args) ; |
These two methods both show a dialog box; they are identical in every way except for the icon used (either a message icon, or an error icon). The title of the dialog is taken from a property named prefix.title; the message text is taken from prefix.message. The message property can consist of multiple lines of text.
The elements of the args array are substituted into the value of the message property in place of strings of the form {n}, where n is an index in the array. You can find out more about this feature by reading the documentation for the format method of the java.text.MessageFormat class.
public static String input( | Component | comp, |
String | prefix, | |
Object | def) ; |
public static String input( | Component | comp, |
String | prefix, | |
Object[] | args, | |
Object | def) ; |
These two methods prompt for input; both return null if the user pressed Cancel, or the entered value if they pressed OK.
The dialog box title and message is obtained in the same manner as with the message() and error() methods.
public static String inputProperty( | Component | comp, |
String | prefix, | |
Object | def) ; |
public static String inputProperty( | Component | comp, |
String | prefix, | |
Object[] | args, | |
Object | def) ; |
public static int confirm( | Component | comp, |
String | prefix, | |
Object[] | args, | |
int | buttons, | |
int | type) ; |
public static String[] showVFSFileDialog( | View | view, |
String | path, | |
int | type, | |
boolean | multipleSelection) ; |
This method displays the VFSFileChooserDialog provided by jEdit. If path is set to null, the dialog will display the directory of the current buffer. The type parameter can either be VFSBrowser.OPEN_DIALOG or VFSBrowser.SAVE_DIALOG. The final parameter determines whether multiple selection of files is permitted.
public static void showPopupMenu( | JPopupMenu | popup, |
Component | comp, | |
int | x, | |
int | y) ; |
Plugins should use this method to display popup menus. Unlike the standard JPopupMenu.show() method, this one ensures that the popup is positioned within the bounds of the screen.
public static Icon loadIcon(
String name)
;
Loads an icon from the specified URL. Relative URLs are resolved relative to the standard icon directory inside jedit.jar.
The following two methods are described in the section called "Action Labels and Menu Items".
public static JMenuItem loadMenuItem( | String | name) ; |
public static JMenu loadMenu(
String name)
;