edu.rice.cs.drjava.ui
Class MainFrameStatics

java.lang.Object
  extended by edu.rice.cs.drjava.ui.MainFrameStatics

public class MainFrameStatics
extends Object

Utilities for DrJava's main window.


Nested Class Summary
static class MainFrameStatics.AutoCompletePopupEntry
           
static class MainFrameStatics.GoToFileListEntry
          Wrapper class for the "Go to File" dialog list entries.
static class MainFrameStatics.JavaAPIListEntry
          Wrapper class for the "Open Javadoc" and "Auto Import" dialog list entries.
 
Constructor Summary
MainFrameStatics()
           
 
Method Summary
static JMenuItem newCheckBoxMenuItem(Action action)
          Returns a JRadioButtonMenuItem that looks like a JCheckBoxMenuItem.
static File proposeToChangeExtension(Component parent, File input, String title, String message, String changeButton, String keepButton, String newExt)
          Propose to the user to change the extension of the file.
static void showClassNotFoundError(Component parent, ClassNotFoundException cnfe)
           
static void showDebugError(Component parent, DebugException de)
           
static void showError(Component parent, String title, String message)
           
static void showError(Component parent, Throwable e, String title, String message)
           
static void showErrorWithMessageIfAvailable(Component parent, Throwable e, String title, String message)
           
static void showFileNotFoundError(Component parent, FileNotFoundException fnf)
           
static void showIOError(Component parent, IOException ioe)
           
static void showJUnitInterrupted(Component parent, String message)
           
static void showJUnitInterrupted(Component parent, UnexpectedException e)
           
static void showNoClassDefError(Component parent, NoClassDefFoundError ncde)
           
static void showProjectFileParseError(Component parent, MalformedProjectFileException mpfe)
           
static void showWarning(Component parent, Throwable e, String title, String message)
           
static boolean verifyOverwrite(Component parent, File f)
          Confirms with the user that the file should be overwritten.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MainFrameStatics

public MainFrameStatics()
Method Detail

proposeToChangeExtension

public static File proposeToChangeExtension(Component parent,
                                            File input,
                                            String title,
                                            String message,
                                            String changeButton,
                                            String keepButton,
                                            String newExt)
Propose to the user to change the extension of the file.

Parameters:
parent - parent GUI component
input - input file
title - dialog title
message - dialog message
changeButton - text for the "yes, change it!" button
keepButton - text for the "no, leave it!" button
newExt - new extension if changed

verifyOverwrite

public static boolean verifyOverwrite(Component parent,
                                      File f)
Confirms with the user that the file should be overwritten.

Parameters:
f - file to overwrite
Returns:
true iff the user accepts overwriting.

showProjectFileParseError

public static void showProjectFileParseError(Component parent,
                                             MalformedProjectFileException mpfe)

showFileNotFoundError

public static void showFileNotFoundError(Component parent,
                                         FileNotFoundException fnf)

showIOError

public static void showIOError(Component parent,
                               IOException ioe)

showErrorWithMessageIfAvailable

public static void showErrorWithMessageIfAvailable(Component parent,
                                                   Throwable e,
                                                   String title,
                                                   String message)

showClassNotFoundError

public static void showClassNotFoundError(Component parent,
                                          ClassNotFoundException cnfe)

showNoClassDefError

public static void showNoClassDefError(Component parent,
                                       NoClassDefFoundError ncde)

showDebugError

public static void showDebugError(Component parent,
                                  DebugException de)

showJUnitInterrupted

public static void showJUnitInterrupted(Component parent,
                                        UnexpectedException e)

showJUnitInterrupted

public static void showJUnitInterrupted(Component parent,
                                        String message)

showError

public static void showError(Component parent,
                             Throwable e,
                             String title,
                             String message)

showError

public static void showError(Component parent,
                             String title,
                             String message)

showWarning

public static void showWarning(Component parent,
                               Throwable e,
                               String title,
                               String message)

newCheckBoxMenuItem

public static JMenuItem newCheckBoxMenuItem(Action action)
Returns a JRadioButtonMenuItem that looks like a JCheckBoxMenuItem. This is a workaround for a known bug on OS X's version of Java. (See http://developer.apple.com/qa/qa2001/qa1154.html)

Parameters:
action - Action for the menu item
Returns:
JRadioButtonMenuItem with a checkbox icon