KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > refactoring > api > ProgressEvent


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 package org.netbeans.modules.refactoring.api;
20
21 import java.util.EventObject JavaDoc;
22
23 /** Progress event object.
24  *
25  * @author Martin Matula
26  */

27 public final class ProgressEvent extends EventObject JavaDoc {
28     /** Start event id */
29     public static final int START = 1;
30     /** Step event id */
31     public static final int STEP = 2;
32     /** Stop event id */
33     public static final int STOP = 4;
34
35     // event id
36
private final int eventId;
37     // type of opreation that is being processed (source-specific number)
38
private final int operationType;
39     // number of steps of the operation being processed
40
private final int count;
41
42     /** Creates ProgressEvent instance.
43      * @param source Source of the event.
44      * @param eventId ID of the event.
45      */

46     public ProgressEvent(Object JavaDoc source, int eventId) {
47         this(source, eventId, 0, 0);
48     }
49
50     /** Creates ProgressEvent instance.
51      * @param source Source of the event.
52      * @param eventId ID of the event.
53      * @param operationType Source-specific number identifying source operation that
54      * is being processed.
55      * @param count Number of steps that the processed opration consists of.
56      */

57     public ProgressEvent(Object JavaDoc source, int eventId, int operationType, int count) {
58         super(source);
59         this.eventId = eventId;
60         this.operationType = operationType;
61         this.count = count;
62     }
63
64     /** Returns ID of the event.
65      * @return ID of the event.
66      */

67     public int getEventId() {
68         return eventId;
69     }
70
71     /** Returns operation type.
72      * @return Source-specific number identifying operation being processed. Needs to
73      * be valid for START events, can be 0 for STEP and STOP events.
74      */

75     public int getOperationType() {
76         return operationType;
77     }
78
79     /** Returns step count.
80      * @return Number of step that the operation being processed consists of. Needs to
81      * be valid for START events, can be 0 for STEP and STOP events. If it is not 0
82      * for STEP events, it is a new progress.
83      */

84     public int getCount() {
85         return count;
86     }
87 }
88
Popular Tags