1 /*******************************************************************************2 * Copyright (c) 2006 IBM Corporation and others.3 * All rights reserved. This program and the accompanying materials4 * are made available under the terms of the Eclipse Public License v1.05 * which accompanies this distribution, and is available at6 * http://www.eclipse.org/legal/epl-v10.html7 *8 * Contributors:9 * IBM Corporation - initial API and implementation10 *******************************************************************************/11 package org.eclipse.jdt.core.refactoring;12 13 import org.eclipse.ltk.core.refactoring.PerformRefactoringOperation;14 import org.eclipse.ltk.core.refactoring.RefactoringContribution;15 import org.eclipse.ltk.core.refactoring.RefactoringCore;16 17 import org.eclipse.jdt.core.refactoring.descriptors.ChangeMethodSignatureDescriptor;18 import org.eclipse.jdt.core.refactoring.descriptors.ConvertAnonymousDescriptor;19 import org.eclipse.jdt.core.refactoring.descriptors.ConvertLocalVariableDescriptor;20 import org.eclipse.jdt.core.refactoring.descriptors.ConvertMemberTypeDescriptor;21 import org.eclipse.jdt.core.refactoring.descriptors.CopyDescriptor;22 import org.eclipse.jdt.core.refactoring.descriptors.DeleteDescriptor;23 import org.eclipse.jdt.core.refactoring.descriptors.EncapsulateFieldDescriptor;24 import org.eclipse.jdt.core.refactoring.descriptors.ExtractConstantDescriptor;25 import org.eclipse.jdt.core.refactoring.descriptors.ExtractInterfaceDescriptor;26 import org.eclipse.jdt.core.refactoring.descriptors.ExtractLocalDescriptor;27 import org.eclipse.jdt.core.refactoring.descriptors.ExtractMethodDescriptor;28 import org.eclipse.jdt.core.refactoring.descriptors.ExtractSuperclassDescriptor;29 import org.eclipse.jdt.core.refactoring.descriptors.GeneralizeTypeDescriptor;30 import org.eclipse.jdt.core.refactoring.descriptors.InferTypeArgumentsDescriptor;31 import org.eclipse.jdt.core.refactoring.descriptors.InlineConstantDescriptor;32 import org.eclipse.jdt.core.refactoring.descriptors.InlineLocalVariableDescriptor;33 import org.eclipse.jdt.core.refactoring.descriptors.InlineMethodDescriptor;34 import org.eclipse.jdt.core.refactoring.descriptors.IntroduceFactoryDescriptor;35 import org.eclipse.jdt.core.refactoring.descriptors.IntroduceIndirectionDescriptor;36 import org.eclipse.jdt.core.refactoring.descriptors.IntroduceParameterDescriptor;37 import org.eclipse.jdt.core.refactoring.descriptors.MoveDescriptor;38 import org.eclipse.jdt.core.refactoring.descriptors.MoveMethodDescriptor;39 import org.eclipse.jdt.core.refactoring.descriptors.MoveStaticMembersDescriptor;40 import org.eclipse.jdt.core.refactoring.descriptors.PullUpDescriptor;41 import org.eclipse.jdt.core.refactoring.descriptors.PushDownDescriptor;42 import org.eclipse.jdt.core.refactoring.descriptors.RenameJavaElementDescriptor;43 import org.eclipse.jdt.core.refactoring.descriptors.RenameResourceDescriptor;44 import org.eclipse.jdt.core.refactoring.descriptors.UseSupertypeDescriptor;45 46 /**47 * Interface for refactoring ids offered by the JDT tooling.48 * <p>49 * This interface provides refactoring ids for refactorings offered by the JDT50 * tooling. Refactoring instances corresponding to such an id may be51 * instantiated by the refactoring framework using52 * {@link RefactoringCore#getRefactoringContribution(String)}. The resulting53 * refactoring instance may be executed on the workspace with a54 * {@link PerformRefactoringOperation}.55 * <p>56 * Clients may obtain customizable refactoring descriptors for a certain57 * refactoring by calling58 * {@link RefactoringCore#getRefactoringContribution(String)} with the59 * appropriate refactoring id and then calling60 * {@link RefactoringContribution#createDescriptor()} to obtain a customizable61 * refactoring descriptor. The concrete subtype of refactoring descriptors is62 * dependent from the <code>id</code> argument.63 * </p>64 * <p>65 * Note: this interface is not intended to be implemented by clients.66 * </p>67 * 68 * @since 3.369 */70 public interface IJavaRefactorings {71 72 /**73 * Refactoring id of the 'Change Method Signature' refactoring (value:74 * <code>org.eclipse.jdt.ui.change.method.signature</code>).75 * <p>76 * Clients may safely cast the obtained refactoring descriptor to77 * {@link ChangeMethodSignatureDescriptor}.78 * </p>79 */80 public static final String CHANGE_METHOD_SIGNATURE= "org.eclipse.jdt.ui.change.method.signature"; //$NON-NLS-1$81 82 /**83 * Refactoring id of the 'Convert Anonymous To Nested' refactoring (value:84 * <code>org.eclipse.jdt.ui.convert.anonymous</code>).85 * <p>86 * Clients may safely cast the obtained refactoring descriptor to87 * {@link ConvertAnonymousDescriptor}.88 * </p>89 */90 public static final String CONVERT_ANONYMOUS= "org.eclipse.jdt.ui.convert.anonymous"; //$NON-NLS-1$91 92 /**93 * Refactoring id of the 'Convert Local Variable to Field' refactoring94 * (value: <code>org.eclipse.jdt.ui.promote.temp</code>).95 * <p>96 * Clients may safely cast the obtained refactoring descriptor to97 * {@link ConvertLocalVariableDescriptor}.98 * </p>99 */100 public static final String CONVERT_LOCAL_VARIABLE= "org.eclipse.jdt.ui.promote.temp"; //$NON-NLS-1$101 102 /**103 * Refactoring id of the 'Convert Member Type to Top Level' refactoring104 * (value: <code>org.eclipse.jdt.ui.move.inner</code>).105 * <p>106 * Clients may safely cast the obtained refactoring descriptor to107 * {@link ConvertMemberTypeDescriptor}.108 * </p>109 */110 public static final String CONVERT_MEMBER_TYPE= "org.eclipse.jdt.ui.move.inner"; //$NON-NLS-1$111 112 /**113 * Refactoring id of the 'Copy' refactoring (value:114 * <code>org.eclipse.jdt.ui.copy</code>).115 * <p>116 * Clients may safely cast the obtained refactoring descriptor to117 * {@link CopyDescriptor}.118 * </p>119 */120 public static final String COPY= "org.eclipse.jdt.ui.copy"; //$NON-NLS-1$121 122 /**123 * Refactoring id of the 'Delete' refactoring (value:124 * <code>org.eclipse.jdt.ui.delete</code>).125 * <p>126 * Clients may safely cast the obtained refactoring descriptor to127 * {@link DeleteDescriptor}.128 * </p>129 */130 public static final String DELETE= "org.eclipse.jdt.ui.delete"; //$NON-NLS-1$131 132 /**133 * Refactoring id of the 'Encapsulate Field' refactoring (value:134 * <code>org.eclipse.jdt.ui.self.encapsulate</code>).135 * <p>136 * Clients may safely cast the obtained refactoring descriptor to137 * {@link EncapsulateFieldDescriptor}.138 * </p>139 */140 public static final String ENCAPSULATE_FIELD= "org.eclipse.jdt.ui.self.encapsulate"; //$NON-NLS-1$141 142 /**143 * Refactoring id of the 'Extract Constant' refactoring (value:144 * <code>org.eclipse.jdt.ui.extract.constant</code>).145 * <p>146 * Clients may safely cast the obtained refactoring descriptor to147 * {@link ExtractConstantDescriptor}.148 * </p>149 */150 public static final String EXTRACT_CONSTANT= "org.eclipse.jdt.ui.extract.constant"; //$NON-NLS-1$151 152 /**153 * Refactoring id of the 'Extract Interface' refactoring (value:154 * <code>org.eclipse.jdt.ui.extract.interface</code>).155 * <p>156 * Clients may safely cast the obtained refactoring descriptor to157 * {@link ExtractInterfaceDescriptor}.158 * </p>159 */160 public static final String EXTRACT_INTERFACE= "org.eclipse.jdt.ui.extract.interface"; //$NON-NLS-1$161 162 /**163 * Refactoring id of the 'Extract Local Variable' refactoring (value:164 * <code>org.eclipse.jdt.ui.extract.temp</code>).165 * <p>166 * Clients may safely cast the obtained refactoring descriptor to167 * {@link ExtractLocalDescriptor}.168 * </p>169 */170 public static final String EXTRACT_LOCAL_VARIABLE= "org.eclipse.jdt.ui.extract.temp"; //$NON-NLS-1$171 172 /**173 * Refactoring id of the 'Extract Method' refactoring (value:174 * <code>org.eclipse.jdt.ui.extract.method</code>).175 * <p>176 * Clients may safely cast the obtained refactoring descriptor to177 * {@link ExtractMethodDescriptor}.178 * </p>179 */180 public static final String EXTRACT_METHOD= "org.eclipse.jdt.ui.extract.method"; //$NON-NLS-1$181 182 /**183 * Refactoring id of the 'Extract Superclass' refactoring (value:184 * <code>org.eclipse.jdt.ui.extract.superclass</code>).185 * <p>186 * Clients may safely cast the obtained refactoring descriptor to187 * {@link ExtractSuperclassDescriptor}.188 * </p>189 */190 public static final String EXTRACT_SUPERCLASS= "org.eclipse.jdt.ui.extract.superclass"; //$NON-NLS-1$191 192 /**193 * Refactoring id of the 'Generalize Declared Type' refactoring (value:194 * <code>org.eclipse.jdt.ui.change.type</code>).195 * <p>196 * Clients may safely cast the obtained refactoring descriptor to197 * {@link GeneralizeTypeDescriptor}.198 * </p>199 */200 public static final String GENERALIZE_TYPE= "org.eclipse.jdt.ui.change.type"; //$NON-NLS-1$201 202 /**203 * Refactoring id of the 'Infer Type Arguments' refactoring (value:204 * <code>org.eclipse.jdt.ui.infer.typearguments</code>).205 * <p>206 * Clients may safely cast the obtained refactoring descriptor to207 * {@link InferTypeArgumentsDescriptor}.208 * </p>209 */210 public static final String INFER_TYPE_ARGUMENTS= "org.eclipse.jdt.ui.infer.typearguments"; //$NON-NLS-1$211 212 /**213 * Refactoring id of the 'Inline Constant' refactoring (value:214 * <code>org.eclipse.jdt.ui.inline.constant</code>).215 * <p>216 * Clients may safely cast the obtained refactoring descriptor to217 * {@link InlineConstantDescriptor}.218 * </p>219 */220 public static final String INLINE_CONSTANT= "org.eclipse.jdt.ui.inline.constant"; //$NON-NLS-1$221 222 /**223 * Refactoring id of the 'Inline Local Variable' refactoring (value:224 * <code>org.eclipse.jdt.ui.inline.temp</code>).225 * <p>226 * Clients may safely cast the obtained refactoring descriptor to227 * {@link InlineLocalVariableDescriptor}.228 * </p>229 */230 public static final String INLINE_LOCAL_VARIABLE= "org.eclipse.jdt.ui.inline.temp"; //$NON-NLS-1$231 232 /**233 * Refactoring id of the 'Inline Method' refactoring (value:234 * <code>org.eclipse.jdt.ui.inline.method</code>).235 * <p>236 * Clients may safely cast the obtained refactoring descriptor to237 * {@link InlineMethodDescriptor}.238 * </p>239 */240 public static final String INLINE_METHOD= "org.eclipse.jdt.ui.inline.method"; //$NON-NLS-1$241 242 /**243 * Refactoring id of the 'Introduce Factory' refactoring (value:244 * <code>org.eclipse.jdt.ui.introduce.factory</code>).245 * <p>246 * Clients may safely cast the obtained refactoring descriptor to247 * {@link IntroduceFactoryDescriptor}.248 * </p>249 */250 public static final String INTRODUCE_FACTORY= "org.eclipse.jdt.ui.introduce.factory"; //$NON-NLS-1$251 252 /**253 * Refactoring id of the 'Introduce Indirection' refactoring (value:254 * <code>org.eclipse.jdt.ui.introduce.indirection</code>).255 * <p>256 * Clients may safely cast the obtained refactoring descriptor to257 * {@link IntroduceIndirectionDescriptor}.258 * </p>259 */260 public static final String INTRODUCE_INDIRECTION= "org.eclipse.jdt.ui.introduce.indirection"; //$NON-NLS-1$261 262 /**263 * Refactoring id of the 'Introduce Parameter' refactoring (value:264 * <code>org.eclipse.jdt.ui.introduce.parameter</code>).265 * <p>266 * Clients may safely cast the obtained refactoring descriptor to267 * {@link IntroduceParameterDescriptor}.268 * </p>269 */270 public static final String INTRODUCE_PARAMETER= "org.eclipse.jdt.ui.introduce.parameter"; //$NON-NLS-1$271 272 /**273 * Refactoring id of the 'Move' refactoring (value:274 * <code>org.eclipse.jdt.ui.move</code>).275 * <p>276 * Clients may safely cast the obtained refactoring descriptor to277 * {@link MoveDescriptor}.278 * </p>279 */280 public static final String MOVE= "org.eclipse.jdt.ui.move"; //$NON-NLS-1$281 282 /**283 * Refactoring id of the 'Move Method' refactoring (value:284 * <code>org.eclipse.jdt.ui.move.method</code>).285 * <p>286 * Clients may safely cast the obtained refactoring descriptor to287 * {@link MoveMethodDescriptor}.288 * </p>289 */290 public static final String MOVE_METHOD= "org.eclipse.jdt.ui.move.method"; //$NON-NLS-1$291 292 /**293 * Refactoring id of the 'Move Static Members' refactoring (value:294 * <code>org.eclipse.jdt.ui.move.static</code>).295 * <p>296 * Clients may safely cast the obtained refactoring descriptor to297 * {@link MoveStaticMembersDescriptor}.298 * </p>299 */300 public static final String MOVE_STATIC_MEMBERS= "org.eclipse.jdt.ui.move.static"; //$NON-NLS-1$301 302 /**303 * Refactoring id of the 'Pull Up' refactoring (value:304 * <code>org.eclipse.jdt.ui.pull.up</code>).305 * <p>306 * Clients may safely cast the obtained refactoring descriptor to307 * {@link PullUpDescriptor}.308 * </p>309 */310 public static final String PULL_UP= "org.eclipse.jdt.ui.pull.up"; //$NON-NLS-1$311 312 /**313 * Refactoring id of the 'Push Down' refactoring (value:314 * <code>org.eclipse.jdt.ui.push.down</code>).315 * <p>316 * Clients may safely cast the obtained refactoring descriptor to317 * {@link PushDownDescriptor}.318 * </p>319 */320 public static final String PUSH_DOWN= "org.eclipse.jdt.ui.push.down"; //$NON-NLS-1$321 322 /**323 * Refactoring id of the 'Rename Compilation Unit' refactoring (value:324 * <code>org.eclipse.jdt.ui.rename.compilationunit</code>).325 * <p>326 * Clients may safely cast the obtained refactoring descriptor to327 * {@link RenameJavaElementDescriptor}.328 * </p>329 */330 public static final String RENAME_COMPILATION_UNIT= "org.eclipse.jdt.ui.rename.compilationunit"; //$NON-NLS-1$331 332 /**333 * Refactoring id of the 'Rename Enum Constant' refactoring (value:334 * <code>org.eclipse.jdt.ui.rename.enum.constant</code>).335 * <p>336 * Clients may safely cast the obtained refactoring descriptor to337 * {@link RenameJavaElementDescriptor}.338 * </p>339 */340 public static final String RENAME_ENUM_CONSTANT= "org.eclipse.jdt.ui.rename.enum.constant"; //$NON-NLS-1$341 342 /**343 * Refactoring id of the 'Rename Field' refactoring (value:344 * <code>org.eclipse.jdt.ui.rename.field</code>).345 * <p>346 * Clients may safely cast the obtained refactoring descriptor to347 * {@link RenameJavaElementDescriptor}.348 * </p>349 */350 public static final String RENAME_FIELD= "org.eclipse.jdt.ui.rename.field"; //$NON-NLS-1$351 352 /**353 * Refactoring id of the 'Rename Java Project' refactoring (value:354 * <code>org.eclipse.jdt.ui.rename.java.project</code>).355 * <p>356 * Clients may safely cast the obtained refactoring descriptor to357 * {@link RenameJavaElementDescriptor}.358 * </p>359 */360 public static final String RENAME_JAVA_PROJECT= "org.eclipse.jdt.ui.rename.java.project"; //$NON-NLS-1$361 362 /**363 * Refactoring id of the 'Rename Local Variable' refactoring (value:364 * <code>org.eclipse.jdt.ui.rename.local.variable</code>).365 * <p>366 * Clients may safely cast the obtained refactoring descriptor to367 * {@link RenameJavaElementDescriptor}.368 * </p>369 */370 public static final String RENAME_LOCAL_VARIABLE= "org.eclipse.jdt.ui.rename.local.variable"; //$NON-NLS-1$371 372 /**373 * Refactoring id of the 'Rename Method' refactoring (value:374 * <code>org.eclipse.jdt.ui.rename.method</code>).375 * <p>376 * Clients may safely cast the obtained refactoring descriptor to377 * {@link RenameJavaElementDescriptor}.378 * </p>379 */380 public static final String RENAME_METHOD= "org.eclipse.jdt.ui.rename.method"; //$NON-NLS-1$381 382 /**383 * Refactoring id of the 'Rename Package' refactoring (value:384 * <code>org.eclipse.jdt.ui.rename.package</code>).385 * <p>386 * Clients may safely cast the obtained refactoring descriptor to387 * {@link RenameJavaElementDescriptor}.388 * </p>389 */390 public static final String RENAME_PACKAGE= "org.eclipse.jdt.ui.rename.package"; //$NON-NLS-1$391 392 /**393 * Refactoring id of the 'Rename Resource' refactoring (value:394 * <code>org.eclipse.jdt.ui.rename.resource</code>).395 * <p>396 * Clients may safely cast the obtained refactoring descriptor to397 * {@link RenameResourceDescriptor}.398 * </p>399 */400 public static final String RENAME_RESOURCE= "org.eclipse.jdt.ui.rename.resource"; //$NON-NLS-1$401 402 /**403 * Refactoring id of the 'Rename Source Folder' refactoring (value:404 * <code>org.eclipse.jdt.ui.rename.source.folder</code>).405 * <p>406 * Clients may safely cast the obtained refactoring descriptor to407 * {@link RenameJavaElementDescriptor}.408 * </p>409 */410 public static final String RENAME_SOURCE_FOLDER= "org.eclipse.jdt.ui.rename.source.folder"; //$NON-NLS-1$411 412 /**413 * Refactoring id of the 'Rename Type' refactoring (value:414 * <code>org.eclipse.jdt.ui.rename.type</code>).415 * <p>416 * Clients may safely cast the obtained refactoring descriptor to417 * {@link RenameJavaElementDescriptor}.418 * </p>419 */420 public static final String RENAME_TYPE= "org.eclipse.jdt.ui.rename.type"; //$NON-NLS-1$421 422 /**423 * Refactoring id of the 'Rename Type Parameter' refactoring (value:424 * <code>org.eclipse.jdt.ui.rename.type.parameter</code>).425 * <p>426 * Clients may safely cast the obtained refactoring descriptor to427 * {@link RenameJavaElementDescriptor}.428 * </p>429 */430 public static final String RENAME_TYPE_PARAMETER= "org.eclipse.jdt.ui.rename.type.parameter"; //$NON-NLS-1$431 432 /**433 * Refactoring id of the 'Use Supertype Where Possible' refactoring (value:434 * <code>org.eclipse.jdt.ui.use.supertype</code>).435 * <p>436 * Clients may safely cast the obtained refactoring descriptor to437 * {@link UseSupertypeDescriptor}.438 * </p>439 */440 public static final String USE_SUPER_TYPE= "org.eclipse.jdt.ui.use.supertype"; //$NON-NLS-1$441 }