diff options
-rw-r--r-- | ajde/src/org/aspectj/ajde/Ajde.java | 749 | ||||
-rw-r--r-- | ajde/src/org/aspectj/ajde/BuildConfigListener.java | 37 | ||||
-rw-r--r-- | ajde/src/org/aspectj/ajde/BuildConfigManager.java | 91 | ||||
-rw-r--r-- | ajde/src/org/aspectj/ajde/BuildListener.java | 51 | ||||
-rw-r--r-- | ajde/src/org/aspectj/ajde/BuildManager.java | 71 | ||||
-rw-r--r-- | ajde/src/org/aspectj/ajde/BuildOptionsAdapter.java | 177 | ||||
-rw-r--r-- | ajde/src/org/aspectj/ajde/BuildProgressMonitor.java | 65 | ||||
-rw-r--r-- | ajde/src/org/aspectj/ajde/ConfigurationListener.java | 38 | ||||
-rw-r--r-- | ajde/src/org/aspectj/ajde/ErrorHandler.java | 28 | ||||
-rw-r--r-- | ajde/src/org/aspectj/ajde/OutputLocationManager.java | 59 | ||||
-rw-r--r-- | ajde/src/org/aspectj/ajde/ProjectPropertiesAdapter.java | 117 | ||||
-rw-r--r-- | ajde/src/org/aspectj/ajde/TaskListManager.java | 54 |
12 files changed, 437 insertions, 1100 deletions
diff --git a/ajde/src/org/aspectj/ajde/Ajde.java b/ajde/src/org/aspectj/ajde/Ajde.java index dd90b1572..0ce1fa7ce 100644 --- a/ajde/src/org/aspectj/ajde/Ajde.java +++ b/ajde/src/org/aspectj/ajde/Ajde.java @@ -8,391 +8,516 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Xerox/PARC initial implementation - * ******************************************************************/ - + * Xerox/PARC initial implementation + * Helen Hawkins Converted to new interface (bug 148190) + *******************************************************************/ package org.aspectj.ajde; -import org.aspectj.ajde.internal.AspectJBuildManager; +import java.awt.Frame; +import java.io.File; +import java.io.PrintStream; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +import javax.swing.JOptionPane; + +import org.aspectj.ajde.core.AjCompiler; +import org.aspectj.ajde.core.IBuildProgressMonitor; +import org.aspectj.ajde.core.ICompilerConfiguration; +import org.aspectj.ajde.internal.BuildConfigListener; +import org.aspectj.ajde.internal.BuildConfigManager; import org.aspectj.ajde.internal.LstBuildConfigManager; -import org.aspectj.ajde.ui.IdeUIAdapter; +import org.aspectj.ajde.ui.FileStructureView; import org.aspectj.ajde.ui.StructureSearchManager; import org.aspectj.ajde.ui.StructureViewManager; -import org.aspectj.ajde.ui.StructureViewNodeFactory; +import org.aspectj.ajde.ui.swing.BrowserViewManager; +import org.aspectj.ajde.ui.swing.OptionsFrame; +import org.aspectj.ajde.ui.swing.StructureViewPanel; +import org.aspectj.ajde.ui.swing.SwingTreeViewNodeFactory; +import org.aspectj.ajde.ui.swing.TreeViewBuildConfigEditor; import org.aspectj.asm.AsmManager; -import org.aspectj.bridge.IMessageHandler; -import org.aspectj.bridge.Version; -import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions; +import org.aspectj.bridge.IMessage; +import org.aspectj.bridge.Message; import org.aspectj.util.LangUtil; import org.aspectj.util.Reflection; -import java.io.PrintStream; -import java.util.Arrays; -import java.util.List; - /** - * Singleton class responsible for AJDE initialization, and the main point of access to - * Ajde functionality. - * + * Singleton class used to initialize the Ajde ui as well as the properties required + * to run the compiler. Users must call "Ajde.init(...)" before doing anything + * else. There are getter methods for the various properties that are set in + * the initialization. + * * @author Mik Kersten */ -public class Ajde { - - private static final Ajde INSTANCE = new Ajde(); - private static final String NOT_INITIALIZED_MESSAGE = "Ajde is not initialized."; - private static boolean isInitialized = false; - private static int compatibilityLevel = 1; // Used by org.aspectj.ajde upgrade task - - private BuildManager buildManager; -// private EditorManager editorManager; +public class Ajde { + + protected static final Ajde INSTANCE = new Ajde(); + private BrowserViewManager viewManager = null; + + private IdeUIAdapter ideUIAdapter = null; + private TreeViewBuildConfigEditor buildConfigEditor = null; + private IconRegistry iconRegistry; + private IRuntimeProperties runtimeProperties; + private boolean initialized = false; + + private OptionsFrame optionsFrame = null; + private Frame rootFrame = null; + private StructureViewPanel fileStructurePanel = null; + private EditorAdapter editorAdapter; private StructureViewManager structureViewManager; private StructureSearchManager structureSearchManager; - private BuildConfigManager configurationManager ; - private ProjectPropertiesAdapter projectProperties; - private TaskListManager taskListManager; - private IdeUIAdapter ideUIAdapter; - private ErrorHandler errorHandler; - private PrintStream logPrintStream = null; - private IMessageHandler messageHandler = null; // allow provision of custom handler + private BuildConfigManager configurationManager; + private PrintStream logPrintStream = null; + + // all to do with building.... + private ICompilerConfiguration compilerConfig; + private IUIBuildMessageHandler uiBuildMsgHandler; + private IBuildProgressMonitor buildProgressMonitor; + private AjCompiler compiler; + /** - * This class can only be constructured by itself (as a singleton) or by sub-classes. - */ + * This class can only be constructured by itself (as a singleton) or by + * sub-classes. + */ protected Ajde() { configurationManager = new LstBuildConfigManager(); } /** - * This method must be called before using Ajde. A <CODE>RuntimeException</CODE> will - * be thrown if use is attempted before initialization. + * Initializes the ajde ui and sets up the compiler */ - public static void init( - EditorAdapter editorAdapter, - TaskListManager taskListManager, - BuildProgressMonitor compileProgressMonitor, - ProjectPropertiesAdapter projectProperties, - BuildOptionsAdapter buildOptionsAdapter, - StructureViewNodeFactory structureViewNodeFactory, - IdeUIAdapter ideUIAdapter, - ErrorHandler errorHandler) { + public void init(ICompilerConfiguration compilerConfig, + IUIBuildMessageHandler uiBuildMessageHandler, + IBuildProgressMonitor monitor, EditorAdapter editorAdapter, + IdeUIAdapter ideUIAdapter, IconRegistry iconRegistry, + Frame rootFrame, IRuntimeProperties runtimeProperties, + boolean useFileView) { try { - INSTANCE.projectProperties = projectProperties; - INSTANCE.errorHandler = errorHandler; - INSTANCE.taskListManager = taskListManager; -// INSTANCE.editorManager = new EditorManager(editorAdapter); - INSTANCE.editorAdapter = editorAdapter; - INSTANCE.buildManager = new AspectJBuildManager( - taskListManager, - compileProgressMonitor, - buildOptionsAdapter); - - INSTANCE.buildManager.addListener(INSTANCE.BUILD_STATUS_LISTENER); - INSTANCE.configurationManager.addListener(INSTANCE.STRUCTURE_UPDATE_CONFIG_LISTENER); + + INSTANCE.compilerConfig = compilerConfig; + INSTANCE.uiBuildMsgHandler = uiBuildMessageHandler; + INSTANCE.buildProgressMonitor = monitor; + + INSTANCE.iconRegistry = iconRegistry; INSTANCE.ideUIAdapter = ideUIAdapter; - - INSTANCE.structureSearchManager = new StructureSearchManager(); - INSTANCE.structureViewManager = new StructureViewManager(structureViewNodeFactory); - - isInitialized = true; -// INSTANCE.enableLogging(System.out); + INSTANCE.buildConfigEditor = new TreeViewBuildConfigEditor(); + INSTANCE.rootFrame = rootFrame; + INSTANCE.runtimeProperties = runtimeProperties; + + INSTANCE.configurationManager + .addListener(INSTANCE.STRUCTURE_UPDATE_CONFIG_LISTENER); + INSTANCE.ideUIAdapter = ideUIAdapter; + INSTANCE.editorAdapter = editorAdapter; + INSTANCE.structureSearchManager = new StructureSearchManager(); + INSTANCE.structureViewManager = new StructureViewManager( + new SwingTreeViewNodeFactory(iconRegistry)); + + if (useFileView) { + FileStructureView structureView = structureViewManager + .createViewForSourceFile(editorAdapter.getCurrFile(), + structureViewManager.getDefaultViewProperties()); + structureViewManager.setDefaultFileView(structureView); + fileStructurePanel = new StructureViewPanel(structureView); + } + + viewManager = new BrowserViewManager(); + optionsFrame = new OptionsFrame(iconRegistry); + + initialized = true; } catch (Throwable t) { - System.err.println("AJDE ERROR: could not initialize Ajde."); - t.printStackTrace(); + Message error = new Message("AJDE UI failed to initilize", + IMessage.ABORT, t, null); + uiBuildMsgHandler.handleMessage(error); } - } + } + + public void showOptionsFrame() { + int x = (rootFrame.getWidth() / 2) + rootFrame.getX() + - optionsFrame.getWidth() / 2; + int y = (rootFrame.getHeight() / 2) + rootFrame.getY() + - optionsFrame.getHeight() / 2; + optionsFrame.setLocation(x, y); + optionsFrame.setVisible(true); + } /** - * @return the default singleton instance of <CODE>Ajde</CODE> + * @return true if init(..) has been run, false otherwise */ - public static Ajde getDefault() { - if (!isInitialized) throw new RuntimeException(NOT_INITIALIZED_MESSAGE); - return INSTANCE; + public boolean isInitialized() { + return initialized; } + private final BuildConfigListener STRUCTURE_UPDATE_CONFIG_LISTENER = new BuildConfigListener() { + public void currConfigChanged(String configFilePath) { + if (configFilePath != null) + AsmManager.getDefault().readStructureModel(configFilePath); + } + + public void configsListUpdated(List configsList) { + } + }; + /** - * Set a <CODE>ConfigurationManager</CODE> to use instead of the default one. - */ - public void setConfigurationManager(BuildConfigManager configurationManager) { - this.configurationManager = configurationManager; + * Utility to run the project main class from the project properties in the + * same VM using a class loader populated with the classpath and output path + * or jar. Errors are logged to the ErrorHandler. + * + * @param project + * the ProjectPropertiesAdapter specifying the main class, + * classpath, and executable arguments. + * @return Thread running with process, or null if unable to start + */ + public Thread runInSameVM() { + final RunProperties props = new RunProperties(compilerConfig, + runtimeProperties, uiBuildMsgHandler, rootFrame); + if (!props.valid) { + return null; // error already handled + } + Runnable runner = new Runnable() { + public void run() { + try { + Reflection.runMainInSameVM(props.classpath, + props.mainClass, props.args); + } catch (Throwable e) { + Message msg = new Message("Error running " + + props.mainClass, IMessage.ERROR, e, null); + uiBuildMsgHandler.handleMessage(msg); + } + } + }; + Thread result = new Thread(runner, props.mainClass); + result.start(); + return result; } - + /** - * Call this method with a custom IMessageHandler to override the default message - * handling. - * @param aHandler + * Utility to run the project main class from the project properties in a + * new VM. Errors are logged to the ErrorHandler. + * + * @return LangUtil.ProcessController running with process, or null if + * unable to start */ - public void setMessageHandler(IMessageHandler aHandler) { - this.messageHandler = aHandler; + public LangUtil.ProcessController runInNewVM() { + final RunProperties props = new RunProperties(compilerConfig, + runtimeProperties, uiBuildMsgHandler, rootFrame); + if (!props.valid) { + return null; // error already handled + } + // setup to run asynchronously, pipe streams through, and report errors + final StringBuffer command = new StringBuffer(); + LangUtil.ProcessController controller = new LangUtil.ProcessController() { + public void doCompleting(Throwable thrown, int result) { + LangUtil.ProcessController.Thrown any = getThrown(); + if (!any.thrown && (null == thrown) && (0 == result)) { + return; // no errors + } + // handle errors + String context = props.mainClass + " command \"" + command + + "\""; + if (null != thrown) { + String m = "Exception running " + context; + uiBuildMsgHandler.handleMessage(new Message(m, + IMessage.ERROR, thrown, null)); + } else if (0 != result) { + String m = "Result of running " + context; + uiBuildMsgHandler.handleMessage(new Message(m, + IMessage.ERROR, thrown, null)); + } + if (null != any.fromInPipe) { + String m = "Error processing input pipe for " + context; + uiBuildMsgHandler.handleMessage(new Message(m, + IMessage.ERROR, thrown, null)); + } + if (null != any.fromOutPipe) { + String m = "Error processing output pipe for " + context; + uiBuildMsgHandler.handleMessage(new Message(m, + IMessage.ERROR, thrown, null)); + } + if (null != any.fromErrPipe) { + String m = "Error processing error pipe for " + context; + uiBuildMsgHandler.handleMessage(new Message(m, + IMessage.ERROR, thrown, null)); + } + } + }; + + controller = LangUtil.makeProcess(controller, props.classpath, + props.mainClass, props.args); + + command.append(Arrays.asList(controller.getCommand()).toString()); + + // now run the process + controller.start(); + return controller; } - - public IMessageHandler getMessageHandler() { - return messageHandler; + + /** struct class to interpret project properties */ + private static class RunProperties { + final String mainClass; + final String classpath; + final String[] args; + final boolean valid; + private Frame rootFrame; + + RunProperties(ICompilerConfiguration compilerConfig, + IRuntimeProperties runtimeProperties, + IUIBuildMessageHandler handler, Frame rootFrame) { + // XXX really run arbitrary handler in constructor? hmm. + LangUtil.throwIaxIfNull(runtimeProperties, "runtime properties"); + LangUtil.throwIaxIfNull(compilerConfig, "compiler configuration"); + LangUtil.throwIaxIfNull(handler, "handler"); + LangUtil.throwIaxIfNull(rootFrame, "rootFrame"); + String mainClass = null; + String classpath = null; + String[] args = null; + boolean valid = false; + this.rootFrame = rootFrame; + + mainClass = runtimeProperties.getClassToExecute(); + if (LangUtil.isEmpty(mainClass)) { + showWarningMessage("No main class specified"); + } else { + StringBuffer sb = new StringBuffer(); + List outputDirs = compilerConfig.getOutputLocationManager() + .getAllOutputLocations(); + for (Iterator iterator = outputDirs.iterator(); iterator + .hasNext();) { + File dir = (File) iterator.next(); + sb.append(dir.getAbsolutePath() + File.pathSeparator); + } + classpath = LangUtil.makeClasspath(null, compilerConfig + .getClasspath(), sb.toString(), compilerConfig + .getOutJar()); + if (LangUtil.isEmpty(classpath)) { + showWarningMessage("No classpath specified"); + } else { + args = LangUtil.split(runtimeProperties.getExecutionArgs()); + valid = true; + } + } + this.mainClass = mainClass; + this.classpath = classpath; + this.args = args; + this.valid = valid; + } + + private void showWarningMessage(String message) { + JOptionPane.showMessageDialog(rootFrame, message, "Warning", + JOptionPane.WARNING_MESSAGE); + } + } - public BuildManager getBuildManager() { - return buildManager; + /** + * Set the build off in the same thread + * + * @param configFile + * @param buildFresh - + * true if want to do a full build, false otherwise + */ + public void runBuildInSameThread(String configFile, boolean buildFresh) { + AjCompiler c = getCompilerForConfigFile(configFile); + if (c == null) + return; + if (buildFresh) { + c.buildFresh(); + } else { + c.build(); + } } - -// public EditorManager getEditorManager() { -// return editorManager; -// } - - public EditorAdapter getEditorAdapter() { - return editorAdapter; + + /** + * Set the build off in a different thread. Would need to set the build off + * in a different thread if using a swing application to display the build + * progress. + * + * @param configFile + * @param buildFresh - + * true if want to do a full build, false otherwise + */ + public void runBuildInDifferentThread(String configFile, boolean buildFresh) { + AjCompiler c = getCompilerForConfigFile(configFile); + if (c == null) + return; + CompilerThread compilerThread = new CompilerThread(c, buildFresh); + compilerThread.start(); } - - public StructureViewManager getStructureViewManager() { - return structureViewManager; + + class CompilerThread extends Thread { + + private AjCompiler compiler; + private boolean buildFresh; + + public CompilerThread(AjCompiler compiler, boolean buildFresh) { + this.compiler = compiler; + this.buildFresh = buildFresh; + } + + public void run() { + if (buildFresh) { + compiler.buildFresh(); + } else { + compiler.build(); + } + } } - public StructureSearchManager getStructureSearchManager() { - return structureSearchManager; + public void enableLogging(PrintStream logPrintStream) { + this.logPrintStream = logPrintStream; } - public BuildConfigManager getConfigurationManager() { - return configurationManager; + public void disableLogging() { + this.logPrintStream = null; } - public ProjectPropertiesAdapter getProjectProperties() { - return projectProperties; + public boolean isLogging() { + return (this.logPrintStream!=null); } - public TaskListManager getTaskListManager() { - return taskListManager; + public void logEvent(String message) { + if (logPrintStream != null) { + logPrintStream.println("<AJDE> " + message); + } } + + // ---------- getter methods for the ui -------------- - public IdeUIAdapter getIdeUIAdapter() { - return ideUIAdapter; + /** + * @return the singleton instance + */ + public static Ajde getDefault() { + return INSTANCE; } - public void setIdeUIAdapter(IdeUIAdapter ideUIAdapter) { - this.ideUIAdapter = ideUIAdapter; + /** + * @return the BrowserViewManager + */ + public BrowserViewManager getViewManager() { + return viewManager; } - - public ErrorHandler getErrorHandler() { - return errorHandler; + + /** + * @return the main frame + */ + public Frame getRootFrame() { + return rootFrame; } - - public String getVersion() { - return Version.text; + + /** + * @return the parent frame for the options panel + */ + public OptionsFrame getOptionsFrame() { + return optionsFrame; } - public void enableLogging(PrintStream logPrintStream) { - this.logPrintStream = logPrintStream; + /** + * @return the IdeUIAdapter + */ + public IdeUIAdapter getIdeUIAdapter() { + return ideUIAdapter; } - public void disableLogging() { - this.logPrintStream = null; + /** + * @return the EditorAdapter + */ + public EditorAdapter getEditorAdapter() { + return editorAdapter; } - - public boolean isLogging() { - return (this.logPrintStream!=null); + + /** + * @return the TreeViewBuildConfigEditor + */ + public TreeViewBuildConfigEditor getBuildConfigEditor() { + return buildConfigEditor; } - + + /** + * @return the StructureViewPanel + */ + public StructureViewPanel getFileStructurePanel() { + return fileStructurePanel; + } + /** - * The structure manager is not a part of the public API and its - * use should be avoided. Used <CODE>getStructureViewManager()</CODE> - * instead. + * @return the IconRegistry */ - public AsmManager getStructureModelManager() { - return AsmManager.getDefault(); + public IconRegistry getIconRegistry() { + return iconRegistry; } - public void logEvent(String message) { - if (logPrintStream != null) { - logPrintStream.println("<AJDE> " + message); - } + /** + * @return the StructureViewManager + */ + public StructureViewManager getStructureViewManager() { + return structureViewManager; } - /** - * Utility to run the project main class from the project - * properties in the same VM - * using a class loader populated with the classpath - * and output path or jar. - * Errors are logged to the ErrorHandler. - * @param project the ProjectPropertiesAdapter specifying the - * main class, classpath, and executable arguments. - * @return Thread running with process, or null if unable to start - */ - public Thread runInSameVM() { - final RunProperties props - = new RunProperties(getProjectProperties(), getErrorHandler()); - if (!props.valid) { - return null; // error already handled - } - Runnable runner = new Runnable() { - public void run() { - try { - Reflection.runMainInSameVM( - props.classpath, - props.mainClass, - props.args); - } catch(Throwable e) { - Ajde.getDefault().getErrorHandler().handleError("Error running " + props.mainClass, e); - } - } - }; - Thread result = new Thread(runner, props.mainClass); - result.start(); - return result; - } - - /** - * Utility to run the project main class from the project - * properties in a new VM. - * Errors are logged to the ErrorHandler. - * @return LangUtil.ProcessController running with process, - * or null if unable to start - */ - public LangUtil.ProcessController runInNewVM() { - final RunProperties props - = new RunProperties(getProjectProperties(), getErrorHandler()); - if (!props.valid) { - return null; // error already handled - } - // setup to run asynchronously, pipe streams through, and report errors - final StringBuffer command = new StringBuffer(); - LangUtil.ProcessController controller - = new LangUtil.ProcessController() { - public void doCompleting(Throwable thrown, int result) { - LangUtil.ProcessController.Thrown any = getThrown(); - if (!any.thrown && (null == thrown) && (0 == result)) { - return; // no errors - } - // handle errors - String context = props.mainClass - + " command \"" - + command - + "\""; - if (null != thrown) { - String m = "Exception running " + context; - getErrorHandler().handleError(m, thrown); - } else if (0 != result) { - String m = "Result of running " + context; - getErrorHandler().handleError(m + ": " + result); - } - if (null != any.fromInPipe) { - String m = "Error processing input pipe for " + context; - getErrorHandler().handleError(m, any.fromInPipe); - } - if (null != any.fromOutPipe) { - String m = "Error processing output pipe for " + context; - getErrorHandler().handleError(m, any.fromOutPipe); - } - if (null != any.fromErrPipe) { - String m = "Error processing error pipe for " + context; - getErrorHandler().handleError(m, any.fromErrPipe); - } - } - }; - - controller = LangUtil.makeProcess( - controller, - props.classpath, - props.mainClass, - props.args); - - command.append(Arrays.asList(controller.getCommand()).toString()); - - // now run the process - controller.start(); - return controller; - } + /** + * @return the StructureSearchManager + */ + public StructureSearchManager getStructureSearchManager() { + return structureSearchManager; + } + + /** + * @return the BuildConfigManager + */ + public BuildConfigManager getBuildConfigManager() { + return configurationManager; + } - private final BuildConfigListener STRUCTURE_UPDATE_CONFIG_LISTENER = new BuildConfigListener() { - public void currConfigChanged(String configFilePath) { - if (configFilePath != null) Ajde.getDefault().getStructureModelManager().readStructureModel(configFilePath); - } - - public void configsListUpdated(List configsList) { } - }; + // -------------- getter methods for the compiler ------------- - private final BuildListener BUILD_STATUS_LISTENER = new BuildListener() { - - /** - * Writes the default configuration file if it has been selected for compilation - */ - public void compileStarted(String buildConfig) { - String configFilePath = projectProperties.getDefaultBuildConfigFile(); - if (buildConfig.equals(configFilePath)) { - configurationManager.writePaths(configFilePath, projectProperties.getProjectSourceFiles()); - logEvent("wrote default build config: " + configFilePath); - } - } - - /** - * The strucutre model is annotated with error messages after an unsuccessful compile. - */ - public void compileFinished(String buildConfig, int buildTime, boolean succeeded, boolean warnings) { -// String configFilePath = projectProperties.getDefaultBuildConfigFile(); - if (!succeeded) { - AsmManager.getDefault().fireModelUpdated(); - } - } - - /** - * Ignored. - */ - public void compileAborted(String buildConfigFile, String message) { } - }; - - public void setErrorHandler(ErrorHandler errorHandler) { - this.errorHandler = errorHandler; + /** + * @return the ICompilerConfiguration + */ + public ICompilerConfiguration getCompilerConfig() { + return compilerConfig; } - /** struct class to interpret project properties */ - private static class RunProperties { - final String mainClass; - final String classpath; - final String[] args; - final boolean valid; - RunProperties( - ProjectPropertiesAdapter project, - ErrorHandler handler) { - // XXX really run arbitrary handler in constructor? hmm. - LangUtil.throwIaxIfNull(project, "project"); - LangUtil.throwIaxIfNull(handler, "handler"); - String mainClass = null; - String classpath = null; - String[] args = null; - boolean valid = false; - - mainClass = project.getClassToExecute(); - if (LangUtil.isEmpty(mainClass)) { - handler.handleWarning("No main class specified"); - } else { - classpath = LangUtil.makeClasspath( - project.getBootClasspath(), - project.getClasspath(), - project.getOutputPath(), - project.getOutJar()); - if (LangUtil.isEmpty(classpath)) { - handler.handleWarning("No classpath specified"); - } else { - args = LangUtil.split(project.getExecutionArgs()); - valid = true; - } - } - this.mainClass = mainClass; - this.classpath = classpath; - this.args = args; - this.valid = valid; - } - } - - /** - * Returns true if the compiler is compatible with Java 6 - * (which it will do when the compiler is upgraded to the - * jdt 3.2 compiler) and false otherwise + /** + * @return the IUIBuildMessageHandler */ - public boolean compilerIsJava6Compatible() { - // If it doesn't understand the jdklevel, versionToJdkLevel returns 0 - return CompilerOptions.versionToJdkLevel(BuildOptionsAdapter.VERSION_16) != 0; - } + public IUIBuildMessageHandler getMessageHandler() { + return uiBuildMsgHandler; + } + /** + * @return the IBuildProgressMonitor + */ + public IBuildProgressMonitor getBuildProgressMonitor() { + return buildProgressMonitor; + } + /** + * If the provided configFile is the same as the id for the + * last compiler then returns that, otherwise clears the + * state for the saved compiler and creates a new one for + * the provided configFile + * + * @param configFile + * @return the AjCompiler with the id of the given configFile + */ + public AjCompiler getCompilerForConfigFile(String configFile) { + if (configFile == null) + return null; + if ((compiler == null || !compiler.getId().equals(configFile)) + && configFile != null) { + if (compiler != null) { + // have to remove the incremental state of the previous + // compiler - this will remove it from the + // IncrementalStateManager's + // list + compiler.clearLastState(); + } + getMessageHandler().reset(); + compiler = new AjCompiler(configFile, getCompilerConfig(), + getBuildProgressMonitor(), getMessageHandler()); + } + return compiler; + } } - - diff --git a/ajde/src/org/aspectj/ajde/BuildConfigListener.java b/ajde/src/org/aspectj/ajde/BuildConfigListener.java deleted file mode 100644 index d5e9e9fe5..000000000 --- a/ajde/src/org/aspectj/ajde/BuildConfigListener.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation - * ******************************************************************/ - - - -package org.aspectj.ajde; - -import java.util.EventListener; -import java.util.List; - -/** - * @author Mik Kersten - */ -public interface BuildConfigListener extends EventListener { - - /** - * Called when the current configuration has changed. - * - * @param configFilePath the path to the new current configuration file - */ - public void currConfigChanged(String configFilePath); - - /** - * Called when items are added to or deleted from the configurations list. - */ - public void configsListUpdated(List configsList); -} diff --git a/ajde/src/org/aspectj/ajde/BuildConfigManager.java b/ajde/src/org/aspectj/ajde/BuildConfigManager.java deleted file mode 100644 index 207eb2fdf..000000000 --- a/ajde/src/org/aspectj/ajde/BuildConfigManager.java +++ /dev/null @@ -1,91 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation - * ******************************************************************/ - - -package org.aspectj.ajde; - -import java.util.List; - -import org.aspectj.ajde.ui.BuildConfigModel; - -/** - * @author Mik Kersten - */ -public interface BuildConfigManager { - - public static final String CONFIG_FILE_SUFFIX = ".lst"; - - public static final String DEFAULT_CONFIG_LABEL = "<all project files>"; - - /** - * Returns the currently active build configuration file. The current active - * build configuration file that is set in this class is used for building and - * for updating the structure model. - * - * @return full path to the file - */ - public String getActiveConfigFile(); - - /** - * Sets the currently active build configuration file. - * - * @param full path to the file - */ - public void setActiveConfigFile(String currConfigFilePath); - - /** - * Add a listner that will be notified of build configuration change events - */ - public void addListener(BuildConfigListener configurationListener); - - /** - * Remove a configuration listener. - */ - public void removeListener(BuildConfigListener configurationListener); - - /** - * Build a model for the corresponding configuration file. - * - * @param full path to the file - */ - public BuildConfigModel buildModel(String configFilePath); - - /** - * Save the given configuration model to the file that it was generated from. - */ - public void writeModel(BuildConfigModel model); - - /** - * Write a list of source files into a configuration file. File paths will be - * written relative to the path of the configuration file. - */ - public void writePaths(String configFilePath, List paths); - - /** - * Add files to a configuration. - * - * @param configFilePath full path to the configuration file - * @param files list of full paths to the files to be added - */ - public void addFilesToConfig(String configFilePath, List files); - - /** - * Remove files from a configuration. - * - * @param configFilePath full path to the configuration file - * @param files list of full paths to the files to be removed - */ - public void removeFilesFromConfig(String configFilePath, List files); -} - - diff --git a/ajde/src/org/aspectj/ajde/BuildListener.java b/ajde/src/org/aspectj/ajde/BuildListener.java deleted file mode 100644 index ac4c34870..000000000 --- a/ajde/src/org/aspectj/ajde/BuildListener.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation - * ******************************************************************/ - - - -package org.aspectj.ajde; - -import java.util.EventListener; - -/** - * Compiler listeners get notified of compilation events. - * - * @author Mik Kersten - */ -public interface BuildListener extends EventListener { - - /** - * Called when a new build is started. - * - * @param buildConfigFile configuration file used for the last compile - */ - public void compileStarted(String buildConfigFile); - - /** - * Called when a build completes. - * - * @param buildConfigFile configuration file used for the last compile - * @param buildTime compilation time in miliseconds - * @param succeeded true if build succeeded without errors - */ - public void compileFinished(String buildConfigFile, int buildTime, boolean succeeded, boolean warnings); - - /** - * Called when a build is aborted before completion. - * - * @param buildConfigFile configuration used for the last compile - * @param message message explaining reason for abort - */ - public void compileAborted(String buildConfigFile, String message); -} - diff --git a/ajde/src/org/aspectj/ajde/BuildManager.java b/ajde/src/org/aspectj/ajde/BuildManager.java deleted file mode 100644 index 7b442afa6..000000000 --- a/ajde/src/org/aspectj/ajde/BuildManager.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation - * ******************************************************************/ - - -package org.aspectj.ajde; - - -/** - * Responsible for the build process, including compiler invocation, threading, and error - * reporting. - * - * @author Mik Kersten - */ -public interface BuildManager { - - /** - * Build the structure model for the default build configuration. No ".class" files - * are generated. - */ - public void buildStructure(); - - /** - * Build the default build configuration. - */ - public void build(); - - /** - * Batch-build the default build configuration - * when in incremental mode. - */ - public void buildFresh(); - - /** - * Build the specified build configuration. - */ - public void build(String configFile); - - /** - * Batch-build the specified build configuration - * when in incremental mode. - */ - public void buildFresh(String configFile); - - /** - * Exit the build immediately, before completion. - */ - public void abortBuild(); - - public BuildOptionsAdapter getBuildOptions(); - - public boolean isStructureDirty(); - - public void setStructureDirty(boolean structureDirty); - - public void setBuildModelMode(boolean mode); - - public void addListener(BuildListener compilerListener); - - public void removeListener(BuildListener compilerListener); -} - diff --git a/ajde/src/org/aspectj/ajde/BuildOptionsAdapter.java b/ajde/src/org/aspectj/ajde/BuildOptionsAdapter.java deleted file mode 100644 index 25630c80a..000000000 --- a/ajde/src/org/aspectj/ajde/BuildOptionsAdapter.java +++ /dev/null @@ -1,177 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation - * AMC 01.20.2003 extended for AspectJ 1.1 compiler options - * ******************************************************************/ - - - -package org.aspectj.ajde; - -import java.util.Map; -import java.util.Set; - -/** - * When a particular option is not set its documented default is used. - */ -public interface BuildOptionsAdapter { - - // Version constants - public static final String VERSION_13 = "1.3"; - public static final String VERSION_14 = "1.4"; - public static final String VERSION_15 = "1.5"; - public static final String VERSION_16 = "1.6"; - - // Warning constants - public static final String WARN_CONSTRUCTOR_NAME = "constructorName"; - public static final String WARN_PACKAGE_DEFAULT_METHOD = "packageDefaultMethod"; - public static final String WARN_DEPRECATION = "deprecation"; - public static final String WARN_MASKED_CATCH_BLOCKS = "maskedCatchBlocks"; - public static final String WARN_UNUSED_LOCALS = "unusedLocals"; - public static final String WARN_UNUSED_ARGUMENTS = "unusedArguments"; - public static final String WARN_UNUSED_IMPORTS = "unusedImports"; - public static final String WARN_SYNTHETIC_ACCESS = "syntheticAccess"; - public static final String WARN_ASSERT_IDENITIFIER = "assertIdentifier"; - public static final String WARN_NLS = "nonExternalisedString"; - - // Debug constants - public static final String DEBUG_SOURCE = "source"; - public static final String DEBUG_LINES = "lines"; - public static final String DEBUG_VARS = "vars"; - public static final String DEBUG_ALL = "all"; - - - /** - * This map shortcuts any other Java-specific options that would get set by return - * values from the other methods. - * - * @return a map of all the java-specific options, null if individual options will be passed - */ - public Map getJavaOptionsMap(); - -// /** -// * Use javac to generate .class files. The default is "false". -// * From -usejavac -// * @deprecated Not supported from AspectJ 1.1 onwards -// */ -// public boolean getUseJavacMode(); -// -// /** -// * Only relevant with Use Javac or Preprocess modes. Specify where to place -// * intermediate .java files. The default is "workingdir". -// * From -workingdir -// * @deprecated Not supported from AspectJ 1.1 onwards -// */ -// public String getWorkingOutputPath(); - -// /** -// * Generate regular Java code into the Working OutputPath. Don't try to generate -// * any .class files. The default is "false". -// * From -source -// * @deprecated Not supported from AspectJ 1.1 onwards -// */ -// public boolean getPreprocessMode(); -// - /** - * Specify character encoding used by source files. The default is the current - * JVM's default. - * From -encoding - */ - public String getCharacterEncoding(); - -// /** -// * Support assertions as defined in JLS-1.4. The default is "false". -// * @deprecated Use getComplianceLevel instead -// */ -// public boolean getSourceOnePointFourMode(); -// - - /** - * Run compiles incrementally. - * @since AspectJ 1.1 - */ - public boolean getIncrementalMode(); - -// /** -// * Be extra-lenient in interpreting the Java specification. The default is "false", -// * i.e. "regular" mode. -// * From -lenient -// * @deprecated Not supported from AspectJ 1.1 onwards -// */ -// public boolean getLenientSpecMode(); - -// /** -// * Be extra-strict in interpreting the Java specification. The default is "false", -// * i.e. "regular" mode. -// * From -strict -// * @deprecated Not supported from AspectJ 1.1 onwards -// */ -// public boolean getStrictSpecMode(); -// -// /** -// * Make the use of some features from pre-1.0 versions of AspectJ be warnings to ease -// * porting of old code. The default is "false". -// * From -porting -// * @deprecated Not supported from AspectJ 1.1 onwards -// */ -// public boolean getPortingMode(); - - /** - * The non-standard, typically prefaced with -X when used with a command line compiler. - * The default is no non-standard options. - */ - public String getNonStandardOptions(); - - // ---------------------------------- - // New options added for AspectJ 1.1 from this point onwards - - /** - * JDK Compliance level to be used by the compiler, either - * VERSION_13, VERSION_14 or VERSION_15. - * From -1.3 / -1.4 / -1.5 - */ - public String getComplianceLevel(); - - /** - * Source compatibility level, either VERSION_13, VERSION_14 - * or VERSION_15 - * From -source (eclipse option) - */ - public String getSourceCompatibilityLevel(); - - /** - * Optional warnings, empty List is equivalent to -warn:none, - * returning null uses eclipse compiler default settings - * From -warn:xxx,yyy - */ - public Set getWarnings(); - - /** - * Debug level. DEBUG_ALL == {SOURCE, LINES, VARS}. - * Empty list is equivalent to -g:none, returning - * non uses eclipse compiler default settings - * From -g:xxx - */ - public Set getDebugLevel(); - - /** - * No errors generated for unresolved imports - * From -noImportError - */ - public boolean getNoImportError(); - - /** - * Preserve all unused local variables (for debug) - * From -preserveAllLocals - */ - public boolean getPreserveAllLocals(); - -} diff --git a/ajde/src/org/aspectj/ajde/BuildProgressMonitor.java b/ajde/src/org/aspectj/ajde/BuildProgressMonitor.java deleted file mode 100644 index 2a3e2cd88..000000000 --- a/ajde/src/org/aspectj/ajde/BuildProgressMonitor.java +++ /dev/null @@ -1,65 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation - * ******************************************************************/ - - - -package org.aspectj.ajde; - -/** - * This interface should be implemented by a progress monitor that that presents - * the user with the current state of the compile and estimated finish. - * - * @author Mik Kersten - */ -public interface BuildProgressMonitor { - - /** - * The heading that should be used in the title of the progress monitor. - */ - public static final String PROGRESS_HEADING = "AspectJ Build"; - - /** - * Start the progress monitor. - */ - public void start(String configFile); - - /** - * Sets the label describing the current progress phase. - */ - public void setProgressText(String text); - - /** - * Jumps the progress bar to <CODE>newVal</CODE>. - */ - public void setProgressBarVal(int newVal); - - /** - * Makes the progress bar by one. - */ - public void incrementProgressBarVal(); - - /** - * @param maxVal sets the value at which the progress will finish. - */ - public void setProgressBarMax(int maxVal); - - /** - * @return the value at which the progress monitoring will finish. - */ - public int getProgressBarMax(); - - /** - * Jump the progress bar to the end and finish progress monitoring. - */ - public void finish(boolean wasFullBuild); -} diff --git a/ajde/src/org/aspectj/ajde/ConfigurationListener.java b/ajde/src/org/aspectj/ajde/ConfigurationListener.java deleted file mode 100644 index aafa05312..000000000 --- a/ajde/src/org/aspectj/ajde/ConfigurationListener.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation - * ******************************************************************/ - - - -package org.aspectj.ajde; - -import java.util.EventListener; -import java.util.List; - -/** - * @author Mik Kersten - * @deprecated BuildConfigListener XXX unused - delete ConfigurationListener - */ -public interface ConfigurationListener extends EventListener { - - /** - * Called when the current configuration has changed. - * - * @param configFilePath the path to the new current configuration file - */ - public void currConfigChanged(String configFilePath); - - /** - * Called when items are added to or deleted from the configurations list. - */ - public void configsListUpdated(List configsList); -} diff --git a/ajde/src/org/aspectj/ajde/ErrorHandler.java b/ajde/src/org/aspectj/ajde/ErrorHandler.java deleted file mode 100644 index 9dcd06c5f..000000000 --- a/ajde/src/org/aspectj/ajde/ErrorHandler.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation - * ******************************************************************/ - - - -package org.aspectj.ajde; - -/** - * @author Mik Kersten - */ -public interface ErrorHandler { - - public void handleWarning(String message); - - public void handleError(String message); - - public void handleError(String message, Throwable t); -} diff --git a/ajde/src/org/aspectj/ajde/OutputLocationManager.java b/ajde/src/org/aspectj/ajde/OutputLocationManager.java deleted file mode 100644 index cba91c1ec..000000000 --- a/ajde/src/org/aspectj/ajde/OutputLocationManager.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 2006 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: - * Adrian Colyer Initial implementation - * ******************************************************************/ -package org.aspectj.ajde; - -import java.io.File; -import java.util.List; - -/** - * Interface to be implemented by clients that wish to control the output - * folder used to write the results of compiling individual source files. - * @author adrian colyer - * - */ -public interface OutputLocationManager { - - /** - * Return the directory root under which the results of compiling the given - * source file. For example, if the source file contains the type a.b.C, and - * this method returns "target/classes" the resulting class file will be written - * to "target/classes/a/b/C.class" - * - * @param compilationUnit the compilation unit that has been - * compiled - * @return a File object representing the root directory under which compilation results for this - * unit should be written - */ - File getOutputLocationForClass(File compilationUnit); - - /** - * When copying resources from source folders to output location, return the - * root directory under which the resource should be copied. - * - * @param resource the resource to be copied - * @return a File object representing the root directory under which this resource - * should be copied - */ - File getOutputLocationForResource(File resource); - - /** - * Return a list of all output locations handled by this OutputLocationManager - */ - List /*File*/ getAllOutputLocations(); - - /** - * Return the default output location (for example, <my_project>/bin). This is - * where classes which are on the inpath will be placed. - */ - File getDefaultOutputLocation(); - -} diff --git a/ajde/src/org/aspectj/ajde/ProjectPropertiesAdapter.java b/ajde/src/org/aspectj/ajde/ProjectPropertiesAdapter.java deleted file mode 100644 index cb978a629..000000000 --- a/ajde/src/org/aspectj/ajde/ProjectPropertiesAdapter.java +++ /dev/null @@ -1,117 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation - * AMC 01.20.2003 extended for AspectJ 1.1 compiler options - * ******************************************************************/ - - - -package org.aspectj.ajde; - -import java.util.*; - -/** - * @author Mik Kersten - */ -public interface ProjectPropertiesAdapter { - - public String getProjectName(); - - public String getRootProjectDir(); - - public List getBuildConfigFiles(); - - public String getDefaultBuildConfigFile(); - - /** - * @return The last selected build configuration for this project. If no selection - * is present the default build config file for this project is returned. - */ - public String getLastActiveBuildConfigFile(); - - public List getProjectSourceFiles(); - - public String getProjectSourcePath(); - - public String getClasspath(); - - public String getOutputPath(); - - /** - * A non-null OutputLocationManager takes precedence over getOutputPath... - * @return - */ - public OutputLocationManager getOutputLocationManager(); - -// public String getAjcWorkingDir(); - - // @todo: move to build options - public String getBootClasspath(); - - // @todo: move all below to execution options - public String getClassToExecute(); - - public String getExecutionArgs(); - - public String getVmArgs(); - - // following methods added for AspectJ 1.1 - //----------------------------------------- - - /** - * Get the set of input jar files for this compilation. - * Set members should be of type java.io.File. - * An empty set or null is acceptable for this option. - * From -injars. - */ - public Set getInJars(); - - /** - * Get the set of input path elements for this compilation. - * Set members should be of the type java.io.File. - * An empty set or null is acceptable for this option. - * From -injars - */ - public Set getInpath(); - - /** - * Get the set of non-Java resources for this compilation. - * Set members should be of type java.io.File. - * An empty set or null is acceptable for this option. - * From -injars. - * - * @return map from unique resource name to absolute path to source resource (String to File) - */ - public Map getSourcePathResources(); - - /** - * Get the output jar file for the compilation results. - * Return null to leave classfiles unjar'd in output directory - * From -outjar - */ - public String getOutJar(); - - /** - * Get a set of root source directories for the compilation. - * Set members should be of type java.io.File - * Returning null or an empty set disables the option. - * From -sourceroots - */ - public Set getSourceRoots(); - - /** - * Get the set of aspect jar files to be used for the compilation. - * Returning null or an empty set disables this option. Set members - * should be of type java.io.File. - * From -aspectpath - */ - public Set getAspectPath(); -} diff --git a/ajde/src/org/aspectj/ajde/TaskListManager.java b/ajde/src/org/aspectj/ajde/TaskListManager.java deleted file mode 100644 index 6df9e766d..000000000 --- a/ajde/src/org/aspectj/ajde/TaskListManager.java +++ /dev/null @@ -1,54 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, - * 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation - * ******************************************************************/ - - -package org.aspectj.ajde; - -import org.aspectj.bridge.IMessage; -import org.aspectj.bridge.ISourceLocation; - -/** - * Used for displaying tasks, such as compiler messages, to the user. - * - * @author Mik Kersten - */ -public interface TaskListManager { - - /** - * Add a task associated with a particular line in a source file. - * - * @param message description of compiler message - * @param sourceLocation can be null - * @param kind one of <code>ERROR_MESSAGE, WARNING_MESSAGE, INFO_MESSAGE</code> - */ - public void addSourcelineTask(String message, ISourceLocation sourceLocation, IMessage.Kind kind); - - public void addSourcelineTask(IMessage message); - - /** @return true if any messages in list have kind warning or greater */ - public boolean hasWarning(); - - /** - * Add a task associated with the current project. - * - * @param message description of compiler message - * @param kind one of <code>ERROR_MESSAGE, WARNING_MESSAGE, INFO_MESSAGE</code> - */ - public void addProjectTask(String message, IMessage.Kind kind); - - /** - * Delete all of the currently active tasks. - */ - public void clearTasks(); -} - |