Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: javax/ide/build/BuildEvent.java


1   package javax.ide.build;
2   
3   import java.util.EventObject;
4   import javax.ide.command.Context;
5   
6   /**
7    * Event object passed to the {@link BuildListener}s.
8    */
9   public final class BuildEvent extends EventObject
10  {
11    private final Context _context;
12    private final boolean _success;
13  
14    /**
15     * Constructor.
16     *
17     * @param buildSystem the build system where the event happened.
18     * @param context the context to build.
19     */
20    public BuildEvent( BuildSystem buildSystem, Context context )
21    {
22      this( buildSystem, context, true );
23    }
24  
25    /**
26     * Constructor.
27     *
28     * @param buildSystem the build system where the event happened.
29     * @param context the context to build.
30     * @param success <code>true</code> if the build is succeding.
31     */
32    public BuildEvent( BuildSystem buildSystem, Context context, boolean success )
33    {
34      super( buildSystem );
35      
36      _context = context;
37      _success = success;
38    }
39  
40    /**
41     * Get the {@link BuildSystem} where the event happened.
42     * This is functionally equivalent to casting the result of getSource() to 
43     * a <code>BuildSystem</code> object.
44     *
45     * @return the {@link BuildSystem} that generated the event.
46     */
47    public BuildSystem getBuildSystem() 
48    {
49      return (BuildSystem)getSource();
50    }
51  
52    /**
53     * Get the context currently used to build. The context selection lists 
54     * all documents being built. The context project provides the source 
55     * and class path.
56     *
57     * @return the current context.
58     */
59    public Context getContext()
60    {
61      return _context;
62    }
63  
64    /**
65     * Flag indicating if the build was successful. Implementors must 
66     * check this flag before proceeding with their pre or post build 
67     * behavior. 
68     *
69     * @return <code>true</code> if build is successful.
70     */
71    public boolean isBuildSuccessful()
72    {
73      return _success;
74    }
75  }
76