public class PluginUtil extends Object
Constructor and Description |
---|
PluginUtil() |
Modifier and Type | Method and Description |
---|---|
static JTree |
createTree(TreeModel tm,
String accessibleName)
Creates a JTree with the same look and feel as those used in the jGRASP
gui.
|
static String |
decodeFilename(String filename)
Decodes filenames encoded with
encodeFilename(String) . |
static String |
decodeURL(String url)
Decodes URLs encoded with
encodeURL(String) . |
static void |
doc(String urlString,
Component locationRef)
Displays a URL in the system default browser.
|
static String |
encodeFilename(String filename)
Encodes a filename in a form suitable for saving between executions.
|
static String |
encodeURL(String url)
Encodes a URL in a form suitable for saving between executions.
|
static boolean |
endsWithIgnoreCase(String s,
String t)
Determines if one string ends with another, ignoring case.
|
static JFrame |
getDialogParent()
Gets a dialog parent with a lifetime equal to the application session.
|
static String |
getJDKDocumentationRoot()
Gets the URL of the JDK documentation root for the version of Java that
jGRASP is running under.
|
static int |
getPixelScale(GraphicsConfiguration gc)
Gets the number of device pixels per Java pixel for a specified graphics
configuration.
|
static void |
openClass(String className,
String filename,
int line,
LocData locData,
Set<File> rootDirs)
Opens a file in jGRASP based on the class name.
|
static boolean |
startsWithIgnoreCase(String s,
String t)
Determines if one string starts with another, ignoring case.
|
public static JTree createTree(TreeModel tm, String accessibleName)
tm
- the tree model.accessibleName
- the accessibility name for the combo box.public static String decodeFilename(String filename)
encodeFilename(String)
.filename
- the encoded filename.public static String decodeURL(String url)
encodeURL(String)
.url
- the encoded url.public static void doc(String urlString, Component locationRef)
urlString
- string representation of the URL to display.locationRef
- location reference for showing error dialogs. Any
error dialogs will pop up centered on this component. This may be
null.public static String encodeFilename(String filename)
filename
- the filename to be encoded.public static String encodeURL(String url)
url
- the URL to be encoded, in string form.public static boolean endsWithIgnoreCase(String s, String t)
s
- the string.t
- the potential suffix.s
ends with t
, false
otherwise.public static JFrame getDialogParent()
public static String getJDKDocumentationRoot()
public static int getPixelScale(GraphicsConfiguration gc)
gc
- the graphics configuration.public static void openClass(String className, String filename, int line, LocData locData, Set<File> rootDirs)
className
- the class name.filename
- the simple filename, or null if this is unknown.line
- the line number, or -1 if no line should be selected.locData
- file location data.rootDirs
- source root directories to be searched.