KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > core > windows > ViewRequest


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
21 package org.netbeans.core.windows;
22
23 import org.netbeans.core.windows.view.View;
24
25 /**
26  * Class which describes one type of change (in model) which is sent
27  * <code>ViewRequestor</code> from <code>Central</code>.
28  *
29  * @author Peter Zavadsky
30  */

31 final class ViewRequest {
32
33     /** To distinguish between individual mode or top components. */
34     public final Object JavaDoc source;
35
36     public final int type;
37
38     public final Object JavaDoc oldValue;
39
40     public final Object JavaDoc newValue;
41
42
43     /** Creates a new instance of ChangeInfo */
44     public ViewRequest(Object JavaDoc source, int type, Object JavaDoc oldValue, Object JavaDoc newValue) {
45         this.source = source;
46         this.type = type;
47         this.oldValue = oldValue;
48         this.newValue = newValue;
49     }
50     
51     public String JavaDoc toString() {
52         StringBuilder JavaDoc result = new StringBuilder JavaDoc();
53         result.append ("ViewRequest@");
54         result.append (System.identityHashCode(this));
55         result.append (" [TYPE=");
56         String JavaDoc tp;
57         switch (type) {
58             case View.CHANGE_ACTIVE_MODE_CHANGED :
59                 tp = "CHANGE_ACTIVE_MODE_CHANGED"; //NOI18N
60
break;
61             case View.CHANGE_EDITOR_AREA_BOUNDS_CHANGED :
62                 tp = "CHANGE_EDITOR_AREA_BOUNDS_CHANGED"; //NOI18N
63
break;
64             case View.CHANGE_EDITOR_AREA_CONSTRAINTS_CHANGED :
65                 tp = "CHANGE_EDITOR_AREA_CONSTRAINTS_CHANGED"; //NOI18N
66
break;
67             case View.CHANGE_EDITOR_AREA_STATE_CHANGED :
68                 tp = "CHANGE_EDITOR_AREA_STATE_CHANGED"; //NOI18N
69
break;
70             case View.CHANGE_EDITOR_AREA_FRAME_STATE_CHANGED :
71                 tp = "CHANGE_EDITOR_AREA_FRAME_STATE_CHANGED"; //NOI18N
72
break;
73             case View.CHANGE_MAIN_WINDOW_BOUNDS_JOINED_CHANGED :
74                 tp = "CHANGE_MAIN_WINDOW_BOUNDS_JOINED_CHANGED"; //NOI18N
75
break;
76             case View.CHANGE_MAIN_WINDOW_BOUNDS_SEPARATED_CHANGED :
77                 tp = "CHANGE_MAIN_WINDOW_BOUNDS_SEPARATED_CHANGED"; //NOI18N
78
break;
79             case View.CHANGE_MAIN_WINDOW_FRAME_STATE_JOINED_CHANGED :
80                 tp = "CHANGE_MAIN_WINDOW_FRAME_STATE_JOINED_CHANGED"; //NOI18N
81
break;
82             case View.CHANGE_MAIN_WINDOW_FRAME_STATE_SEPARATED_CHANGED :
83                 tp = "CHANGE_MAIN_WINDOW_FRAME_STATE_SEPARATED_CHANGED"; //NOI18N
84
break;
85             case View.CHANGE_MAXIMIZED_MODE_CHANGED :
86                 tp = "CHANGE_MAXIMIZED_MODE_CHANGED"; //NOI18N
87
break;
88             case View.CHANGE_MODE_SELECTED_TOPCOMPONENT_CHANGED :
89                 tp = "CHANGE_MODE_SELECTED_TOPCOMPONENT_CHANGED"; //NOI18N
90
break;
91             case View.CHANGE_MODE_BOUNDS_CHANGED :
92                 tp = "CHANGE_MODE_BOUNDS_CHANGED"; //NOI18N
93
break;
94             case View.CHANGE_MODE_CONSTRAINTS_CHANGED :
95                 tp = "CHANGE_MODE_CONSTRAINTS_CHANGED"; //NOI18N
96
break;
97             case View.CHANGE_MODE_FRAME_STATE_CHANGED :
98                 tp = "CHANGE_MODE_FRAME_STATE_CHANGED"; //NOI18N
99
break;
100             case View.CHANGE_TOOLBAR_CONFIGURATION_CHANGED :
101                 tp = "CHANGE_TOOLBAR_CONFIGURATION_CHANGED"; //NOI18N
102
break;
103             case View.CHANGE_TOPCOMPONENT_ICON_CHANGED :
104                 tp = "CHANGE_TOPCOMPONENT_ICON_CHANGED"; //NOI18N
105
break;
106             case View.CHANGE_TOPCOMPONENT_DISPLAY_NAME_CHANGED :
107                 tp = "CHANGE_TOPCOMPONENT_DISPLAY_NAME_CHANGED"; //NOI18N
108
break;
109             case View.CHANGE_TOPCOMPONENT_DISPLAY_NAME_ANNOTATION_CHANGED :
110                 tp = "CHANGE_TOPCOMPONENT_DISPLAY_NAME_ANNOTATION_CHANGED"; //NOI18N
111
break;
112             case View.CHANGE_TOPCOMPONENT_TOOLTIP_CHANGED :
113                 tp = "CHANGE_TOPCOMPONENT_TOOLTIP_CHANGED"; //NOI18N
114
break;
115             case View.CHANGE_TOPCOMPONENT_ACTIVATED :
116                 tp = "CHANGE_TOPCOMPONENT_ACTIVATED"; //NOI18N
117
break;
118             case View.CHANGE_DND_PERFORMED :
119                 tp = "CHANGE_DND_PERFORMED"; //NOI18N
120
break;
121             case View.CHANGE_UI_UPDATE :
122                 tp = "CHANGE_UI_UPDATE"; //NOI18N
123
break;
124             case View.TOPCOMPONENT_REQUEST_ATTENTION :
125                 tp = "TOPCOMPONENT_REQUEST_ATTENTION"; //NOI18N
126
break;
127             case View.TOPCOMPONENT_CANCEL_REQUEST_ATTENTION :
128                 tp = "TOPCOMPONENT_CANCEL_REQUEST_ATTENTION"; //NOI18N
129
break;
130             default :
131                 tp = "UNKNOWN";
132                 break;
133         }
134         result.append (tp).append ("] [oldValue:").append(oldValue)
135                 .append("] [newValue:").append(newValue)
136                 .append("] [source:").append(source).append(']');
137         return result.toString();
138     }
139         
140 }
141
142
Popular Tags