Source Code Cross Referenced for AbstractTabDescriptor.java in  » IDE-Eclipse » ui » org » eclipse » ui » views » properties » tabbed » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Eclipse » ui » org.eclipse.ui.views.properties.tabbed 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2007 IBM Corporation and others.
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         *     IBM Corporation - initial API and implementation
010:         ******************************************************************************/package org.eclipse.ui.views.properties.tabbed;
011:
012:        import java.util.ArrayList;
013:        import java.util.Iterator;
014:        import java.util.List;
015:
016:        import org.eclipse.core.runtime.IStatus;
017:        import org.eclipse.core.runtime.Status;
018:        import org.eclipse.swt.graphics.Image;
019:        import org.eclipse.ui.internal.views.properties.tabbed.TabbedPropertyViewPlugin;
020:
021:        /**
022:         * An abstract implementation of a tab descriptor for the tabbed property view.
023:         * 
024:         * @author Anthony Hunter
025:         * @since 3.4
026:         */
027:        public abstract class AbstractTabDescriptor implements  ITabDescriptor,
028:                Cloneable {
029:
030:            private List sectionDescriptors;
031:
032:            /**
033:             * Constructor for AbstractTabDescriptor.
034:             */
035:            public AbstractTabDescriptor() {
036:                super ();
037:                sectionDescriptors = new ArrayList(5);
038:            }
039:
040:            /*
041:             * @see java.lang.Object#clone()
042:             */
043:            public Object clone() {
044:                try {
045:                    return super .clone();
046:                } catch (CloneNotSupportedException exception) {
047:                    IStatus status = new Status(IStatus.ERROR,
048:                            TabbedPropertyViewPlugin.getPlugin().getBundle()
049:                                    .getSymbolicName(), 666, exception
050:                                    .getMessage(), exception);
051:                    TabbedPropertyViewPlugin.getPlugin().getLog().log(status);
052:                }
053:                return null;
054:            }
055:
056:            /*
057:             * @see org.eclipse.ui.views.properties.tabbed.ITabDescriptor#createTab()
058:             */
059:            public TabContents createTab() {
060:                List sections = new ArrayList(getSectionDescriptors().size());
061:                for (Iterator iter = getSectionDescriptors().iterator(); iter
062:                        .hasNext();) {
063:                    ISectionDescriptor descriptor = (ISectionDescriptor) iter
064:                            .next();
065:                    ISection section = descriptor.getSectionClass();
066:                    sections.add(section);
067:                }
068:                TabContents tab = new TabContents();
069:                tab.setSections((ISection[]) sections
070:                        .toArray(new ISection[sections.size()]));
071:                return tab;
072:            }
073:
074:            /*
075:             * @see java.lang.Object#equals(java.lang.Object)
076:             */
077:            public boolean equals(Object object) {
078:                if (this  == object) {
079:                    return true;
080:                }
081:
082:                if (this .getClass() == object.getClass()) {
083:                    AbstractTabDescriptor descriptor = (AbstractTabDescriptor) object;
084:                    if (this .getCategory().equals(descriptor.getCategory())
085:                            && this .getId().equals(descriptor.getId())
086:                            && this .getSectionDescriptors().size() == descriptor
087:                                    .getSectionDescriptors().size()) {
088:
089:                        Iterator i = this .getSectionDescriptors().iterator();
090:                        Iterator j = descriptor.getSectionDescriptors()
091:                                .iterator();
092:
093:                        // the order is important here - so as long as the sizes of the
094:                        // lists are the same and id of the section at the same
095:                        // positions are the same - the lists are the same
096:                        while (i.hasNext()) {
097:                            ISectionDescriptor source = (ISectionDescriptor) i
098:                                    .next();
099:                            ISectionDescriptor target = (ISectionDescriptor) j
100:                                    .next();
101:                            if (!source.getId().equals(target.getId())) {
102:                                return false;
103:                            }
104:                        }
105:
106:                        return true;
107:                    }
108:
109:                }
110:
111:                return false;
112:            }
113:
114:            /*
115:             * @see org.eclipse.ui.views.properties.tabbed.ITabDescriptor#getAfterTab()
116:             */
117:            public String getAfterTab() {
118:                return TOP;
119:            }
120:
121:            /*
122:             * @see org.eclipse.ui.views.properties.tabbed.ITabItem#getImage()
123:             */
124:            public Image getImage() {
125:                return null;
126:            }
127:
128:            /**
129:             * Get the list of section descriptors for the tab.
130:             * 
131:             * @return the list of section descriptors for the tab.
132:             */
133:            public List getSectionDescriptors() {
134:                return sectionDescriptors;
135:            }
136:
137:            /*
138:             * @see org.eclipse.ui.views.properties.tabbed.ITabItem#getText()
139:             */
140:            public String getText() {
141:                return getLabel();
142:            }
143:
144:            /*
145:             * @see java.lang.Object#hashCode()
146:             */
147:            public int hashCode() {
148:
149:                int hashCode = getCategory().hashCode();
150:                hashCode ^= getId().hashCode();
151:                Iterator i = this .getSectionDescriptors().iterator();
152:                while (i.hasNext()) {
153:                    ISectionDescriptor section = (ISectionDescriptor) i.next();
154:                    hashCode ^= section.getId().hashCode();
155:                }
156:                return hashCode;
157:            }
158:
159:            /*
160:             * @see org.eclipse.ui.views.properties.tabbed.ITabItem#isIndented()
161:             */
162:            public boolean isIndented() {
163:                return false;
164:            }
165:
166:            /*
167:             * @see org.eclipse.ui.views.properties.tabbed.ITabItem#isSelected()
168:             */
169:            public boolean isSelected() {
170:                return false;
171:            }
172:
173:            /**
174:             * Set the list of section descriptors for the tab.
175:             * 
176:             * @param sectionDescriptors
177:             *            the list of section descriptors for the tab.
178:             */
179:            public void setSectionDescriptors(List sectionDescriptors) {
180:                this.sectionDescriptors = sectionDescriptors;
181:            }
182:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.