KickJava   Java API By Example, From Geeks To Geeks.

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


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

31 public class TCRefConfig {
32
33     /** Reference to TopComponent by its unique Id. */
34     public String JavaDoc tc_id;
35
36     /** Is TopComponent opened. */
37     public boolean opened;
38
39     public String JavaDoc previousMode;
40     /** tab index in the previous mode */
41     public int previousIndex;
42     
43     /** True if this TopComponent is docked when the editor is maximized,
44      * false (default) if it should slide out */

45     public boolean dockedInMaximizedMode;
46     /** True (default) if this TopComponent is docked in the default mode,
47      * false if it is slided out */

48     public boolean dockedInDefaultMode;
49     /** True if this TopComponent is maximized when slided-in (covers the whole main window) */
50     public boolean slidedInMaximized;
51
52     /** Creates a new instance of TCRefConfig */
53     public TCRefConfig() {
54         tc_id = ""; // NOI18N
55
dockedInMaximizedMode = false;
56         dockedInDefaultMode = true;
57         slidedInMaximized = false;
58         previousIndex = -1;
59     }
60     
61     public boolean equals (Object JavaDoc obj) {
62         if (this == obj) {
63             return true;
64         }
65         if (obj instanceof TCRefConfig) {
66             TCRefConfig tcRefCfg = (TCRefConfig) obj;
67             return (tc_id.equals(tcRefCfg.tc_id)
68                    && (opened == tcRefCfg.opened)
69                    && (dockedInMaximizedMode == tcRefCfg.dockedInMaximizedMode)
70                    && (dockedInDefaultMode == tcRefCfg.dockedInDefaultMode)
71                    && (slidedInMaximized == tcRefCfg.slidedInMaximized)
72                    && (previousIndex == tcRefCfg.previousIndex));
73         }
74         return false;
75     }
76     
77     public int hashCode() {
78         int hash = 17;
79         hash = 37 * hash + tc_id.hashCode();
80         hash = 37 * hash + (opened ? 0 : 1);
81         hash = 37 * hash + (dockedInMaximizedMode ? 0 : 1);
82         hash = 37 * hash + (dockedInDefaultMode ? 0 : 1);
83         hash = 37 * hash + (slidedInMaximized ? 0 : 1);
84         hash = 37 * hash + previousIndex;
85         return hash;
86     }
87     
88     public String JavaDoc toString () {
89         return "TCRefConfig: tc_id=" + tc_id + ", opened=" + opened
90                 + ", maximizedMode=" + dockedInMaximizedMode
91                 + ", defaultMode=" + dockedInDefaultMode
92                 + ", slidedInMaximized=" + slidedInMaximized;
93     }
94     
95 }
96
Popular Tags