|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.hunsicker.jalopy.plugin.AbstractPlugin
Skeleton implementation of a Jalopy Plug-in for integrated development environments.
Nested Class Summary | |
static class |
AbstractPlugin.Action
Represents an action that can be performed. |
Field Summary | |
protected SwingAppender |
appender
Appender to write messages to. |
protected Jalopy |
jalopy
The main Jalopy instance. |
Constructor Summary | |
AbstractPlugin()
Creates a new AbstractPlugin object. |
|
AbstractPlugin(SwingAppender appender)
Creates a new AbstractPlugin object. |
Method Summary | |
void |
afterEnd()
Called on the event dispatching thread after an action was performed. |
void |
beforeStart()
Called on the event dispatching thread before an action will be started. |
protected ProgressMonitor |
createProgressMonitor()
Creates a monitor to be used for long-running operations. |
protected void |
displayError(java.lang.Throwable error,
java.awt.Frame parent)
Displays an error dialog. |
protected void |
executeAsynchron(java.lang.Runnable operation)
Executes the given runnable asynchronously on the AWT event dispatching thread. |
protected void |
executeSynchron(java.lang.Runnable operation)
Executes the given runnable synchronously on the AWT event dispatching thread. |
abstract Project |
getActiveProject()
Returns the currently active project. |
long |
getElapsed()
Returns the elapsed execution time of the run. |
Jalopy |
getEngine()
Returns a Jalopy instance. |
protected abstract FileFormat |
getFileFormat()
Returns the file format to use for writing Java source files. |
AbstractPlugin.Action |
getLastAction()
Returns the action that was performed last. |
abstract java.awt.Frame |
getMainWindow()
Returns the main window of the application. |
Jalopy.State |
getState()
Returns the state info of Plug-in. |
StatusBar |
getStatusBar()
Returns the active status bar. |
protected void |
hideWaitCursor()
Hides the wait cursor. |
void |
interrupt()
Interrupts the currently performed action, if any. |
boolean |
isRunning()
Determines whether the Plug-in currently processes a request. |
void |
performAction(AbstractPlugin.Action action)
Performs the given action. |
protected void |
showWaitCursor()
Shows the wait cursor to indicate a long-running operation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Jalopy jalopy
protected SwingAppender appender
Constructor Detail |
public AbstractPlugin()
System.out
.
public AbstractPlugin(SwingAppender appender)
appender
- appender to use for logging; if null
all logging
output goes to System.out
.Method Detail |
public abstract Project getActiveProject()
public abstract java.awt.Frame getMainWindow()
public long getElapsed()
public final AbstractPlugin.Action getLastAction()
null
if no action was ever
performed.public final Jalopy.State getState()
Jalopy.getState()
public boolean isRunning()
true
if an action is currently being performed.performAction(de.hunsicker.jalopy.plugin.AbstractPlugin.Action)
,
interrupt()
public StatusBar getStatusBar()
public void afterEnd()
Override this method to perform any custom work after the formatting process finished.
public void beforeStart()
Override this method to perform any custom work before the formatting process starts.
public final void interrupt()
public final void performAction(AbstractPlugin.Action action)
action
- action to perform.protected abstract FileFormat getFileFormat()
public final Jalopy getEngine()
protected ProgressMonitor createProgressMonitor()
protected void displayError(java.lang.Throwable error, java.awt.Frame parent)
error
- the throwable which caused the error.parent
- parent frame of the dialog (used to position the dialog).protected void executeAsynchron(java.lang.Runnable operation)
operation
- runnable to be invoked asynchronously on the AWT event
dispatching thread.SwingUtilities.invokeLater(java.lang.Runnable)
protected void executeSynchron(java.lang.Runnable operation) throws java.lang.InterruptedException, java.lang.reflect.InvocationTargetException
operation
- runnable to be invoked synchronously on the AWT event dispatching
thread.
java.lang.InterruptedException
- if another thread has interrupted this thread.
java.lang.reflect.InvocationTargetException
- if an exception is thrown when running runnable.SwingUtilities.invokeAndWait(java.lang.Runnable)
protected void hideWaitCursor()
protected void showWaitCursor()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |