Source Code Cross Referenced for CompCSTaskObject.java in  » IDE-Eclipse » Eclipse-plug-in-development » org » eclipse » pde » internal » core » cheatsheet » comp » 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 » Eclipse plug in development » org.eclipse.pde.internal.core.cheatsheet.comp 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2006, 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.pde.internal.core.cheatsheet.comp;
011:
012:        import java.io.PrintWriter;
013:        import java.util.ArrayList;
014:        import java.util.Iterator;
015:        import java.util.List;
016:
017:        import org.eclipse.pde.core.IModelChangedEvent;
018:        import org.eclipse.pde.internal.core.XMLPrintHandler;
019:        import org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSDependency;
020:        import org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSIntro;
021:        import org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSModel;
022:        import org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSModelFactory;
023:        import org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSObject;
024:        import org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSOnCompletion;
025:        import org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSTaskObject;
026:        import org.eclipse.pde.internal.core.util.PDETextHelper;
027:        import org.w3c.dom.Element;
028:        import org.w3c.dom.Text;
029:
030:        /**
031:         * CompCSTaskObject
032:         *
033:         */
034:        public abstract class CompCSTaskObject extends CompCSObject implements 
035:                ICompCSTaskObject {
036:
037:            protected String fFieldId;
038:
039:            protected String fFieldKind;
040:
041:            protected ICompCSIntro fFieldIntro;
042:
043:            protected ICompCSOnCompletion fFieldOnCompletion;
044:
045:            protected String fFieldName;
046:
047:            protected boolean fFieldSkip;
048:
049:            protected ArrayList fFieldDependencies;
050:
051:            /**
052:             * @param model
053:             * @param parent
054:             */
055:            public CompCSTaskObject(ICompCSModel model, ICompCSObject parent) {
056:                super (model, parent);
057:                // Reset called by child class
058:            }
059:
060:            /* (non-Javadoc)
061:             * @see org.eclipse.pde.internal.core.cheatsheet.comp.CompCSObject#getChildren()
062:             */
063:            public abstract List getChildren();
064:
065:            /* (non-Javadoc)
066:             * @see org.eclipse.pde.internal.core.cheatsheet.comp.CompCSObject#getName()
067:             */
068:            public abstract String getName();
069:
070:            /* (non-Javadoc)
071:             * @see org.eclipse.pde.internal.core.cheatsheet.comp.CompCSObject#getType()
072:             */
073:            public abstract int getType();
074:
075:            /* (non-Javadoc)
076:             * @see org.eclipse.pde.internal.core.cheatsheet.comp.CompCSObject#reset()
077:             */
078:            public void reset() {
079:                fFieldId = null;
080:                fFieldKind = null;
081:                fFieldIntro = null;
082:                fFieldOnCompletion = null;
083:                fFieldName = null;
084:                fFieldSkip = false;
085:                fFieldDependencies = new ArrayList();
086:            }
087:
088:            /* (non-Javadoc)
089:             * @see org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSTaskObject#addFieldDependency(org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSDependency)
090:             */
091:            public void addFieldDependency(ICompCSDependency dependency) {
092:                fFieldDependencies.add(dependency);
093:                if (isEditable()) {
094:                    fireStructureChanged(dependency, IModelChangedEvent.INSERT);
095:                }
096:            }
097:
098:            /* (non-Javadoc)
099:             * @see org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSTaskObject#getFieldId()
100:             */
101:            public String getFieldId() {
102:                return fFieldId;
103:            }
104:
105:            /* (non-Javadoc)
106:             * @see org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSTaskObject#getFieldIntro()
107:             */
108:            public ICompCSIntro getFieldIntro() {
109:                return fFieldIntro;
110:            }
111:
112:            /* (non-Javadoc)
113:             * @see org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSTaskObject#getFieldKind()
114:             */
115:            public String getFieldKind() {
116:                return fFieldKind;
117:            }
118:
119:            /* (non-Javadoc)
120:             * @see org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSTaskObject#getFieldName()
121:             */
122:            public String getFieldName() {
123:                return fFieldName;
124:            }
125:
126:            /* (non-Javadoc)
127:             * @see org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSTaskObject#getFieldOnCompletion()
128:             */
129:            public ICompCSOnCompletion getFieldOnCompletion() {
130:                return fFieldOnCompletion;
131:            }
132:
133:            /* (non-Javadoc)
134:             * @see org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSTaskObject#getFieldSkip()
135:             */
136:            public boolean getFieldSkip() {
137:                return fFieldSkip;
138:            }
139:
140:            /* (non-Javadoc)
141:             * @see org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSTaskObject#removeFieldDepedency(org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSDependency)
142:             */
143:            public void removeFieldDepedency(ICompCSDependency dependency) {
144:                fFieldDependencies.remove(dependency);
145:                if (isEditable()) {
146:                    fireStructureChanged(dependency, IModelChangedEvent.REMOVE);
147:                }
148:            }
149:
150:            /* (non-Javadoc)
151:             * @see org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSTaskObject#setFieldId(java.lang.String)
152:             */
153:            public void setFieldId(String id) {
154:                String old = fFieldId;
155:                fFieldId = id;
156:                if (isEditable()) {
157:                    firePropertyChanged(ATTRIBUTE_ID, old, fFieldId);
158:                }
159:            }
160:
161:            /* (non-Javadoc)
162:             * @see org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSTaskObject#setFieldIntro(org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSIntro)
163:             */
164:            public void setFieldIntro(ICompCSIntro intro) {
165:                ICompCSObject old = fFieldIntro;
166:                fFieldIntro = intro;
167:                if (isEditable()) {
168:                    fireStructureChanged(intro, old);
169:                }
170:            }
171:
172:            /* (non-Javadoc)
173:             * @see org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSTaskObject#setFieldKind(java.lang.String)
174:             */
175:            public void setFieldKind(String kind) {
176:                String old = fFieldKind;
177:                fFieldKind = kind;
178:                if (isEditable()) {
179:                    firePropertyChanged(ATTRIBUTE_KIND, old, fFieldKind);
180:                }
181:            }
182:
183:            /* (non-Javadoc)
184:             * @see org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSTaskObject#setFieldName(java.lang.String)
185:             */
186:            public void setFieldName(String name) {
187:                String old = fFieldName;
188:                fFieldName = name;
189:                if (isEditable()) {
190:                    firePropertyChanged(ATTRIBUTE_NAME, old, fFieldName);
191:                }
192:            }
193:
194:            /* (non-Javadoc)
195:             * @see org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSTaskObject#setFieldOnCompletion(org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSOnCompletion)
196:             */
197:            public void setFieldOnCompletion(ICompCSOnCompletion onCompletion) {
198:                ICompCSObject old = fFieldOnCompletion;
199:                fFieldOnCompletion = onCompletion;
200:                if (isEditable()) {
201:                    fireStructureChanged(onCompletion, old);
202:                }
203:            }
204:
205:            /* (non-Javadoc)
206:             * @see org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSTaskObject#setFieldSkip(boolean)
207:             */
208:            public void setFieldSkip(boolean skip) {
209:                Boolean old = Boolean.valueOf(fFieldSkip);
210:                fFieldSkip = skip;
211:                if (isEditable()) {
212:                    firePropertyChanged(ATTRIBUTE_SKIP, old, Boolean
213:                            .valueOf(fFieldSkip));
214:                }
215:            }
216:
217:            /* (non-Javadoc)
218:             * @see org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSTaskObject#getFieldDependencies()
219:             */
220:            public ICompCSDependency[] getFieldDependencies() {
221:                return (ICompCSDependency[]) fFieldDependencies
222:                        .toArray(new ICompCSDependency[fFieldDependencies
223:                                .size()]);
224:            }
225:
226:            /* (non-Javadoc)
227:             * @see org.eclipse.pde.internal.core.cheatsheet.comp.CompCSObject#parseText(org.w3c.dom.Text)
228:             */
229:            protected void parseText(Text text) {
230:                // NO-OP
231:            }
232:
233:            /* (non-Javadoc)
234:             * @see org.eclipse.pde.internal.core.cheatsheet.comp.CompCSObject#parseAttributes(org.w3c.dom.Element)
235:             */
236:            protected void parseAttributes(Element element) {
237:                // Process id attribute
238:                // Trim leading and trailing whitespace
239:                fFieldId = element.getAttribute(ATTRIBUTE_ID).trim();
240:                // Process kind attribute
241:                // Trim leading and trailing whitespace
242:                fFieldKind = element.getAttribute(ATTRIBUTE_KIND).trim();
243:                // Process name attribute
244:                // Trim leading and trailing whitespace
245:                fFieldName = element.getAttribute(ATTRIBUTE_NAME).trim();
246:                // Process skip attribute
247:                if (element.getAttribute(ATTRIBUTE_SKIP).compareTo(
248:                        ATTRIBUTE_VALUE_TRUE) == 0) {
249:                    fFieldSkip = true;
250:                }
251:            }
252:
253:            /* (non-Javadoc)
254:             * @see org.eclipse.pde.internal.core.cheatsheet.comp.CompCSObject#writeAttributes(java.lang.StringBuffer)
255:             */
256:            protected void writeAttributes(StringBuffer buffer) {
257:                // Print id attribute
258:                if ((fFieldId != null) && (fFieldId.length() > 0)) {
259:                    // Trim leading and trailing whitespace
260:                    // Encode characters
261:                    buffer.append(XMLPrintHandler.wrapAttribute(ATTRIBUTE_ID,
262:                            PDETextHelper.translateWriteText(fFieldId.trim(),
263:                                    DEFAULT_SUBSTITUTE_CHARS)));
264:                }
265:                // Print kind attribute
266:                if ((fFieldKind != null) && (fFieldKind.length() > 0)) {
267:                    // No trim required
268:                    // No encode required
269:                    buffer.append(XMLPrintHandler.wrapAttribute(ATTRIBUTE_KIND,
270:                            fFieldKind));
271:                }
272:                // Print name attribute
273:                if ((fFieldName != null) && (fFieldName.length() > 0)) {
274:                    // Trim leading and trailing whitespace
275:                    // Encode characters
276:                    buffer.append(XMLPrintHandler.wrapAttribute(ATTRIBUTE_NAME,
277:                            PDETextHelper.translateWriteText(fFieldName.trim(),
278:                                    DEFAULT_SUBSTITUTE_CHARS)));
279:                }
280:                // Print skip attribute
281:                buffer.append(XMLPrintHandler.wrapAttribute(ATTRIBUTE_SKIP,
282:                        new Boolean(fFieldSkip).toString()));
283:            }
284:
285:            /* (non-Javadoc)
286:             * @see org.eclipse.pde.internal.core.cheatsheet.comp.CompCSObject#parseElement(org.w3c.dom.Element)
287:             */
288:            protected void parseElement(Element element) {
289:                String name = element.getNodeName();
290:                ICompCSModelFactory factory = getModel().getFactory();
291:
292:                if (name.equals(ELEMENT_INTRO)) {
293:                    // Process intro element
294:                    fFieldIntro = factory.createCompCSIntro(this );
295:                    fFieldIntro.parse(element);
296:                } else if (name.equals(ELEMENT_ONCOMPLETION)) {
297:                    // Process onCompletion element
298:                    fFieldOnCompletion = factory.createCompCSOnCompletion(this );
299:                    fFieldOnCompletion.parse(element);
300:                } else if (name.equals(ELEMENT_DEPENDENCY)) {
301:                    // Process dependency element
302:                    ICompCSDependency dependency = factory
303:                            .createCompCSDependency(this );
304:                    fFieldDependencies.add(dependency);
305:                    dependency.parse(element);
306:                }
307:            }
308:
309:            /* (non-Javadoc)
310:             * @see org.eclipse.pde.internal.core.cheatsheet.comp.CompCSObject#writeElements(java.lang.String, java.io.PrintWriter)
311:             */
312:            protected void writeElements(String indent, PrintWriter writer) {
313:                String newIndent = indent + XMLPrintHandler.XML_INDENT;
314:                // Print intro element
315:                if (fFieldIntro != null) {
316:                    fFieldIntro.write(newIndent, writer);
317:                }
318:                // Print onCompletion element
319:                if (fFieldOnCompletion != null) {
320:                    fFieldOnCompletion.write(newIndent, writer);
321:                }
322:                // Print dependency elements
323:                Iterator iterator = fFieldDependencies.iterator();
324:                while (iterator.hasNext()) {
325:                    ICompCSDependency dependency = (ICompCSDependency) iterator
326:                            .next();
327:                    dependency.write(newIndent, writer);
328:                }
329:            }
330:
331:            /* (non-Javadoc)
332:             * @see org.eclipse.pde.internal.core.cheatsheet.comp.CompCSObject#getElement()
333:             */
334:            public abstract String getElement();
335:
336:        }
w_w___w_.__j___a_v___a__2_s__.___c_o_m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.