KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > core > windows > persistence > TCGroupConfig


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.persistence;
22
23
24 /**
25  * Class of config properties of reference of TopComponent in group for communication
26  * with persistence management.
27  * It keeps data which are read/written from/in .wstcgrp xml file.
28  *
29  * @author Peter Zavadsky
30  */

31 public class TCGroupConfig {
32
33     /** Reference to TopComponent by its unique Id. */
34     public String JavaDoc tc_id;
35
36     /** Should TopComponent be opened when group is being opened. */
37     public boolean open;
38
39     /** Should TopComponent be closed when group is being closed. */
40     public boolean close;
41     
42     /** Whether the TopComponent was opened at the time the group was opening.
43      * It is relevant only in case group state opened is true. */

44     public boolean wasOpened;
45     
46     
47     /** Creates a new instance of TCGroupConfig */
48     public TCGroupConfig() {
49         tc_id = ""; // NOI18N
50
}
51     
52     public boolean equals (Object JavaDoc obj) {
53         if (this == obj) {
54             return true;
55         }
56         if (obj instanceof TCGroupConfig) {
57             TCGroupConfig tcGroupCfg = (TCGroupConfig) obj;
58             return tc_id.equals(tcGroupCfg.tc_id) &&
59                    (open == tcGroupCfg.open) &&
60                    (close == tcGroupCfg.close) &&
61                    (wasOpened == tcGroupCfg.wasOpened);
62         }
63         return false;
64     }
65     
66     public int hashCode() {
67         int hash = 17;
68         hash = 37 * hash + tc_id.hashCode();
69         hash = 37 * hash + (open ? 0 : 1);
70         hash = 37 * hash + (close ? 0 : 1);
71         hash = 37 * hash + (wasOpened ? 0 : 1);
72         return hash;
73     }
74     
75 }
76
Popular Tags