Source Code Cross Referenced for ResourceDescription.java in  » IDE-Eclipse » ui-ide » org » eclipse » ui » ide » undo » 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 ide » org.eclipse.ui.ide.undo 
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.ide.undo;
011:
012:        import org.eclipse.core.resources.IFile;
013:        import org.eclipse.core.resources.IFolder;
014:        import org.eclipse.core.resources.IProject;
015:        import org.eclipse.core.resources.IResource;
016:        import org.eclipse.core.runtime.CoreException;
017:        import org.eclipse.core.runtime.IProgressMonitor;
018:        import org.eclipse.ui.internal.ide.undo.FileDescription;
019:        import org.eclipse.ui.internal.ide.undo.FolderDescription;
020:        import org.eclipse.ui.internal.ide.undo.ProjectDescription;
021:
022:        /**
023:         * ResourceDescription is a lightweight description that describes the common
024:         * attributes of a resource to be created.
025:         * 
026:         * This class is not intended to be extended by clients.
027:         * 
028:         * @since 3.3
029:         * 
030:         */
031:        public abstract class ResourceDescription {
032:
033:            /**
034:             * Create a resource description given the specified resource. The resource
035:             * is assumed to exist.
036:             * 
037:             * @param resource
038:             *            the resource from which a description should be created
039:             * @return the resource description
040:             */
041:            public static ResourceDescription fromResource(IResource resource) {
042:                if (resource.getType() == IResource.PROJECT) {
043:                    return new ProjectDescription((IProject) resource);
044:                } else if (resource.getType() == IResource.FOLDER) {
045:                    return new FolderDescription((IFolder) resource);
046:                } else if (resource.getType() == IResource.FILE) {
047:                    return new FileDescription((IFile) resource);
048:                } else {
049:                    throw new IllegalArgumentException();
050:                }
051:            }
052:
053:            /**
054:             * Create a resource handle that can be used to create a resource from this
055:             * resource description. This handle can be used to create the actual
056:             * resource, or to describe the creation to a resource delta factory.
057:             * 
058:             * @return the resource handle that can be used to create a resource from
059:             *         this description
060:             */
061:            public abstract IResource createResourceHandle();
062:
063:            /**
064:             * Get the name of this resource.
065:             * 
066:             * @return the name of the Resource
067:             */
068:            public abstract String getName();
069:
070:            /**
071:             * Create an existent resource from this resource description.
072:             * 
073:             * @param monitor
074:             *            the progress monitor to use
075:             * @return a resource that has the attributes of this resource description
076:             * @throws CoreException
077:             */
078:            public abstract IResource createResource(IProgressMonitor monitor)
079:                    throws CoreException;
080:
081:            /**
082:             * Given a resource handle, create an actual resource with the attributes of
083:             * the receiver resource description.
084:             * 
085:             * @param resource
086:             *            the resource handle
087:             * @param monitor
088:             *            the progress monitor to be used when creating the resource
089:             * @throws CoreException
090:             */
091:            public abstract void createExistentResourceFromHandle(
092:                    IResource resource, IProgressMonitor monitor)
093:                    throws CoreException;
094:
095:            /**
096:             * Return a boolean indicating whether this resource description has enough
097:             * information to create a resource.
098:             * 
099:             * @return <code>true</code> if the resource can be created, and
100:             *         <code>false</code> if it does not have enough information
101:             */
102:            public abstract boolean isValid();
103:
104:            /**
105:             * Record the appropriate state of this resource description using
106:             * any available resource history.
107:             * 
108:             * @param resource
109:             *            the resource whose state is to be recorded.
110:             * @param monitor
111:             *            the progress monitor to be used
112:             * @throws CoreException
113:             */
114:            public abstract void recordStateFromHistory(IResource resource,
115:                    IProgressMonitor monitor) throws CoreException;
116:
117:            /**
118:             * Return a boolean indicating whether this description represents an
119:             * existent resource.
120:             * 
121:             * @param checkMembers
122:             *            Use <code>true</code> if members should also exist in order
123:             *            for this description to be considered existent. A value of
124:             *            <code>false</code> indicates that the existence of members
125:             *            does not matter.
126:             * 
127:             * @return a boolean indicating whether this description represents an
128:             *         existent resource.
129:             */
130:            public abstract boolean verifyExistence(boolean checkMembers);
131:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.