Source Code Cross Referenced for ScriptableRefactoring.java in  » IDE-Eclipse » jdt » org » eclipse » jdt » internal » corext » refactoring » code » 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 » jdt » org.eclipse.jdt.internal.corext.refactoring.code 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2006 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.jdt.internal.corext.refactoring.code;
011:
012:        import org.eclipse.core.runtime.Assert;
013:
014:        import org.eclipse.ltk.core.refactoring.Refactoring;
015:        import org.eclipse.ltk.core.refactoring.RefactoringStatus;
016:
017:        import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages;
018:        import org.eclipse.jdt.internal.corext.refactoring.tagging.ICommentProvider;
019:        import org.eclipse.jdt.internal.corext.refactoring.tagging.IScriptableRefactoring;
020:        import org.eclipse.jdt.internal.corext.util.Messages;
021:
022:        import org.eclipse.jdt.ui.JavaElementLabels;
023:
024:        /**
025:         * Partial implementation of a scriptable refactoring which provides a comment
026:         * for the history.
027:         * 
028:         * @since 3.2
029:         */
030:        public abstract class ScriptableRefactoring extends Refactoring
031:                implements  IScriptableRefactoring, ICommentProvider {
032:
033:            /**
034:             * Creates a fatal error status telling that the input element does not
035:             * exist.
036:             * 
037:             * @param element
038:             *            the input element, or <code>null</code>
039:             * @param name
040:             *            the name of the refactoring
041:             * @param id
042:             *            the id of the refactoring
043:             * @return the refactoring status
044:             */
045:            public static RefactoringStatus createInputFatalStatus(
046:                    final Object element, final String name, final String id) {
047:                Assert.isNotNull(name);
048:                Assert.isNotNull(id);
049:                if (element != null)
050:                    return RefactoringStatus
051:                            .createFatalErrorStatus(Messages
052:                                    .format(
053:                                            RefactoringCoreMessages.InitializableRefactoring_input_not_exists,
054:                                            new String[] {
055:                                                    JavaElementLabels
056:                                                            .getTextLabel(
057:                                                                    element,
058:                                                                    JavaElementLabels.ALL_FULLY_QUALIFIED),
059:                                                    name, id }));
060:                else
061:                    return RefactoringStatus
062:                            .createFatalErrorStatus(Messages
063:                                    .format(
064:                                            RefactoringCoreMessages.InitializableRefactoring_inputs_do_not_exist,
065:                                            new String[] { name, id }));
066:            }
067:
068:            /**
069:             * Creates a warning status telling that the input element does not exist.
070:             * 
071:             * @param element
072:             *            the input element, or <code>null</code>
073:             * @param name
074:             *            the name of the refactoring
075:             * @param id
076:             *            the id of the refactoring
077:             * @return the refactoring status
078:             */
079:            public static RefactoringStatus createInputWarningStatus(
080:                    final Object element, final String name, final String id) {
081:                Assert.isNotNull(name);
082:                Assert.isNotNull(id);
083:                if (element != null)
084:                    return RefactoringStatus
085:                            .createWarningStatus(Messages
086:                                    .format(
087:                                            RefactoringCoreMessages.InitializableRefactoring_input_not_exists,
088:                                            new String[] {
089:                                                    JavaElementLabels
090:                                                            .getTextLabel(
091:                                                                    element,
092:                                                                    JavaElementLabels.ALL_FULLY_QUALIFIED),
093:                                                    name, id }));
094:                else
095:                    return RefactoringStatus
096:                            .createWarningStatus(Messages
097:                                    .format(
098:                                            RefactoringCoreMessages.InitializableRefactoring_inputs_do_not_exist,
099:                                            new String[] { name, id }));
100:            }
101:
102:            /** The comment */
103:            private String fComment;
104:
105:            /**
106:             * {@inheritDoc}
107:             */
108:            public boolean canEnableComment() {
109:                return true;
110:            }
111:
112:            /**
113:             * Creates a fatal error status telling that the input element does not
114:             * exist.
115:             * 
116:             * @param element
117:             *            the input element, or <code>null</code>
118:             * @param id
119:             *            the id of the refactoring
120:             * @return the refactoring status
121:             */
122:            public final RefactoringStatus createInputFatalStatus(
123:                    final Object element, final String id) {
124:                return createInputFatalStatus(element, getName(), id);
125:            }
126:
127:            /**
128:             * Creates a warning status telling that the input element does not exist.
129:             * 
130:             * @param element
131:             *            the input element, or <code>null</code>
132:             * @param id
133:             *            the id of the refactoring
134:             * @return the refactoring status
135:             */
136:            public final RefactoringStatus createInputWarningStatus(
137:                    final Object element, final String id) {
138:                return createInputWarningStatus(element, getName(), id);
139:            }
140:
141:            /**
142:             * {@inheritDoc}
143:             */
144:            public String getComment() {
145:                return fComment;
146:            }
147:
148:            /**
149:             * {@inheritDoc}
150:             */
151:            public void setComment(String comment) {
152:                fComment = comment;
153:            }
154:        }
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.