KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > java > source > engine > ApplicationContext


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.java.source.engine;
21
22 import org.netbeans.api.java.source.query.ResultTableModel;
23
24 import java.io.IOException JavaDoc;
25 import java.io.InputStream JavaDoc;
26 import java.io.PrintWriter JavaDoc;
27 import javax.tools.JavaFileObject;
28
29 /**
30  * Defines the working environment for the Jackpot engine, which consists
31  * of the mechanisms for accessing source and class files, and communicating
32  * status, log and error information back to the application.
33  */

34 public interface ApplicationContext {
35
36     /**
37      * Returns the build progress reporter for this application.
38      */

39     BuildProgress getBuildProgress();
40     
41     /**
42      * Returns the query progress reporter for this application.
43      */

44     QueryProgress getQueryProgress();
45     
46     /**
47      * Sets any desired Java Bean properties on a command instance before it
48      * executes. If a dialog is displayed, the user has the option of
49      * canceling the command.
50      *
51      * @return false if the operator was canceled by the user.
52      */

53     boolean setProperties(Object JavaDoc command, String JavaDoc title);
54     
55    /**
56      * Send the application the result object from the completion
57      * of an operator execution. This object is usually a ResultTableModel
58      * instance, but if not then its toString() method will be used. The
59      * title is optionally used when displaying the result, depending upon
60      * the client.
61      *
62      * @param result a status object
63      * @param title the title for the result pane
64      */

65     void setResult(Object JavaDoc result, String JavaDoc title);
66
67     /**
68      * Send the application an engine status message. A status message should
69      * normally be short enough to be displayed in an application status bar.
70      * Multiple status messages may be sent during a engine operation.
71      */

72     void setStatusMessage(String JavaDoc message);
73     
74     /**
75      * Send the application an error message regarding an operator
76      * execution. A long message may be sent, and normally a single
77      * error message is sent during a single execution.
78      */

79     void setErrorMessage(String JavaDoc message, String JavaDoc title);
80
81     /**
82      * Opens an output writer for log-type messages similar to what
83      * javac sends to System.out.
84      */

85     PrintWriter JavaDoc getOutputWriter(String JavaDoc title);
86     
87     /**
88      * Returns an operator class, or null if not available.
89      */

90     Class JavaDoc getCommandClass(String JavaDoc className);
91     
92     
93     /**
94      * Returns a source rewriter for the specified source file.
95      */

96     SourceRewriter getSourceRewriter(JavaFileObject sourceFile) throws IOException JavaDoc;
97 }
98
Popular Tags