KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > refactoring > ui > j > 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-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.xml.refactoring.ui.j.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     public static final long serialVersionUID = 1L;
29     /** Start event id */
30     public static final int START = 1;
31     /** Step event id */
32     public static final int STEP = 2;
33     /** Stop event id */
34     public static final int STOP = 4;
35
36     // event id
37
private final int eventId;
38     // type of opreation that is being processed (source-specific number)
39
private final int operationType;
40     // number of steps of the operation being processed
41
private final int count;
42
43     /** Creates ProgressEvent instance.
44      * @param source Source of the event.
45      * @param eventId ID of the event.
46      */

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

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

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

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

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