From 28ea258e7ed4e1e3fccd15cb66549b882bb27614 Mon Sep 17 00:00:00 2001 From: Jenkins Date: Tue, 18 Sep 2012 13:30:31 +0900 Subject: [PATCH] Merge sources from S-Core's RSA git (release) Change-Id: Ia0d9f488ed7f2eb85356d1881c08e383ec8eba0b --- org.eclipse.cdt.mylyn.ui/.classpath | 7 + org.eclipse.cdt.mylyn.ui/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 7 + org.eclipse.cdt.mylyn.ui/META-INF/MANIFEST.MF | 167 + org.eclipse.cdt.mylyn.ui/META-INF/eclipse.inf | 2 + org.eclipse.cdt.mylyn.ui/about.html | 24 + org.eclipse.cdt.mylyn.ui/build.properties | 7 + .../icons/elcl16/focus-disabled.gif | Bin 0 -> 354 bytes org.eclipse.cdt.mylyn.ui/icons/elcl16/focus.gif | Bin 0 -> 357 bytes .../icons/elcl16/interest-decrease.gif | Bin 0 -> 194 bytes .../icons/elcl16/interest-folding.gif | Bin 0 -> 357 bytes .../icons/elcl16/interest-increase.gif | Bin 0 -> 334 bytes .../icons/elcl16/proposals-other.gif | Bin 0 -> 624 bytes org.eclipse.cdt.mylyn.ui/plugin.properties | 33 + org.eclipse.cdt.mylyn.ui/plugin.xml | 313 + .../internal/cdt/ui/CDTContextLabelProvider.java | 107 + .../internal/cdt/ui/CDTDeclarationsFilter.java | 27 + .../mylyn/internal/cdt/ui/CDTEditorMonitor.java | 114 + .../mylyn/internal/cdt/ui/CDTStructureBridge.java | 344 + .../mylyn/internal/cdt/ui/CDTUIBridgePlugin.java | 150 + .../eclipse/mylyn/internal/cdt/ui/CDTUiBridge.java | 164 + .../cdt/ui/InterestUpdateDeltaListener.java | 121 + .../internal/cdt/ui/LandmarkMarkerManager.java | 182 + .../eclipse/mylyn/internal/cdt/ui/Messages.java | 33 + .../internal/cdt/ui/actions/FocusCViewAction.java | 145 + .../mylyn/internal/cdt/ui/actions/Messages.java | 27 + .../cdt/ui/actions/ToggleActiveFoldingAction.java | 83 + .../internal/cdt/ui/actions/messages.properties | 11 + .../cdt/ui/contentassist/CCompletionProposal.java | 45 + .../ui/contentassist/CDTContentAssistUtils.java | 79 + .../DOMCompletionProposalComputer.java | 1224 ++++ .../contentassist/FocusedCProposalProcessor.java | 211 + .../FocusedDOMCompletionProposalComputer.java | 55 + .../cdt/ui/editor/ActiveFoldingEditorTracker.java | 66 + .../cdt/ui/editor/ActiveFoldingListener.java | 278 + .../mylyn/internal/cdt/ui/editor/Messages.java | 27 + .../internal/cdt/ui/editor/messages.properties | 11 + .../mylyn/internal/cdt/ui/messages.properties | 14 + org.eclipse.cdt.mylyn/.project | 17 + org.eclipse.cdt.mylyn/build.properties | 4 + org.eclipse.cdt.mylyn/epl-v10.html | 328 + org.eclipse.cdt.mylyn/feature.properties | 139 + org.eclipse.cdt.mylyn/feature.xml | 43 + org.eclipse.cdt.mylyn/license.html | 108 + .../cdt/internal/ui/CPluginResources.properties | 2 +- .../c/hover/CDocBrowserInformationControl.java | 596 ++ .../hover/CDocBrowserInformationControlInput.java | 66 + .../cdt/internal/ui/text/c/hover/CDocHover.java | 1479 +++- .../internal/ui/text/c/hover/CElementLinks.java | 100 + .../internal/ui/text/c/hover/CHoverMessages.java | 3 + .../ui/text/c/hover/CHoverMessages.properties | 3 + .../DOMCompletionProposalComputer.java | 534 +- .../eclipse/cdt/ui/CUIPreferenceInitializer.java | 96 +- .../META-INF/MANIFEST.MF | 2 +- .../jst/pagedesigner/editors/HTMLEditor.java | 1 + org.eclipse.wst.jsdt.core/.classpath | 7 + org.eclipse.wst.jsdt.core/.project | 34 + org.eclipse.wst.jsdt.core/.settings/.jsdtscope | 5 + .../.settings/org.eclipse.core.resources.prefs | 3 + .../.settings/org.eclipse.core.runtime.prefs | 3 + .../.settings/org.eclipse.jdt.core.prefs | 96 + .../.settings/org.eclipse.jdt.ui.prefs | 51 + .../org.eclipse.ltk.core.refactoring.prefs | 3 + .../.settings/org.eclipse.pde.prefs | 16 + .../org.eclipse.wst.jsdt.ui.superType.container | 1 + .../org.eclipse.wst.jsdt.ui.superType.name | 1 + org.eclipse.wst.jsdt.core/META-INF/MANIFEST.MF | 65 + org.eclipse.wst.jsdt.core/about.html | 28 + org.eclipse.wst.jsdt.core/build.properties | 20 + org.eclipse.wst.jsdt.core/grammar/js.g | 1313 ++++ org.eclipse.wst.jsdt.core/grammar/js_original.g | 1304 ++++ .../baseBrowserLibrary--WrapperObjects.js | 1814 +++++ .../libraries/baseBrowserLibrary.js | 5393 ++++++++++++++ .../libraries/browserWindow.js | 561 ++ org.eclipse.wst.jsdt.core/libraries/dom5.js | 5393 ++++++++++++++ org.eclipse.wst.jsdt.core/libraries/system.js | 1483 ++++ org.eclipse.wst.jsdt.core/libraries/xhr.js | 106 + org.eclipse.wst.jsdt.core/plugin.properties | 29 + org.eclipse.wst.jsdt.core/plugin.xml | 229 + .../schema/JsGlobalScopeContainerInitializer.exsd | 124 + .../schema/JsGlobalScopeVariableInitializer.exsd | 141 + .../schema/codeFormatter.exsd | 111 + .../schema/inferrenceSupport.exsd | 106 + .../schema/sourcePathProvider.exsd | 102 + .../schema/validationParticipant.exsd | 192 + .../src/org/eclipse/wst/jsdt/core/BindingKey.java | 108 + .../eclipse/wst/jsdt/core/BufferChangedEvent.java | 121 + .../eclipse/wst/jsdt/core/CompletionContext.java | 238 + .../org/eclipse/wst/jsdt/core/CompletionFlags.java | 40 + .../eclipse/wst/jsdt/core/CompletionProposal.java | 2041 ++++++ .../eclipse/wst/jsdt/core/CompletionRequestor.java | 296 + .../eclipse/wst/jsdt/core/CorrectionEngine.java | 463 ++ .../eclipse/wst/jsdt/core/ElementChangedEvent.java | 105 + .../src/org/eclipse/wst/jsdt/core/Flags.java | 230 + .../src/org/eclipse/wst/jsdt/core/IAccessRule.java | 110 + .../src/org/eclipse/wst/jsdt/core/IBuffer.java | 261 + .../wst/jsdt/core/IBufferChangedListener.java | 35 + .../org/eclipse/wst/jsdt/core/IBufferFactory.java | 39 + .../src/org/eclipse/wst/jsdt/core/IClassFile.java | 63 + .../src/org/eclipse/wst/jsdt/core/ICodeAssist.java | 127 + .../wst/jsdt/core/ICorrectionRequestor.java | 137 + .../wst/jsdt/core/IElementChangedListener.java | 34 + .../src/org/eclipse/wst/jsdt/core/IField.java | 64 + .../src/org/eclipse/wst/jsdt/core/IFunction.java | 168 + .../eclipse/wst/jsdt/core/IFunctionContainer.java | 88 + .../eclipse/wst/jsdt/core/IImportContainer.java | 38 + .../eclipse/wst/jsdt/core/IImportDeclaration.java | 51 + .../wst/jsdt/core/IIncludePathAttribute.java | 93 + .../eclipse/wst/jsdt/core/IIncludePathEntry.java | 395 + .../org/eclipse/wst/jsdt/core/IInitializer.java | 26 + .../eclipse/wst/jsdt/core/IJarEntryResource.java | 77 + .../eclipse/wst/jsdt/core/IJavaScriptElement.java | 382 + .../wst/jsdt/core/IJavaScriptElementDelta.java | 375 + .../eclipse/wst/jsdt/core/IJavaScriptModel.java | 260 + .../wst/jsdt/core/IJavaScriptModelMarker.java | 111 + .../wst/jsdt/core/IJavaScriptModelStatus.java | 78 + .../jsdt/core/IJavaScriptModelStatusConstants.java | 319 + .../eclipse/wst/jsdt/core/IJavaScriptProject.java | 846 +++ .../org/eclipse/wst/jsdt/core/IJavaScriptUnit.java | 753 ++ .../wst/jsdt/core/IJsGlobalScopeContainer.java | 141 + .../core/IJsGlobalScopeContainerInitializer.java | 186 + .../org/eclipse/wst/jsdt/core/ILocalVariable.java | 74 + .../org/eclipse/wst/jsdt/core/ILookupScope.java | 45 + .../src/org/eclipse/wst/jsdt/core/IMember.java | 156 + .../src/org/eclipse/wst/jsdt/core/IOpenable.java | 193 + .../eclipse/wst/jsdt/core/IPackageFragment.java | 202 + .../wst/jsdt/core/IPackageFragmentRoot.java | 432 ++ .../src/org/eclipse/wst/jsdt/core/IParent.java | 45 + .../eclipse/wst/jsdt/core/IProblemRequestor.java | 58 + .../src/org/eclipse/wst/jsdt/core/IRegion.java | 72 + .../eclipse/wst/jsdt/core/ISourceManipulation.java | 118 + .../org/eclipse/wst/jsdt/core/ISourceRange.java | 43 + .../eclipse/wst/jsdt/core/ISourceReference.java | 61 + .../src/org/eclipse/wst/jsdt/core/IType.java | 716 ++ .../org/eclipse/wst/jsdt/core/ITypeHierarchy.java | 180 + .../jsdt/core/ITypeHierarchyChangedListener.java | 34 + .../src/org/eclipse/wst/jsdt/core/ITypeRoot.java | 103 + .../org/eclipse/wst/jsdt/core/JSDScopeUtil.java | 86 + .../wst/jsdt/core/JavaScriptConventions.java | 729 ++ .../org/eclipse/wst/jsdt/core/JavaScriptCore.java | 4115 +++++++++++ .../wst/jsdt/core/JavaScriptModelException.java | 176 + .../core/JsGlobalScopeContainerInitializer.java | 321 + .../core/JsGlobalScopeVariableInitializer.java | 56 + .../eclipse/wst/jsdt/core/LibrarySuperType.java | 196 + .../src/org/eclipse/wst/jsdt/core/Messages.java | 24 + .../eclipse/wst/jsdt/core/NamingConventions.java | 949 +++ .../src/org/eclipse/wst/jsdt/core/Signature.java | 1644 +++++ .../src/org/eclipse/wst/jsdt/core/ToolFactory.java | 247 + .../wst/jsdt/core/UnimplementedException.java | 28 + .../eclipse/wst/jsdt/core/WorkingCopyOwner.java | 141 + .../org/eclipse/wst/jsdt/core/ast/ASTVisitor.java | 563 ++ .../wst/jsdt/core/ast/IAND_AND_Expression.java | 28 + .../org/eclipse/wst/jsdt/core/ast/IASTNode.java | 145 + .../core/ast/IAbstractFunctionDeclaration.java | 79 + .../core/ast/IAbstractVariableDeclaration.java | 53 + .../wst/jsdt/core/ast/IAllocationExpression.java | 33 + .../org/eclipse/wst/jsdt/core/ast/IArgument.java | 33 + .../jsdt/core/ast/IArrayAllocationExpression.java | 28 + .../wst/jsdt/core/ast/IArrayInitializer.java | 27 + .../core/ast/IArrayQualifiedTypeReference.java | 27 + .../eclipse/wst/jsdt/core/ast/IArrayReference.java | 27 + .../wst/jsdt/core/ast/IArrayTypeReference.java | 27 + .../org/eclipse/wst/jsdt/core/ast/IAssignment.java | 54 + .../wst/jsdt/core/ast/IBinaryExpression.java | 28 + .../src/org/eclipse/wst/jsdt/core/ast/IBlock.java | 27 + .../wst/jsdt/core/ast/IBranchStatement.java | 28 + .../eclipse/wst/jsdt/core/ast/IBreakStatement.java | 28 + .../eclipse/wst/jsdt/core/ast/ICaseStatement.java | 27 + .../jsdt/core/ast/ICombinedBinaryExpression.java | 28 + .../wst/jsdt/core/ast/ICompoundAssignment.java | 29 + .../wst/jsdt/core/ast/IConditionalExpression.java | 28 + .../wst/jsdt/core/ast/IConstructorDeclaration.java | 28 + .../wst/jsdt/core/ast/IContinueStatement.java | 28 + .../wst/jsdt/core/ast/IDebuggerStatement.java | 28 + .../eclipse/wst/jsdt/core/ast/IDoStatement.java | 28 + .../eclipse/wst/jsdt/core/ast/IDoubleLiteral.java | 27 + .../wst/jsdt/core/ast/IEmptyExpression.java | 28 + .../eclipse/wst/jsdt/core/ast/IEmptyStatement.java | 28 + .../wst/jsdt/core/ast/IEqualExpression.java | 29 + .../jsdt/core/ast/IExplicitConstructorCall.java | 28 + .../org/eclipse/wst/jsdt/core/ast/IExpression.java | 28 + .../wst/jsdt/core/ast/IExtendedStringLiteral.java | 28 + .../eclipse/wst/jsdt/core/ast/IFalseLiteral.java | 28 + .../wst/jsdt/core/ast/IFieldDeclaration.java | 26 + .../eclipse/wst/jsdt/core/ast/IFieldReference.java | 29 + .../eclipse/wst/jsdt/core/ast/IForInStatement.java | 28 + .../eclipse/wst/jsdt/core/ast/IForStatement.java | 28 + .../wst/jsdt/core/ast/IForeachStatement.java | 27 + .../eclipse/wst/jsdt/core/ast/IFunctionCall.java | 30 + .../wst/jsdt/core/ast/IFunctionDeclaration.java | 27 + .../wst/jsdt/core/ast/IFunctionExpression.java | 33 + .../eclipse/wst/jsdt/core/ast/IIfStatement.java | 28 + .../wst/jsdt/core/ast/IImportReference.java | 27 + .../eclipse/wst/jsdt/core/ast/IInitializer.java | 27 + .../wst/jsdt/core/ast/IInstanceOfExpression.java | 27 + .../org/eclipse/wst/jsdt/core/ast/IIntLiteral.java | 27 + .../wst/jsdt/core/ast/IIntLiteralMinValue.java | 24 + .../src/org/eclipse/wst/jsdt/core/ast/IJsDoc.java | 28 + .../jsdt/core/ast/IJsDocAllocationExpression.java | 24 + .../jsdt/core/ast/IJsDocArgumentExpression.java | 24 + .../ast/IJsDocArrayQualifiedTypeReference.java | 24 + .../core/ast/IJsDocArraySingleTypeReference.java | 24 + .../wst/jsdt/core/ast/IJsDocFieldReference.java | 23 + .../jsdt/core/ast/IJsDocImplicitTypeReference.java | 24 + .../wst/jsdt/core/ast/IJsDocMessageSend.java | 24 + .../core/ast/IJsDocQualifiedTypeReference.java | 25 + .../wst/jsdt/core/ast/IJsDocReturnStatement.java | 24 + .../jsdt/core/ast/IJsDocSingleNameReference.java | 24 + .../jsdt/core/ast/IJsDocSingleTypeReference.java | 24 + .../wst/jsdt/core/ast/ILabeledStatement.java | 28 + .../eclipse/wst/jsdt/core/ast/IListExpression.java | 28 + .../org/eclipse/wst/jsdt/core/ast/ILiteral.java | 29 + .../wst/jsdt/core/ast/ILocalDeclaration.java | 37 + .../eclipse/wst/jsdt/core/ast/IMagicLiteral.java | 24 + .../eclipse/wst/jsdt/core/ast/INameReference.java | 28 + .../eclipse/wst/jsdt/core/ast/INullLiteral.java | 28 + .../eclipse/wst/jsdt/core/ast/INumberLiteral.java | 28 + .../wst/jsdt/core/ast/IOR_OR_Expression.java | 28 + .../eclipse/wst/jsdt/core/ast/IObjectLiteral.java | 33 + .../wst/jsdt/core/ast/IObjectLiteralField.java | 30 + .../wst/jsdt/core/ast/IOperatorExpression.java | 28 + .../wst/jsdt/core/ast/IPostfixExpression.java | 28 + .../wst/jsdt/core/ast/IPrefixExpression.java | 28 + .../eclipse/wst/jsdt/core/ast/IProgramElement.java | 28 + .../core/ast/IQualifiedAllocationExpression.java | 24 + .../wst/jsdt/core/ast/IQualifiedNameReference.java | 24 + .../wst/jsdt/core/ast/IQualifiedThisReference.java | 24 + .../wst/jsdt/core/ast/IQualifiedTypeReference.java | 24 + .../org/eclipse/wst/jsdt/core/ast/IReference.java | 28 + .../eclipse/wst/jsdt/core/ast/IRegExLiteral.java | 28 + .../wst/jsdt/core/ast/IReturnStatement.java | 30 + .../wst/jsdt/core/ast/IScriptFileDeclaration.java | 44 + .../wst/jsdt/core/ast/ISingleNameReference.java | 29 + .../wst/jsdt/core/ast/ISingleTypeReference.java | 26 + .../org/eclipse/wst/jsdt/core/ast/IStatement.java | 28 + .../eclipse/wst/jsdt/core/ast/IStringLiteral.java | 28 + .../jsdt/core/ast/IStringLiteralConcatenation.java | 28 + .../wst/jsdt/core/ast/ISubRoutineStatement.java | 27 + .../eclipse/wst/jsdt/core/ast/ISuperReference.java | 27 + .../wst/jsdt/core/ast/ISwitchStatement.java | 28 + .../eclipse/wst/jsdt/core/ast/IThisReference.java | 28 + .../eclipse/wst/jsdt/core/ast/IThrowStatement.java | 28 + .../eclipse/wst/jsdt/core/ast/ITrueLiteral.java | 28 + .../eclipse/wst/jsdt/core/ast/ITryStatement.java | 28 + .../wst/jsdt/core/ast/ITypeDeclaration.java | 27 + .../eclipse/wst/jsdt/core/ast/ITypeReference.java | 27 + .../wst/jsdt/core/ast/IUnaryExpression.java | 28 + .../wst/jsdt/core/ast/IUndefinedLiteral.java | 28 + .../eclipse/wst/jsdt/core/ast/IWhileStatement.java | 28 + .../eclipse/wst/jsdt/core/ast/IWithStatement.java | 28 + .../wst/jsdt/core/compiler/BuildContext.java | 133 + .../wst/jsdt/core/compiler/CategorizedProblem.java | 153 + .../wst/jsdt/core/compiler/CharOperation.java | 3433 +++++++++ .../eclipse/wst/jsdt/core/compiler/IProblem.java | 719 ++ .../eclipse/wst/jsdt/core/compiler/IScanner.java | 154 + .../wst/jsdt/core/compiler/ITerminalSymbols.java | 166 + .../jsdt/core/compiler/InvalidInputException.java | 43 + .../wst/jsdt/core/compiler/ReconcileContext.java | 198 + .../jsdt/core/compiler/ValidationParticipant.java | 109 + .../core/compiler/libraries/LibraryLocation.java | 49 + .../compiler/libraries/SystemLibraryLocation.java | 212 + .../src/org/eclipse/wst/jsdt/core/dom/AST.java | 2372 ++++++ .../eclipse/wst/jsdt/core/dom/ASTConverter.java | 4501 ++++++++++++ .../org/eclipse/wst/jsdt/core/dom/ASTMatcher.java | 2083 ++++++ .../src/org/eclipse/wst/jsdt/core/dom/ASTNode.java | 2635 +++++++ .../org/eclipse/wst/jsdt/core/dom/ASTParser.java | 1161 +++ .../wst/jsdt/core/dom/ASTRecoveryPropagator.java | 382 + .../eclipse/wst/jsdt/core/dom/ASTRequestor.java | 122 + .../jsdt/core/dom/ASTSyntaxErrorPropagator.java | 134 + .../org/eclipse/wst/jsdt/core/dom/ASTVisitor.java | 2212 ++++++ .../wst/jsdt/core/dom/AbstractTypeDeclaration.java | 242 + .../jsdt/core/dom/AnonymousClassDeclaration.java | 191 + .../org/eclipse/wst/jsdt/core/dom/ArrayAccess.java | 270 + .../eclipse/wst/jsdt/core/dom/ArrayCreation.java | 315 + .../wst/jsdt/core/dom/ArrayInitializer.java | 161 + .../org/eclipse/wst/jsdt/core/dom/ArrayType.java | 247 + .../org/eclipse/wst/jsdt/core/dom/Assignment.java | 439 ++ .../wst/jsdt/core/dom/BindingComparator.java | 228 + .../eclipse/wst/jsdt/core/dom/BindingResolver.java | 787 ++ .../src/org/eclipse/wst/jsdt/core/dom/Block.java | 169 + .../eclipse/wst/jsdt/core/dom/BlockComment.java | 130 + .../eclipse/wst/jsdt/core/dom/BodyDeclaration.java | 255 + .../eclipse/wst/jsdt/core/dom/BooleanLiteral.java | 178 + .../eclipse/wst/jsdt/core/dom/BreakStatement.java | 188 + .../org/eclipse/wst/jsdt/core/dom/CatchClause.java | 266 + .../wst/jsdt/core/dom/CharacterLiteral.java | 389 + .../jsdt/core/dom/ChildListPropertyDescriptor.java | 100 + .../wst/jsdt/core/dom/ChildPropertyDescriptor.java | 116 + .../wst/jsdt/core/dom/ClassInstanceCreation.java | 607 ++ .../src/org/eclipse/wst/jsdt/core/dom/Comment.java | 132 + .../wst/jsdt/core/dom/ConditionalExpression.java | 332 + .../wst/jsdt/core/dom/ConstructorInvocation.java | 247 + .../wst/jsdt/core/dom/ContinueStatement.java | 188 + .../wst/jsdt/core/dom/DefaultASTVisitor.java | 533 ++ .../wst/jsdt/core/dom/DefaultBindingResolver.java | 1595 ++++ .../wst/jsdt/core/dom/DefaultCommentMapper.java | 650 ++ .../org/eclipse/wst/jsdt/core/dom/DoStatement.java | 276 + .../wst/jsdt/core/dom/DocCommentParser.java | 696 ++ .../eclipse/wst/jsdt/core/dom/EmptyExpression.java | 91 + .../eclipse/wst/jsdt/core/dom/EmptyStatement.java | 119 + .../wst/jsdt/core/dom/EnhancedForStatement.java | 331 + .../org/eclipse/wst/jsdt/core/dom/Expression.java | 143 + .../wst/jsdt/core/dom/ExpressionStatement.java | 207 + .../org/eclipse/wst/jsdt/core/dom/FieldAccess.java | 316 + .../wst/jsdt/core/dom/FieldDeclaration.java | 372 + .../eclipse/wst/jsdt/core/dom/ForInStatement.java | 331 + .../eclipse/wst/jsdt/core/dom/ForStatement.java | 363 + .../eclipse/wst/jsdt/core/dom/FunctionBinding.java | 357 + .../wst/jsdt/core/dom/FunctionDeclaration.java | 871 +++ .../wst/jsdt/core/dom/FunctionExpression.java | 206 + .../wst/jsdt/core/dom/FunctionInvocation.java | 403 ++ .../org/eclipse/wst/jsdt/core/dom/FunctionRef.java | 320 + .../wst/jsdt/core/dom/FunctionRefParameter.java | 360 + .../org/eclipse/wst/jsdt/core/dom/IBinding.java | 265 + .../org/eclipse/wst/jsdt/core/dom/IDocElement.java | 25 + .../wst/jsdt/core/dom/IExtendedModifier.java | 37 + .../wst/jsdt/core/dom/IFunctionBinding.java | 197 + .../eclipse/wst/jsdt/core/dom/IPackageBinding.java | 75 + .../eclipse/wst/jsdt/core/dom/ITypeBinding.java | 612 ++ .../wst/jsdt/core/dom/IVariableBinding.java | 158 + .../org/eclipse/wst/jsdt/core/dom/IfStatement.java | 351 + .../wst/jsdt/core/dom/ImportDeclaration.java | 411 ++ .../eclipse/wst/jsdt/core/dom/InferredType.java | 97 + .../eclipse/wst/jsdt/core/dom/InfixExpression.java | 546 ++ .../org/eclipse/wst/jsdt/core/dom/Initializer.java | 315 + .../wst/jsdt/core/dom/InstanceofExpression.java | 265 + .../wst/jsdt/core/dom/InternalASTRewrite.java | 236 + .../src/org/eclipse/wst/jsdt/core/dom/JSdoc.java | 322 + .../eclipse/wst/jsdt/core/dom/JavaScriptUnit.java | 1056 +++ .../wst/jsdt/core/dom/JavaScriptUnitBinding.java | 749 ++ .../wst/jsdt/core/dom/JavaScriptUnitResolver.java | 994 +++ .../wst/jsdt/core/dom/LabeledStatement.java | 278 + .../org/eclipse/wst/jsdt/core/dom/LineComment.java | 129 + .../eclipse/wst/jsdt/core/dom/ListExpression.java | 157 + .../org/eclipse/wst/jsdt/core/dom/MemberRef.java | 275 + .../src/org/eclipse/wst/jsdt/core/dom/Message.java | 137 + .../org/eclipse/wst/jsdt/core/dom/Modifier.java | 706 ++ .../wst/jsdt/core/dom/NaiveASTFlattener.java | 1392 ++++ .../src/org/eclipse/wst/jsdt/core/dom/Name.java | 121 + .../wst/jsdt/core/dom/NodeEventHandler.java | 193 + .../eclipse/wst/jsdt/core/dom/NodeSearcher.java | 107 + .../org/eclipse/wst/jsdt/core/dom/NullLiteral.java | 120 + .../eclipse/wst/jsdt/core/dom/NumberLiteral.java | 225 + .../eclipse/wst/jsdt/core/dom/ObjectLiteral.java | 151 + .../wst/jsdt/core/dom/ObjectLiteralField.java | 261 + .../eclipse/wst/jsdt/core/dom/PackageBinding.java | 162 + .../wst/jsdt/core/dom/PackageDeclaration.java | 352 + .../wst/jsdt/core/dom/ParenthesizedExpression.java | 202 + .../wst/jsdt/core/dom/PostfixExpression.java | 332 + .../wst/jsdt/core/dom/PrefixExpression.java | 350 + .../eclipse/wst/jsdt/core/dom/PrimitiveType.java | 316 + .../eclipse/wst/jsdt/core/dom/ProgramElement.java | 27 + .../eclipse/wst/jsdt/core/dom/QualifiedName.java | 284 + .../eclipse/wst/jsdt/core/dom/QualifiedType.java | 288 + .../wst/jsdt/core/dom/RecoveredTypeBinding.java | 580 ++ .../jsdt/core/dom/RecoveredVariableBinding.java | 130 + .../jsdt/core/dom/RegularExpressionLiteral.java | 213 + .../eclipse/wst/jsdt/core/dom/ReturnStatement.java | 189 + .../org/eclipse/wst/jsdt/core/dom/SimpleName.java | 292 + .../jsdt/core/dom/SimplePropertyDescriptor.java | 86 + .../org/eclipse/wst/jsdt/core/dom/SimpleType.java | 201 + .../jsdt/core/dom/SingleVariableDeclaration.java | 641 ++ .../org/eclipse/wst/jsdt/core/dom/Statement.java | 213 + .../eclipse/wst/jsdt/core/dom/StringLiteral.java | 347 + .../core/dom/StructuralPropertyDescriptor.java | 145 + .../jsdt/core/dom/SuperConstructorInvocation.java | 322 + .../wst/jsdt/core/dom/SuperFieldAccess.java | 282 + .../wst/jsdt/core/dom/SuperMethodInvocation.java | 401 ++ .../org/eclipse/wst/jsdt/core/dom/SwitchCase.java | 224 + .../eclipse/wst/jsdt/core/dom/SwitchStatement.java | 252 + .../org/eclipse/wst/jsdt/core/dom/TagElement.java | 403 ++ .../org/eclipse/wst/jsdt/core/dom/TextElement.java | 201 + .../eclipse/wst/jsdt/core/dom/ThisExpression.java | 191 + .../eclipse/wst/jsdt/core/dom/ThrowStatement.java | 203 + .../eclipse/wst/jsdt/core/dom/TryStatement.java | 301 + .../src/org/eclipse/wst/jsdt/core/dom/Type.java | 146 + .../org/eclipse/wst/jsdt/core/dom/TypeBinding.java | 824 +++ .../eclipse/wst/jsdt/core/dom/TypeDeclaration.java | 635 ++ .../jsdt/core/dom/TypeDeclarationStatement.java | 361 + .../org/eclipse/wst/jsdt/core/dom/TypeLiteral.java | 203 + .../wst/jsdt/core/dom/UndefinedLiteral.java | 120 + .../eclipse/wst/jsdt/core/dom/VariableBinding.java | 291 + .../wst/jsdt/core/dom/VariableDeclaration.java | 200 + .../core/dom/VariableDeclarationExpression.java | 438 ++ .../jsdt/core/dom/VariableDeclarationFragment.java | 337 + .../core/dom/VariableDeclarationStatement.java | 491 ++ .../eclipse/wst/jsdt/core/dom/WhileStatement.java | 278 + .../eclipse/wst/jsdt/core/dom/WithStatement.java | 278 + .../wst/jsdt/core/dom/rewrite/ASTRewrite.java | 653 ++ .../core/dom/rewrite/ITrackedNodePosition.java | 46 + .../wst/jsdt/core/dom/rewrite/ImportRewrite.java | 1030 +++ .../wst/jsdt/core/dom/rewrite/ListRewrite.java | 417 ++ .../dom/rewrite/TargetSourceRangeComputer.java | 137 + .../wst/jsdt/core/eval/ICodeSnippetRequestor.java | 177 + .../wst/jsdt/core/eval/IEvaluationContext.java | 385 + .../wst/jsdt/core/eval/IGlobalVariable.java | 52 + .../wst/jsdt/core/formatter/CodeFormatter.java | 108 + .../core/formatter/CodeFormatterApplication.java | 400 ++ .../formatter/DefaultCodeFormatterConstants.java | 3640 ++++++++++ .../jsdt/core/formatter/IndentManipulation.java | 429 ++ .../wst/jsdt/core/formatter/messages.properties | 41 + .../jsdt/core/infer/DefaultInferrenceProvider.java | 55 + .../eclipse/wst/jsdt/core/infer/IInferEngine.java | 44 + .../wst/jsdt/core/infer/IInferenceFile.java | 38 + .../wst/jsdt/core/infer/ImportRewriteSupport.java | 56 + .../eclipse/wst/jsdt/core/infer/InferEngine.java | 2126 ++++++ .../eclipse/wst/jsdt/core/infer/InferOptions.java | 131 + .../wst/jsdt/core/infer/InferredAttribute.java | 76 + .../wst/jsdt/core/infer/InferredMember.java | 43 + .../wst/jsdt/core/infer/InferredMethod.java | 76 + .../eclipse/wst/jsdt/core/infer/InferredType.java | 469 ++ .../wst/jsdt/core/infer/InferrenceManager.java | 190 + .../wst/jsdt/core/infer/InferrenceProvider.java | 99 + .../core/infer/InferrenceSupportExtension.java | 25 + .../wst/jsdt/core/infer/RefactoringSupport.java | 46 + .../jsdt/core/infer/ResolutionConfiguration.java | 46 + .../org/eclipse/wst/jsdt/core/messages.properties | 1 + .../jsdt/core/search/FieldDeclarationMatch.java | 43 + .../wst/jsdt/core/search/FieldReferenceMatch.java | 74 + .../core/search/IJavaScriptSearchConstants.java | 175 + .../jsdt/core/search/IJavaScriptSearchScope.java | 96 + .../core/search/LocalVariableDeclarationMatch.java | 44 + .../core/search/LocalVariableReferenceMatch.java | 73 + .../jsdt/core/search/MethodDeclarationMatch.java | 44 + .../wst/jsdt/core/search/MethodReferenceMatch.java | 113 + .../jsdt/core/search/PackageReferenceMatch.java | 46 + .../wst/jsdt/core/search/SearchDocument.java | 143 + .../eclipse/wst/jsdt/core/search/SearchEngine.java | 631 ++ .../eclipse/wst/jsdt/core/search/SearchMatch.java | 380 + .../wst/jsdt/core/search/SearchParticipant.java | 235 + .../wst/jsdt/core/search/SearchPattern.java | 1921 +++++ .../wst/jsdt/core/search/SearchRequestor.java | 99 + .../wst/jsdt/core/search/TypeDeclarationMatch.java | 45 + .../wst/jsdt/core/search/TypeNameMatch.java | 160 + .../jsdt/core/search/TypeNameMatchRequestor.java | 52 + .../wst/jsdt/core/search/TypeNameRequestor.java | 59 + .../wst/jsdt/core/search/TypeReferenceMatch.java | 99 + .../wst/jsdt/core/util/IModifierConstants.java | 40 + .../wst/jsdt/core/util/JavaScriptUnitSorter.java | 346 + .../eclipse/wst/jsdt/core/util/SequenceReader.java | 100 + .../jsdt/internal/codeassist/CompletionEngine.java | 7597 ++++++++++++++++++++ .../jsdt/internal/codeassist/ISearchRequestor.java | 67 + .../internal/codeassist/ISelectionRequestor.java | 265 + .../codeassist/InternalCompletionContext.java | 67 + .../codeassist/InternalCompletionProposal.java | 205 + .../internal/codeassist/MissingTypesGuesser.java | 440 ++ .../internal/codeassist/RelevanceConstants.java | 42 + .../jsdt/internal/codeassist/SelectionEngine.java | 1301 ++++ .../internal/codeassist/ThrownExceptionFinder.java | 129 + .../codeassist/UnresolvedReferenceNameFinder.java | 552 ++ .../codeassist/complete/CompletionJavadoc.java | 221 + .../complete/CompletionJavadocParser.java | 850 +++ .../complete/CompletionNodeDetector.java | 288 + .../codeassist/complete/CompletionNodeFound.java | 44 + .../complete/CompletionOnArgumentName.java | 58 + .../complete/CompletionOnBrankStatementLabel.java | 52 + .../complete/CompletionOnClassLiteralAccess.java | 63 + .../CompletionOnExplicitConstructorCall.java | 84 + .../codeassist/complete/CompletionOnFieldName.java | 43 + .../codeassist/complete/CompletionOnFieldType.java | 56 + .../complete/CompletionOnImportReference.java | 51 + .../codeassist/complete/CompletionOnJavadoc.java | 37 + .../CompletionOnJavadocAllocationExpression.java | 103 + .../CompletionOnJavadocFieldReference.java | 142 + .../complete/CompletionOnJavadocMessageSend.java | 102 + .../CompletionOnJavadocParamNameReference.java | 60 + .../CompletionOnJavadocQualifiedTypeReference.java | 98 + .../CompletionOnJavadocSingleTypeReference.java | 95 + .../complete/CompletionOnJavadocTag.java | 167 + .../codeassist/complete/CompletionOnKeyword.java | 18 + .../codeassist/complete/CompletionOnKeyword1.java | 47 + .../codeassist/complete/CompletionOnKeyword2.java | 36 + .../codeassist/complete/CompletionOnKeyword3.java | 43 + .../codeassist/complete/CompletionOnLocalName.java | 51 + .../complete/CompletionOnMemberAccess.java | 118 + .../complete/CompletionOnMessageSend.java | 73 + .../complete/CompletionOnMessageSendName.java | 51 + .../complete/CompletionOnMethodName.java | 46 + .../CompletionOnQualifiedAllocationExpression.java | 74 + .../CompletionOnQualifiedNameReference.java | 89 + .../complete/CompletionOnQualifiedType.java | 69 + .../CompletionOnQualifiedTypeReference.java | 104 + .../complete/CompletionOnSingleNameReference.java | 77 + .../complete/CompletionOnSingleTypeName.java | 47 + .../complete/CompletionOnSingleTypeReference.java | 140 + .../complete/CompletionOnStringLiteral.java | 62 + .../codeassist/complete/CompletionParser.java | 3323 +++++++++ .../codeassist/complete/CompletionScanner.java | 784 ++ .../codeassist/complete/InvalidCursorLocation.java | 32 + .../internal/codeassist/impl/AssistOptions.java | 237 + .../internal/codeassist/impl/AssistParser.java | 1314 ++++ .../wst/jsdt/internal/codeassist/impl/Engine.java | 392 + .../jsdt/internal/codeassist/impl/Keywords.java | 65 + .../codeassist/select/SelectionJavadoc.java | 142 + .../codeassist/select/SelectionJavadocParser.java | 192 + .../codeassist/select/SelectionNodeFound.java | 31 + .../codeassist/select/SelectionOnArgumentName.java | 50 + .../select/SelectionOnExplicitConstructorCall.java | 74 + .../select/SelectionOnFieldReference.java | 64 + .../codeassist/select/SelectionOnFieldType.java | 28 + .../select/SelectionOnImportReference.java | 48 + .../codeassist/select/SelectionOnLocalName.java | 45 + .../codeassist/select/SelectionOnMessageSend.java | 82 + .../select/SelectionOnPackageReference.java | 46 + .../SelectionOnQualifiedAllocationExpression.java | 79 + .../select/SelectionOnQualifiedNameReference.java | 87 + .../select/SelectionOnQualifiedType.java | 27 + .../select/SelectionOnQualifiedTypeReference.java | 64 + .../select/SelectionOnSingleNameReference.java | 113 + .../codeassist/select/SelectionOnSingleType.java | 20 + .../select/SelectionOnSingleTypeReference.java | 63 + .../select/SelectionOnSuperReference.java | 58 + .../codeassist/select/SelectionParser.java | 690 ++ .../codeassist/select/SelectionScanner.java | 67 + .../wst/jsdt/internal/compiler/ASTVisitor.java | 879 +++ .../jsdt/internal/compiler/CompilationResult.java | 464 ++ .../wst/jsdt/internal/compiler/Compiler.java | 713 ++ .../compiler/DefaultErrorHandlingPolicies.java | 75 + .../jsdt/internal/compiler/DelegateASTVisitor.java | 866 +++ .../jsdt/internal/compiler/ICompilerRequestor.java | 22 + .../jsdt/internal/compiler/IDebugRequestor.java | 42 + .../internal/compiler/IErrorHandlingPolicy.java | 28 + .../jsdt/internal/compiler/IProblemFactory.java | 42 + .../internal/compiler/ISourceElementRequestor.java | 142 + .../internal/compiler/SourceElementParser.java | 1450 ++++ .../internal/compiler/SourceJavadocParser.java | 94 + .../internal/compiler/ast/AND_AND_Expression.java | 86 + .../wst/jsdt/internal/compiler/ast/ASTNode.java | 487 ++ .../compiler/ast/AbstractMethodDeclaration.java | 432 ++ .../compiler/ast/AbstractVariableDeclaration.java | 162 + .../compiler/ast/AllocationExpression.java | 221 + .../wst/jsdt/internal/compiler/ast/Argument.java | 158 + .../compiler/ast/ArrayAllocationExpression.java | 121 + .../internal/compiler/ast/ArrayInitializer.java | 177 + .../compiler/ast/ArrayQualifiedTypeReference.java | 104 + .../jsdt/internal/compiler/ast/ArrayReference.java | 124 + .../internal/compiler/ast/ArrayTypeReference.java | 95 + .../wst/jsdt/internal/compiler/ast/Assignment.java | 258 + .../internal/compiler/ast/BinaryExpression.java | 383 + .../wst/jsdt/internal/compiler/ast/Block.java | 125 + .../internal/compiler/ast/BranchStatement.java | 39 + .../jsdt/internal/compiler/ast/BreakStatement.java | 101 + .../jsdt/internal/compiler/ast/CaseStatement.java | 117 + .../internal/compiler/ast/ClassLiteralAccess.java | 73 + .../wst/jsdt/internal/compiler/ast/Clinit.java | 126 + .../compiler/ast/CombinedBinaryExpression.java | 247 + .../compiler/ast/CompilationUnitDeclaration.java | 696 ++ .../internal/compiler/ast/CompoundAssignment.java | 180 + .../compiler/ast/ConditionalExpression.java | 303 + .../compiler/ast/ConstructorDeclaration.java | 282 + .../internal/compiler/ast/ContinueStatement.java | 105 + .../internal/compiler/ast/DebuggerStatement.java | 64 + .../jsdt/internal/compiler/ast/DoStatement.java | 151 + .../jsdt/internal/compiler/ast/DoubleLiteral.java | 105 + .../internal/compiler/ast/EmptyExpression.java | 42 + .../jsdt/internal/compiler/ast/EmptyStatement.java | 64 + .../internal/compiler/ast/EqualExpression.java | 234 + .../compiler/ast/ExplicitConstructorCall.java | 327 + .../wst/jsdt/internal/compiler/ast/Expression.java | 668 ++ .../compiler/ast/ExtendedStringLiteral.java | 62 + .../jsdt/internal/compiler/ast/FalseLiteral.java | 45 + .../internal/compiler/ast/FieldDeclaration.java | 229 + .../jsdt/internal/compiler/ast/FieldReference.java | 578 ++ .../jsdt/internal/compiler/ast/ForInStatement.java | 209 + .../jsdt/internal/compiler/ast/ForStatement.java | 304 + .../internal/compiler/ast/ForeachStatement.java | 258 + .../internal/compiler/ast/FunctionExpression.java | 82 + .../jsdt/internal/compiler/ast/HoistingFinder.java | 79 + .../jsdt/internal/compiler/ast/IfStatement.java | 213 + .../internal/compiler/ast/ImportReference.java | 105 + .../jsdt/internal/compiler/ast/Initializer.java | 107 + .../compiler/ast/InstanceOfExpression.java | 90 + .../wst/jsdt/internal/compiler/ast/IntLiteral.java | 154 + .../internal/compiler/ast/IntLiteralMinValue.java | 35 + .../wst/jsdt/internal/compiler/ast/Javadoc.java | 687 ++ .../compiler/ast/JavadocAllocationExpression.java | 170 + .../compiler/ast/JavadocArgumentExpression.java | 112 + .../ast/JavadocArrayQualifiedTypeReference.java | 55 + .../ast/JavadocArraySingleTypeReference.java | 53 + .../compiler/ast/JavadocFieldReference.java | 162 + .../compiler/ast/JavadocImplicitTypeReference.java | 119 + .../internal/compiler/ast/JavadocMessageSend.java | 249 + .../ast/JavadocQualifiedTypeReference.java | 92 + .../compiler/ast/JavadocReturnStatement.java | 79 + .../compiler/ast/JavadocSingleNameReference.java | 98 + .../compiler/ast/JavadocSingleTypeReference.java | 104 + .../internal/compiler/ast/LabeledStatement.java | 122 + .../jsdt/internal/compiler/ast/ListExpression.java | 108 + .../wst/jsdt/internal/compiler/ast/Literal.java | 65 + .../internal/compiler/ast/LocalDeclaration.java | 373 + .../jsdt/internal/compiler/ast/MagicLiteral.java | 36 + .../jsdt/internal/compiler/ast/MessageSend.java | 472 ++ .../internal/compiler/ast/MethodDeclaration.java | 184 + .../jsdt/internal/compiler/ast/NameReference.java | 101 + .../jsdt/internal/compiler/ast/NullLiteral.java | 59 + .../jsdt/internal/compiler/ast/NumberLiteral.java | 43 + .../internal/compiler/ast/OR_OR_Expression.java | 89 + .../compiler/ast/ObjectGetterSetterField.java | 101 + .../jsdt/internal/compiler/ast/ObjectLiteral.java | 106 + .../internal/compiler/ast/ObjectLiteralField.java | 90 + .../internal/compiler/ast/OperatorExpression.java | 1733 +++++ .../jsdt/internal/compiler/ast/OperatorIds.java | 50 + .../internal/compiler/ast/PostfixExpression.java | 55 + .../internal/compiler/ast/PrefixExpression.java | 62 + .../jsdt/internal/compiler/ast/ProgramElement.java | 35 + .../ast/QualifiedAllocationExpression.java | 278 + .../compiler/ast/QualifiedNameReference.java | 554 ++ .../compiler/ast/QualifiedThisReference.java | 119 + .../compiler/ast/QualifiedTypeReference.java | 136 + .../wst/jsdt/internal/compiler/ast/Reference.java | 41 + .../jsdt/internal/compiler/ast/RegExLiteral.java | 94 + .../internal/compiler/ast/ReturnStatement.java | 176 + .../internal/compiler/ast/SingleNameReference.java | 516 ++ .../internal/compiler/ast/SingleTypeReference.java | 90 + .../wst/jsdt/internal/compiler/ast/Statement.java | 81 + .../jsdt/internal/compiler/ast/StringLiteral.java | 110 + .../compiler/ast/StringLiteralConcatenation.java | 85 + .../internal/compiler/ast/SubRoutineStatement.java | 37 + .../jsdt/internal/compiler/ast/SuperReference.java | 74 + .../internal/compiler/ast/SwitchStatement.java | 222 + .../jsdt/internal/compiler/ast/ThisReference.java | 110 + .../jsdt/internal/compiler/ast/ThrowStatement.java | 62 + .../jsdt/internal/compiler/ast/TrueLiteral.java | 45 + .../jsdt/internal/compiler/ast/TryStatement.java | 449 ++ .../internal/compiler/ast/TypeDeclaration.java | 983 +++ .../jsdt/internal/compiler/ast/TypeReference.java | 179 + .../internal/compiler/ast/UnaryExpression.java | 170 + .../internal/compiler/ast/UndefinedLiteral.java | 57 + .../jsdt/internal/compiler/ast/WhileStatement.java | 160 + .../jsdt/internal/compiler/ast/WithStatement.java | 87 + .../internal/compiler/batch/ClasspathFile.java | 158 + .../internal/compiler/batch/ClasspathLocation.java | 68 + .../compiler/batch/ClasspathMetadataFile.java | 127 + .../internal/compiler/batch/CompilationUnit.java | 109 + .../jsdt/internal/compiler/batch/FileFinder.java | 41 + .../jsdt/internal/compiler/batch/FileSystem.java | 384 + .../wst/jsdt/internal/compiler/batch/Main.java | 3892 ++++++++++ .../internal/compiler/batch/messages.properties | 290 + .../compiler/classfmt/ClassFileConstants.java | 108 + .../internal/compiler/env/AccessRestriction.java | 50 + .../wst/jsdt/internal/compiler/env/AccessRule.java | 71 + .../jsdt/internal/compiler/env/AccessRuleSet.java | 118 + .../jsdt/internal/compiler/env/ClassSignature.java | 38 + .../jsdt/internal/compiler/env/IBinaryField.java | 50 + .../jsdt/internal/compiler/env/IBinaryMethod.java | 73 + .../internal/compiler/env/IBinaryNestedType.java | 38 + .../jsdt/internal/compiler/env/IBinaryType.java | 113 + .../internal/compiler/env/ICompilationUnit.java | 49 + .../wst/jsdt/internal/compiler/env/IDependent.java | 44 + .../jsdt/internal/compiler/env/IGenericField.java | 23 + .../jsdt/internal/compiler/env/IGenericMethod.java | 29 + .../jsdt/internal/compiler/env/IGenericType.java | 28 + .../internal/compiler/env/INameEnvironment.java | 74 + .../jsdt/internal/compiler/env/ISourceField.java | 47 + .../jsdt/internal/compiler/env/ISourceImport.java | 32 + .../jsdt/internal/compiler/env/ISourceMethod.java | 44 + .../jsdt/internal/compiler/env/ISourceType.java | 84 + .../compiler/env/NameEnvironmentAnswer.java | 138 + .../compiler/flow/ConditionalFlowInfo.java | 217 + .../flow/ExceptionHandlingFlowContext.java | 196 + .../internal/compiler/flow/FinallyFlowContext.java | 282 + .../jsdt/internal/compiler/flow/FlowContext.java | 597 ++ .../wst/jsdt/internal/compiler/flow/FlowInfo.java | 389 + .../compiler/flow/InitializationFlowContext.java | 98 + .../compiler/flow/InsideSubRoutineFlowContext.java | 58 + .../internal/compiler/flow/LabelFlowContext.java | 51 + .../internal/compiler/flow/LoopingFlowContext.java | 421 ++ .../internal/compiler/flow/NullInfoRegistry.java | 377 + .../internal/compiler/flow/SwitchFlowContext.java | 47 + .../compiler/flow/UnconditionalFlowInfo.java | 1713 +++++ .../internal/compiler/impl/BooleanConstant.java | 43 + .../jsdt/internal/compiler/impl/CharConstant.java | 56 + .../internal/compiler/impl/CompilerOptions.java | 1325 ++++ .../wst/jsdt/internal/compiler/impl/Constant.java | 1336 ++++ .../internal/compiler/impl/DoubleConstant.java | 67 + .../jsdt/internal/compiler/impl/FloatConstant.java | 64 + .../internal/compiler/impl/ITypeRequestor.java | 46 + .../internal/compiler/impl/ITypeRequestor2.java | 24 + .../jsdt/internal/compiler/impl/IntConstant.java | 99 + .../jsdt/internal/compiler/impl/LongConstant.java | 58 + .../internal/compiler/impl/ReferenceContext.java | 26 + .../jsdt/internal/compiler/impl/ShortConstant.java | 53 + .../internal/compiler/impl/StringConstant.java | 46 + .../internal/compiler/lookup/ArrayBinding.java | 270 + .../internal/compiler/lookup/BaseTypeBinding.java | 207 + .../compiler/lookup/BinaryTypeBinding.java | 775 ++ .../wst/jsdt/internal/compiler/lookup/Binding.java | 84 + .../jsdt/internal/compiler/lookup/BlockScope.java | 816 +++ .../jsdt/internal/compiler/lookup/ClassScope.java | 814 +++ .../compiler/lookup/CombinedSourceTypeBinding.java | 182 + .../compiler/lookup/CompilationUnitBinding.java | 167 + .../compiler/lookup/CompilationUnitScope.java | 1178 +++ .../compiler/lookup/ExtraCompilerModifiers.java | 39 + .../internal/compiler/lookup/FieldBinding.java | 277 + .../compiler/lookup/FunctionTypeBinding.java | 149 + .../internal/compiler/lookup/GlobalBinding.java | 189 + .../internal/compiler/lookup/ImportBinding.java | 46 + .../compiler/lookup/ImportConflictBinding.java | 29 + .../compiler/lookup/IndirectMethodBinding.java | 22 + .../compiler/lookup/InnerEmulationDependency.java | 22 + .../internal/compiler/lookup/InvocationSite.java | 27 + .../compiler/lookup/LibraryAPIsBinding.java | 91 + .../internal/compiler/lookup/LibraryAPIsScope.java | 139 + .../compiler/lookup/LocalFunctionBinding.java | 25 + .../internal/compiler/lookup/LocalTypeBinding.java | 185 + .../compiler/lookup/LocalVariableBinding.java | 237 + .../compiler/lookup/LookupEnvironment.java | 1009 +++ .../compiler/lookup/MemberTypeBinding.java | 35 + .../jsdt/internal/compiler/lookup/Messages.java | 32 + .../compiler/lookup/MetatdataTypeBinding.java | 965 +++ .../internal/compiler/lookup/MethodBinding.java | 628 ++ .../jsdt/internal/compiler/lookup/MethodScope.java | 410 ++ .../internal/compiler/lookup/MethodVerifier.java | 499 ++ .../compiler/lookup/MissingBinaryTypeBinding.java | 57 + .../compiler/lookup/MultipleTypeBinding.java | 175 + .../compiler/lookup/NestedTypeBinding.java | 32 + .../internal/compiler/lookup/PackageBinding.java | 276 + .../internal/compiler/lookup/ProblemBinding.java | 55 + .../compiler/lookup/ProblemFieldBinding.java | 36 + .../compiler/lookup/ProblemMethodBinding.java | 42 + .../internal/compiler/lookup/ProblemReasons.java | 25 + .../compiler/lookup/ProblemReferenceBinding.java | 50 + .../internal/compiler/lookup/ReferenceBinding.java | 819 +++ .../wst/jsdt/internal/compiler/lookup/Scope.java | 2979 ++++++++ .../internal/compiler/lookup/SignatureWrapper.java | 68 + .../compiler/lookup/SourceTypeBinding.java | 1418 ++++ .../wst/jsdt/internal/compiler/lookup/TagBits.java | 72 + .../jsdt/internal/compiler/lookup/TypeBinding.java | 487 ++ .../internal/compiler/lookup/TypeConstants.java | 101 + .../wst/jsdt/internal/compiler/lookup/TypeIds.java | 128 + .../lookup/UnresolvedReferenceBinding.java | 72 + .../compiler/lookup/UpdatedMethodBinding.java | 25 + .../internal/compiler/lookup/VariableBinding.java | 42 + .../jsdt/internal/compiler/lookup/WithScope.java | 24 + .../wst/jsdt/internal/compiler/messages.properties | 63 + .../compiler/parser/AbstractCommentParser.java | 1511 ++++ .../internal/compiler/parser/JavadocParser.java | 1133 +++ .../compiler/parser/JavadocTagConstants.java | 284 + .../wst/jsdt/internal/compiler/parser/NLSTag.java | 30 + .../wst/jsdt/internal/compiler/parser/Parser.java | 7103 ++++++++++++++++++ .../compiler/parser/ParserBasicInformation.java | 38 + .../internal/compiler/parser/RecoveredBlock.java | 409 ++ .../internal/compiler/parser/RecoveredElement.java | 328 + .../internal/compiler/parser/RecoveredField.java | 190 + .../internal/compiler/parser/RecoveredImport.java | 62 + .../compiler/parser/RecoveredInitializer.java | 234 + .../compiler/parser/RecoveredLocalVariable.java | 114 + .../internal/compiler/parser/RecoveredMethod.java | 455 ++ .../compiler/parser/RecoveredStatement.java | 103 + .../internal/compiler/parser/RecoveredType.java | 510 ++ .../internal/compiler/parser/RecoveredUnit.java | 325 + .../internal/compiler/parser/RecoveryScanner.java | 241 + .../compiler/parser/RecoveryScannerData.java | 73 + .../wst/jsdt/internal/compiler/parser/Scanner.java | 4400 ++++++++++++ .../internal/compiler/parser/ScannerHelper.java | 355 + .../compiler/parser/SourceTypeConverter.java | 862 +++ .../internal/compiler/parser/TerminalTokens.java | 158 + .../compiler/parser/UpdateParserFiles.java | 30 + .../compiler/parser/diagnose/DiagnoseParser.java | 2530 +++++++ .../compiler/parser/diagnose/LexStream.java | 291 + .../compiler/parser/diagnose/RangeUtil.java | 179 + .../wst/jsdt/internal/compiler/parser/parser1.rsc | Bin 0 -> 15282 bytes .../wst/jsdt/internal/compiler/parser/parser10.rsc | Bin 0 -> 114 bytes .../wst/jsdt/internal/compiler/parser/parser11.rsc | Bin 0 -> 114 bytes .../wst/jsdt/internal/compiler/parser/parser12.rsc | Bin 0 -> 114 bytes .../wst/jsdt/internal/compiler/parser/parser13.rsc | Bin 0 -> 114 bytes .../wst/jsdt/internal/compiler/parser/parser14.rsc | Bin 0 -> 532 bytes .../wst/jsdt/internal/compiler/parser/parser15.rsc | Bin 0 -> 466 bytes .../wst/jsdt/internal/compiler/parser/parser16.rsc | Bin 0 -> 1106 bytes .../wst/jsdt/internal/compiler/parser/parser17.rsc | Bin 0 -> 399 bytes .../wst/jsdt/internal/compiler/parser/parser18.rsc | Bin 0 -> 6103 bytes .../wst/jsdt/internal/compiler/parser/parser19.rsc | 1 + .../wst/jsdt/internal/compiler/parser/parser2.rsc | Bin 0 -> 14484 bytes .../wst/jsdt/internal/compiler/parser/parser20.rsc | Bin 0 -> 8068 bytes .../wst/jsdt/internal/compiler/parser/parser21.rsc | Bin 0 -> 3192 bytes .../wst/jsdt/internal/compiler/parser/parser22.rsc | Bin 0 -> 362 bytes .../wst/jsdt/internal/compiler/parser/parser23.rsc | Bin 0 -> 62 bytes .../wst/jsdt/internal/compiler/parser/parser24.rsc | Bin 0 -> 362 bytes .../wst/jsdt/internal/compiler/parser/parser25.rsc | Bin 0 -> 399 bytes .../wst/jsdt/internal/compiler/parser/parser3.rsc | Bin 0 -> 1106 bytes .../wst/jsdt/internal/compiler/parser/parser4.rsc | Bin 0 -> 1322 bytes .../wst/jsdt/internal/compiler/parser/parser5.rsc | Bin 0 -> 1106 bytes .../wst/jsdt/internal/compiler/parser/parser6.rsc | Bin 0 -> 352 bytes .../wst/jsdt/internal/compiler/parser/parser7.rsc | Bin 0 -> 242 bytes .../wst/jsdt/internal/compiler/parser/parser8.rsc | Bin 0 -> 362 bytes .../wst/jsdt/internal/compiler/parser/parser9.rsc | Bin 0 -> 12028 bytes .../wst/jsdt/internal/compiler/parser/part1.rsc | Bin 0 -> 8192 bytes .../wst/jsdt/internal/compiler/parser/part14.rsc | Bin 0 -> 8192 bytes .../wst/jsdt/internal/compiler/parser/part2.rsc | Bin 0 -> 8192 bytes .../compiler/parser/readableNames.properties | 179 + .../wst/jsdt/internal/compiler/parser/start1.rsc | Bin 0 -> 8192 bytes .../wst/jsdt/internal/compiler/parser/start2.rsc | Bin 0 -> 8192 bytes .../compiler/problem/AbortCompilation.java | 88 + .../compiler/problem/AbortCompilationUnit.java | 41 + .../internal/compiler/problem/AbortMethod.java | 29 + .../jsdt/internal/compiler/problem/AbortType.java | 29 + .../internal/compiler/problem/DefaultProblem.java | 289 + .../compiler/problem/DefaultProblemFactory.java | 206 + .../internal/compiler/problem/ProblemHandler.java | 167 + .../internal/compiler/problem/ProblemReporter.java | 3306 +++++++++ .../compiler/problem/ProblemSeverities.java | 27 + .../compiler/problem/ShouldNotImplement.java | 24 + .../internal/compiler/problem/messages.properties | 371 + .../internal/compiler/util/CompoundNameVector.java | 71 + .../jsdt/internal/compiler/util/EclipseUtil.java | 71 + .../wst/jsdt/internal/compiler/util/FloatUtil.java | 421 ++ .../internal/compiler/util/GenericXMLWriter.java | 131 + .../internal/compiler/util/HashtableOfBinding.java | 105 + .../internal/compiler/util/HashtableOfInt.java | 98 + .../compiler/util/HashtableOfIntValues.java | 156 + .../internal/compiler/util/HashtableOfLong.java | 101 + .../internal/compiler/util/HashtableOfObject.java | 162 + .../compiler/util/HashtableOfObjectToInt.java | 155 + .../compiler/util/HashtableOfObjectToIntArray.java | 155 + .../internal/compiler/util/HashtableOfPackage.java | 105 + .../internal/compiler/util/HashtableOfType.java | 105 + .../wst/jsdt/internal/compiler/util/Messages.java | 245 + .../jsdt/internal/compiler/util/ObjectCache.java | 158 + .../jsdt/internal/compiler/util/ObjectVector.java | 135 + .../internal/compiler/util/SimpleLookupTable.java | 167 + .../internal/compiler/util/SimpleNameVector.java | 96 + .../wst/jsdt/internal/compiler/util/SimpleSet.java | 141 + .../compiler/util/SimpleSetOfCharArray.java | 143 + .../internal/compiler/util/SuffixConstants.java | 31 + .../wst/jsdt/internal/compiler/util/Util.java | 571 ++ .../wst/jsdt/internal/core/ASTHolderCUInfo.java | 23 + .../jsdt/internal/core/BasicCompilationUnit.java | 162 + .../wst/jsdt/internal/core/BatchOperation.java | 64 + .../internal/core/BecomeWorkingCopyOperation.java | 75 + .../wst/jsdt/internal/core/BinaryField.java | 124 + .../wst/jsdt/internal/core/BinaryMember.java | 132 + .../wst/jsdt/internal/core/BinaryMethod.java | 620 ++ .../eclipse/wst/jsdt/internal/core/BinaryType.java | 882 +++ .../jsdt/internal/core/BinaryTypeConverter.java | 236 + .../org/eclipse/wst/jsdt/internal/core/Buffer.java | 475 ++ .../wst/jsdt/internal/core/BufferCache.java | 76 + .../jsdt/internal/core/BufferFactoryWrapper.java | 55 + .../wst/jsdt/internal/core/BufferManager.java | 146 + .../internal/core/CancelableNameEnvironment.java | 67 + .../internal/core/CancelableProblemFactory.java | 34 + .../internal/core/ChangeClasspathOperation.java | 86 + .../eclipse/wst/jsdt/internal/core/ClassFile.java | 909 +++ .../wst/jsdt/internal/core/ClassFileInfo.java | 171 + .../jsdt/internal/core/ClassFileWorkingCopy.java | 78 + .../jsdt/internal/core/ClasspathAccessRule.java | 56 + .../wst/jsdt/internal/core/ClasspathAttribute.java | 48 + .../wst/jsdt/internal/core/ClasspathChange.java | 491 ++ .../wst/jsdt/internal/core/ClasspathEntry.java | 1688 +++++ .../jsdt/internal/core/ClasspathValidation.java | 84 + .../internal/core/CommitWorkingCopyOperation.java | 221 + .../wst/jsdt/internal/core/CompilationUnit.java | 1404 ++++ .../internal/core/CompilationUnitElementInfo.java | 66 + .../core/CompilationUnitProblemFinder.java | 345 + .../core/CompilationUnitStructureRequestor.java | 453 ++ .../jsdt/internal/core/CopyElementsOperation.java | 262 + .../core/CopyPackageFragmentRootOperation.java | 274 + .../core/CopyResourceElementsOperation.java | 724 ++ .../core/CreateCompilationUnitOperation.java | 176 + .../internal/core/CreateElementInCUOperation.java | 330 + .../jsdt/internal/core/CreateFieldOperation.java | 177 + .../jsdt/internal/core/CreateImportOperation.java | 168 + .../jsdt/internal/core/CreateMethodOperation.java | 135 + .../core/CreatePackageFragmentOperation.java | 157 + .../core/CreateTypeHierarchyOperation.java | 125 + .../internal/core/CreateTypeMemberOperation.java | 223 + .../jsdt/internal/core/CreateTypeOperation.java | 115 + .../internal/core/DefaultWorkingCopyOwner.java | 38 + .../internal/core/DeleteElementsOperation.java | 195 + .../core/DeletePackageFragmentRootOperation.java | 173 + .../core/DeleteResourceElementsOperation.java | 142 + .../jsdt/internal/core/DeltaProcessingState.java | 539 ++ .../wst/jsdt/internal/core/DeltaProcessor.java | 2571 +++++++ .../internal/core/DiscardWorkingCopyOperation.java | 71 + .../wst/jsdt/internal/core/DocumentAdapter.java | 39 + .../internal/core/DocumentContextFragment.java | 187 + .../internal/core/DocumentContextFragmentRoot.java | 644 ++ .../wst/jsdt/internal/core/ElementCache.java | 97 + .../jsdt/internal/core/ExternalJavaProject.java | 62 + .../jsdt/internal/core/IJavaElementRequestor.java | 38 + .../wst/jsdt/internal/core/INamingRequestor.java | 18 + .../wst/jsdt/internal/core/IPathRequestor.java | 15 + .../wst/jsdt/internal/core/IVirtualParent.java | 26 + .../wst/jsdt/internal/core/ImportContainer.java | 120 + .../wst/jsdt/internal/core/ImportDeclaration.java | 113 + .../core/ImportDeclarationElementInfo.java | 22 + .../wst/jsdt/internal/core/Initializer.java | 119 + .../jsdt/internal/core/InitializerElementInfo.java | 18 + .../internal/core/InternalNamingConventions.java | 423 ++ .../core/JavaCorePreferenceInitializer.java | 124 + .../core/JavaCorePreferenceModifyListener.java | 73 + .../wst/jsdt/internal/core/JavaElement.java | 890 +++ .../wst/jsdt/internal/core/JavaElementDelta.java | 732 ++ .../internal/core/JavaElementDeltaBuilder.java | 449 ++ .../wst/jsdt/internal/core/JavaElementInfo.java | 80 + .../jsdt/internal/core/JavaElementRequestor.java | 226 + .../eclipse/wst/jsdt/internal/core/JavaModel.java | 385 + .../wst/jsdt/internal/core/JavaModelCache.java | 236 + .../wst/jsdt/internal/core/JavaModelInfo.java | 63 + .../wst/jsdt/internal/core/JavaModelManager.java | 4376 +++++++++++ .../wst/jsdt/internal/core/JavaModelOperation.java | 899 +++ .../wst/jsdt/internal/core/JavaModelStatus.java | 481 ++ .../wst/jsdt/internal/core/JavaProject.java | 3235 +++++++++ .../jsdt/internal/core/JavaProjectElementInfo.java | 360 + .../wst/jsdt/internal/core/JavadocConstants.java | 34 + .../wst/jsdt/internal/core/LRUCacheEnumerator.java | 69 + .../jsdt/internal/core/LibraryFragmentRoot.java | 285 + .../internal/core/LibraryFragmentRootInfo.java | 24 + .../jsdt/internal/core/LibraryPackageFragment.java | 270 + .../internal/core/LibraryPackageFragmentInfo.java | 23 + .../wst/jsdt/internal/core/LocalVariable.java | 244 + .../org/eclipse/wst/jsdt/internal/core/Logger.java | 100 + .../jsdt/internal/core/LookupScopeElementInfo.java | 219 + .../org/eclipse/wst/jsdt/internal/core/Member.java | 396 + .../wst/jsdt/internal/core/MemberElementInfo.java | 77 + .../wst/jsdt/internal/core/MetadataFile.java | 393 + .../wst/jsdt/internal/core/ModelUpdater.java | 248 + .../jsdt/internal/core/MoveElementsOperation.java | 46 + .../core/MovePackageFragmentRootOperation.java | 283 + .../core/MoveResourceElementsOperation.java | 45 + .../wst/jsdt/internal/core/MultiOperation.java | 317 + .../eclipse/wst/jsdt/internal/core/NameLookup.java | 2299 ++++++ .../wst/jsdt/internal/core/NamedMember.java | 206 + .../eclipse/wst/jsdt/internal/core/NullBuffer.java | 27 + .../eclipse/wst/jsdt/internal/core/Openable.java | 484 ++ .../jsdt/internal/core/OpenableElementInfo.java | 37 + .../jsdt/internal/core/OverflowingLRUCache.java | 417 ++ .../wst/jsdt/internal/core/PackageFragment.java | 545 ++ .../jsdt/internal/core/PackageFragmentInfo.java | 63 + .../jsdt/internal/core/PackageFragmentRoot.java | 918 +++ .../internal/core/PackageFragmentRootInfo.java | 181 + .../jsdt/internal/core/ProjectReferenceChange.java | 103 + .../core/ReconcileWorkingCopyOperation.java | 283 + .../org/eclipse/wst/jsdt/internal/core/Region.java | 150 + .../internal/core/RenameElementsOperation.java | 83 + .../core/RenameResourceElementsOperation.java | 68 + .../jsdt/internal/core/ResolvedBinaryField.java | 60 + .../jsdt/internal/core/ResolvedBinaryMethod.java | 58 + .../wst/jsdt/internal/core/ResolvedBinaryType.java | 66 + .../jsdt/internal/core/ResolvedSourceField.java | 64 + .../jsdt/internal/core/ResolvedSourceMethod.java | 59 + .../wst/jsdt/internal/core/ResolvedSourceType.java | 66 + .../jsdt/internal/core/SearchableEnvironment.java | 880 +++ .../core/SearchableEnvironmentRequestor.java | 120 + .../wst/jsdt/internal/core/SelectionRequestor.java | 1006 +++ .../jsdt/internal/core/SetClasspathOperation.java | 87 + .../jsdt/internal/core/SetContainerOperation.java | 210 + .../jsdt/internal/core/SetVariablesOperation.java | 193 + .../wst/jsdt/internal/core/SimpleDelta.java | 124 + .../jsdt/internal/core/SingleTypeRequestor.java | 83 + .../jsdt/internal/core/SortElementsOperation.java | 342 + .../jsdt/internal/core/SourceConstructorInfo.java | 21 + .../wst/jsdt/internal/core/SourceField.java | 240 + .../jsdt/internal/core/SourceFieldElementInfo.java | 78 + .../wst/jsdt/internal/core/SourceMapper.java | 1305 ++++ .../wst/jsdt/internal/core/SourceMethod.java | 277 + .../internal/core/SourceMethodElementInfo.java | 53 + .../wst/jsdt/internal/core/SourceMethodInfo.java | 20 + .../wst/jsdt/internal/core/SourceRange.java | 62 + .../wst/jsdt/internal/core/SourceRefElement.java | 293 + .../jsdt/internal/core/SourceRefElementInfo.java | 45 + .../eclipse/wst/jsdt/internal/core/SourceType.java | 758 ++ .../jsdt/internal/core/SourceTypeElementInfo.java | 305 + .../eclipse/wst/jsdt/internal/core/TypeVector.java | 113 + .../wst/jsdt/internal/core/UserLibrary.java | 210 + .../core/UserLibraryJsGlobalScopeContainer.java | 87 + ...erLibraryJsGlobalScopeContainerInitializer.java | 88 + .../wst/jsdt/internal/core/UserLibraryManager.java | 276 + .../jsdt/internal/core/VerboseElementCache.java | 51 + .../eclipse/wst/jsdt/internal/core/XMLWriter.java | 25 + .../builder/AbortIncrementalBuildException.java | 26 + .../core/builder/AbstractImageBuilder.java | 667 ++ .../core/builder/AdditionalTypeCollection.java | 22 + .../internal/core/builder/BatchImageBuilder.java | 137 + .../jsdt/internal/core/builder/BuildNotifier.java | 278 + .../internal/core/builder/ClasspathDirectory.java | 127 + .../internal/core/builder/ClasspathLibrary.java | 138 + .../internal/core/builder/ClasspathLocation.java | 56 + .../core/builder/ClasspathMultiDirectory.java | 61 + .../core/builder/ICompilationUnitLocator.java | 25 + .../builder/ImageBuilderInternalException.java | 52 + .../core/builder/IncrementalImageBuilder.java | 752 ++ .../jsdt/internal/core/builder/JavaBuilder.java | 778 ++ .../core/builder/MissingSourceFileException.java | 24 + .../internal/core/builder/NameEnvironment.java | 484 ++ .../wst/jsdt/internal/core/builder/NameSet.java | 66 + .../jsdt/internal/core/builder/ProblemFactory.java | 32 + .../internal/core/builder/QualifiedNameSet.java | 69 + .../internal/core/builder/ReferenceCollection.java | 244 + .../wst/jsdt/internal/core/builder/SourceFile.java | 132 + .../wst/jsdt/internal/core/builder/State.java | 728 ++ .../wst/jsdt/internal/core/builder/StringSet.java | 81 + .../core/builder/ValidationParticipantResult.java | 44 + .../wst/jsdt/internal/core/builder/WorkQueue.java | 55 + .../core/dom/rewrite/ASTRewriteAnalyzer.java | 3161 ++++++++ .../core/dom/rewrite/ASTRewriteFlattener.java | 1277 ++++ .../core/dom/rewrite/ASTRewriteFormatter.java | 539 ++ .../core/dom/rewrite/ImportRewriteAnalyzer.java | 1062 +++ .../core/dom/rewrite/LineCommentEndOffsets.java | 85 + .../internal/core/dom/rewrite/LineInformation.java | 59 + .../core/dom/rewrite/ListRewriteEvent.java | 211 + .../internal/core/dom/rewrite/NodeInfoStore.java | 158 + .../core/dom/rewrite/NodeRewriteEvent.java | 114 + .../internal/core/dom/rewrite/RewriteEvent.java | 79 + .../core/dom/rewrite/RewriteEventStore.java | 849 +++ .../internal/core/dom/rewrite/SourceModifier.java | 48 + .../internal/core/dom/rewrite/TokenScanner.java | 238 + .../core/dom/rewrite/TrackedNodePosition.java | 59 + .../internal/core/hierarchy/ChangeCollector.java | 436 ++ .../core/hierarchy/HierarchyBinaryType.java | 178 + .../internal/core/hierarchy/HierarchyBuilder.java | 257 + .../internal/core/hierarchy/HierarchyResolver.java | 851 +++ .../internal/core/hierarchy/HierarchyType.java | 60 + .../core/hierarchy/IndexBasedHierarchyBuilder.java | 530 ++ .../hierarchy/RegionBasedHierarchyBuilder.java | 223 + .../core/hierarchy/RegionBasedTypeHierarchy.java | 166 + .../internal/core/hierarchy/TypeHierarchy.java | 1220 ++++ .../wst/jsdt/internal/core/index/DiskIndex.java | 1263 ++++ .../wst/jsdt/internal/core/index/EntryResult.java | 79 + .../wst/jsdt/internal/core/index/Index.java | 213 + .../wst/jsdt/internal/core/index/MemoryIndex.java | 130 + .../jsdt/internal/core/interpret/BooleanValue.java | 30 + .../wst/jsdt/internal/core/interpret/Contants.java | 17 + .../internal/core/interpret/FunctionValue.java | 66 + .../core/interpret/InterpretException.java | 28 + .../internal/core/interpret/InterpretedScript.java | 33 + .../jsdt/internal/core/interpret/Interpreter.java | 99 + .../core/interpret/InterpreterContext.java | 100 + .../internal/core/interpret/InterpreterEngine.java | 716 ++ .../internal/core/interpret/InterpreterResult.java | 27 + .../internal/core/interpret/NativeFunction.java | 20 + .../jsdt/internal/core/interpret/NativeObject.java | 15 + .../jsdt/internal/core/interpret/NumberValue.java | 36 + .../jsdt/internal/core/interpret/ObjectValue.java | 51 + .../jsdt/internal/core/interpret/StringValue.java | 35 + .../wst/jsdt/internal/core/interpret/Value.java | 87 + .../internal/core/interpret/ValueReference.java | 18 + .../core/interpret/builtin/BuiltInHelper.java | 22 + .../core/interpret/builtin/BuiltInObject.java | 66 + .../core/interpret/builtin/BuiltInString.java | 61 + .../internal/core/search/AbstractSearchScope.java | 27 + .../internal/core/search/BasicSearchEngine.java | 1640 +++++ .../jsdt/internal/core/search/HierarchyScope.java | 365 + .../core/search/IConstructorRequestor.java | 40 + .../search/IRestrictedAccessBindingRequestor.java | 34 + .../search/IRestrictedAccessTypeRequestor.java | 24 + .../internal/core/search/IndexQueryRequestor.java | 25 + .../jsdt/internal/core/search/IndexSelector.java | 223 + .../internal/core/search/JavaSearchDocument.java | 97 + .../core/search/JavaSearchParticipant.java | 120 + .../jsdt/internal/core/search/JavaSearchScope.java | 714 ++ .../core/search/JavaSearchTypeNameMatch.java | 101 + .../internal/core/search/JavaWorkspaceScope.java | 145 + .../jsdt/internal/core/search/PathCollector.java | 47 + .../internal/core/search/PatternSearchJob.java | 130 + .../internal/core/search/SubTypeSearchJob.java | 39 + .../core/search/TypeNameMatchRequestorWrapper.java | 221 + .../core/search/TypeNameRequestorWrapper.java | 47 + .../core/search/indexing/AbstractIndexer.java | 114 + .../core/search/indexing/AddFolderToIndex.java | 113 + .../search/indexing/AddLibraryFileToIndex.java | 221 + .../search/indexing/AddLibraryFolderToIndex.java | 130 + .../core/search/indexing/IIndexConstants.java | 56 + .../core/search/indexing/IndexAllProject.java | 259 + .../core/search/indexing/IndexBinaryFolder.java | 199 + .../core/search/indexing/IndexManager.java | 836 +++ .../core/search/indexing/IndexRequest.java | 42 + .../core/search/indexing/IndexingParser.java | 64 + .../search/indexing/InternalSearchDocument.java | 48 + .../core/search/indexing/ReadWriteMonitor.java | 111 + .../search/indexing/RemoveFolderFromIndex.java | 78 + .../core/search/indexing/RemoveFromIndex.java | 45 + .../internal/core/search/indexing/SaveIndex.java | 55 + .../core/search/indexing/SourceIndexer.java | 116 + .../search/indexing/SourceIndexerRequestor.java | 293 + .../internal/core/search/matching/AndPattern.java | 86 + .../search/matching/ClassFileMatchLocator.java | 266 + .../search/matching/ClasspathSourceDirectory.java | 114 + .../matching/ConstructorDeclarationPattern.java | 250 + .../core/search/matching/ConstructorLocator.java | 358 + .../core/search/matching/ConstructorPattern.java | 309 + .../DeclarationOfAccessedFieldsPattern.java | 30 + .../DeclarationOfReferencedMethodsPattern.java | 30 + .../DeclarationOfReferencedTypesPattern.java | 28 + .../core/search/matching/FieldLocator.java | 459 ++ .../core/search/matching/FieldPattern.java | 147 + .../search/matching/InternalSearchPattern.java | 124 + .../search/matching/JavaSearchNameEnvironment.java | 202 + .../core/search/matching/JavaSearchPattern.java | 245 + .../core/search/matching/LocalVariableLocator.java | 113 + .../core/search/matching/LocalVariablePattern.java | 115 + .../core/search/matching/MatchLocator.java | 2594 +++++++ .../core/search/matching/MatchLocatorParser.java | 366 + .../core/search/matching/MatchingNodeSet.java | 211 + .../core/search/matching/MethodLocator.java | 634 ++ .../core/search/matching/MethodPattern.java | 380 + .../matching/MultiTypeDeclarationPattern.java | 191 + .../internal/core/search/matching/OrLocator.java | 293 + .../internal/core/search/matching/OrPattern.java | 109 + .../search/matching/PackageDeclarationLocator.java | 28 + .../search/matching/PackageDeclarationPattern.java | 37 + .../search/matching/PackageReferenceLocator.java | 337 + .../search/matching/PackageReferencePattern.java | 78 + .../core/search/matching/PatternLocator.java | 682 ++ .../core/search/matching/PossibleMatch.java | 160 + .../core/search/matching/PossibleMatchSet.java | 78 + .../matching/QualifiedTypeDeclarationPattern.java | 123 + .../matching/SecondaryTypeDeclarationPattern.java | 47 + .../search/matching/SuperTypeNamesCollector.java | 304 + .../search/matching/SuperTypeReferenceLocator.java | 85 + .../search/matching/SuperTypeReferencePattern.java | 221 + .../search/matching/TypeDeclarationLocator.java | 141 + .../search/matching/TypeDeclarationPattern.java | 326 + .../core/search/matching/TypeReferenceLocator.java | 730 ++ .../core/search/matching/TypeReferencePattern.java | 134 + .../core/search/matching/VariableLocator.java | 81 + .../core/search/matching/VariablePattern.java | 73 + .../jsdt/internal/core/search/processing/IJob.java | 43 + .../core/search/processing/JobManager.java | 469 ++ .../wst/jsdt/internal/core/util/ASTNodeFinder.java | 215 + .../jsdt/internal/core/util/BindingKeyParser.java | 761 ++ .../internal/core/util/BindingKeyResolver.java | 338 + .../jsdt/internal/core/util/CharArrayBuffer.java | 193 + .../internal/core/util/CodeSnippetParsingUtil.java | 204 + .../internal/core/util/CommentRecorderParser.java | 260 + .../internal/core/util/CommentRecorderScanner.java | 44 + .../jsdt/internal/core/util/ConvertUtility.java | 344 + .../wst/jsdt/internal/core/util/DOMFinder.java | 117 + .../core/util/DefaultSourcePathProvider.java | 30 + .../wst/jsdt/internal/core/util/HandleFactory.java | 374 + .../jsdt/internal/core/util/HashSetOfArray.java | 149 + .../core/util/HashtableOfArrayToObject.java | 187 + .../jsdt/internal/core/util/ICacheEnumeration.java | 39 + .../wst/jsdt/internal/core/util/ILRUCacheable.java | 28 + .../wst/jsdt/internal/core/util/KeyKind.java | 105 + .../jsdt/internal/core/util/KeyToSignature.java | 194 + .../wst/jsdt/internal/core/util/LRUCache.java | 525 ++ .../jsdt/internal/core/util/MementoTokenizer.java | 115 + .../wst/jsdt/internal/core/util/Messages.java | 268 + .../wst/jsdt/internal/core/util/PublicScanner.java | 4245 +++++++++++ .../core/util/RecordedParsingInformation.java | 39 + .../internal/core/util/ReferenceInfoAdapter.java | 60 + .../core/util/ResourceCompilationUnit.java | 43 + .../jsdt/internal/core/util/SimpleDocument.java | 371 + .../wst/jsdt/internal/core/util/SimpleWordSet.java | 68 + .../jsdt/internal/core/util/ToStringSorter.java | 75 + .../eclipse/wst/jsdt/internal/core/util/Util.java | 2697 +++++++ .../wst/jsdt/internal/core/util/WeakHashSet.java | 217 + .../internal/core/util/WeakHashSetOfCharArray.java | 220 + .../jsdt/internal/core/util/messages.properties | 247 + .../jsdt/internal/formatter/AbortFormatting.java | 31 + .../formatter/BinaryExpressionFragmentBuilder.java | 480 ++ .../CascadingMethodInvocationFragmentBuilder.java | 57 + .../internal/formatter/CodeFormatterVisitor.java | 4783 ++++++++++++ .../internal/formatter/DefaultCodeFormatter.java | 420 ++ .../formatter/DefaultCodeFormatterOptions.java | 2475 +++++++ .../wst/jsdt/internal/formatter/Location.java | 58 + .../internal/formatter/OptimizedReplaceEdit.java | 28 + .../wst/jsdt/internal/formatter/Scribe.java | 1800 +++++ .../jsdt/internal/formatter/align/Alignment.java | 417 ++ .../formatter/align/AlignmentException.java | 55 + .../formatter/comment/CommentFormatterUtil.java | 119 + .../internal/formatter/comment/CommentLine.java | 315 + .../internal/formatter/comment/CommentRange.java | 262 + .../internal/formatter/comment/CommentRegion.java | 573 ++ .../formatter/comment/HTMLEntity2JavaReader.java | 112 + .../formatter/comment/IBorderAttributes.java | 26 + .../formatter/comment/ICommentAttributes.java | 65 + .../formatter/comment/IHtmlTagDelimiters.java | 29 + .../formatter/comment/IJavaDocTagConstants.java | 111 + .../formatter/comment/Java2HTMLEntityReader.java | 56 + .../internal/formatter/comment/JavaDocLine.java | 52 + .../internal/formatter/comment/JavaDocRegion.java | 363 + .../formatter/comment/MultiCommentLine.java | 409 ++ .../formatter/comment/MultiCommentRegion.java | 245 + .../formatter/comment/SingleCommentLine.java | 115 + .../formatter/comment/SubstitutionTextReader.java | 181 + .../wst/jsdt/internal/formatter/options.properties | 75 + .../wst/jsdt/internal/oaametadata/Alias.java | 18 + .../wst/jsdt/internal/oaametadata/Ancestor.java | 15 + .../wst/jsdt/internal/oaametadata/Author.java | 25 + .../wst/jsdt/internal/oaametadata/ClassData.java | 128 + .../oaametadata/DepreciatedOrAvailable.java | 9 + .../internal/oaametadata/DocumentedElement.java | 19 + .../wst/jsdt/internal/oaametadata/Enum.java | 8 + .../wst/jsdt/internal/oaametadata/Event.java | 32 + .../wst/jsdt/internal/oaametadata/Exception.java | 32 + .../oaametadata/IOAAMetaDataConstants.java | 154 + .../wst/jsdt/internal/oaametadata/LibraryAPIs.java | 78 + .../jsdt/internal/oaametadata/MetadataReader.java | 880 +++ .../oaametadata/MetadataSourceElementNotifier.java | 154 + .../wst/jsdt/internal/oaametadata/Method.java | 40 + .../eclipse/wst/jsdt/internal/oaametadata/Mix.java | 29 + .../wst/jsdt/internal/oaametadata/Mixin.java | 29 + .../wst/jsdt/internal/oaametadata/Namespace.java | 29 + .../wst/jsdt/internal/oaametadata/Option.java | 17 + .../wst/jsdt/internal/oaametadata/Parameter.java | 32 + .../wst/jsdt/internal/oaametadata/Property.java | 54 + .../wst/jsdt/internal/oaametadata/ReturnsData.java | 28 + .../internal/oaametadata/VersionableElement.java | 18 + .../wst/jsdt/launching/AbstractVMInstall.java | 472 ++ .../wst/jsdt/launching/AbstractVMInstallType.java | 177 + .../wst/jsdt/launching/ExecutionArguments.java | 83 + .../IJavaLaunchConfigurationConstants.java | 495 ++ .../wst/jsdt/launching/IRuntimeClasspathEntry.java | 332 + .../jsdt/launching/IRuntimeClasspathEntry2.java | 82 + .../launching/IRuntimeClasspathEntryResolver.java | 101 + .../launching/IRuntimeClasspathEntryResolver2.java | 36 + .../jsdt/launching/IRuntimeClasspathProvider.java | 87 + .../org/eclipse/wst/jsdt/launching/IVMInstall.java | 162 + .../eclipse/wst/jsdt/launching/IVMInstall2.java | 69 + .../eclipse/wst/jsdt/launching/IVMInstall3.java | 44 + .../jsdt/launching/IVMInstallChangedListener.java | 98 + .../eclipse/wst/jsdt/launching/IVMInstallType.java | 131 + .../org/eclipse/wst/jsdt/launching/IVMRunner.java | 45 + .../eclipse/wst/jsdt/launching/JREContainer.java | 193 + .../jsdt/launching/JREContainerInitializer.java | 299 + .../eclipse/wst/jsdt/launching/JavaRuntime.java | 2595 +++++++ .../wst/jsdt/launching/LaunchingMessages.java | 61 + .../jsdt/launching/LaunchingMessages.properties | 42 + .../wst/jsdt/launching/LibraryLocation.java | 164 + .../eclipse/wst/jsdt/launching/ListenerList.java | 142 + .../wst/jsdt/launching/PropertyChangeEvent.java | 107 + .../org/eclipse/wst/jsdt/launching/StandardVM.java | 68 + .../eclipse/wst/jsdt/launching/StandardVMType.java | 633 ++ .../wst/jsdt/launching/VMRunnerConfiguration.java | 269 + .../org/eclipse/wst/jsdt/launching/VMStandin.java | 146 + .../libraries/BasicBrowserLibraryContainer.java | 115 + ...erLibraryJsGlobalScopeContainerInitializer.java | 119 + .../org/eclipse/wst/jsdt/libraries/Messages.java | 30 + .../eclipse/wst/jsdt/libraries/messages.properties | 13 + org.eclipse.wst.jsdt.feature/.project | 17 + .../.settings/org.eclipse.core.resources.prefs | 3 + .../.settings/org.eclipse.core.runtime.prefs | 3 + .../.settings/org.eclipse.jdt.core.prefs | 80 + .../.settings/org.eclipse.jdt.ui.prefs | 4 + .../org.eclipse.ltk.core.refactoring.prefs | 3 + .../.settings/org.eclipse.pde.prefs | 16 + org.eclipse.wst.jsdt.feature/build.properties | 2 + org.eclipse.wst.jsdt.feature/feature.properties | 51 + org.eclipse.wst.jsdt.feature/feature.xml | 117 + .../sourceTemplateBundle/about.html | 27 + .../sourceTemplateBundle/about.ini | 31 + .../sourceTemplateBundle/about.mappings | 6 + .../sourceTemplateBundle/about.properties | 26 + .../sourceTemplateBundle/build.properties | 3 + .../sourceTemplateBundle/plugin.properties | 12 + .../sourceTemplateBundle/wtp_prod32.gif | Bin 0 -> 1752 bytes .../sourceTemplateBundle/wtp_prod32.png | Bin 0 -> 2672 bytes .../sourceTemplateFeature/build.properties | 16 + .../sourceTemplateFeature/eclipse_update_120.jpg | Bin 0 -> 21695 bytes .../sourceTemplateFeature/feature.properties | 42 + .../sourceTemplatePlugin/about.html | 27 + .../sourceTemplatePlugin/about.ini | 31 + .../sourceTemplatePlugin/about.mappings | 6 + .../sourceTemplatePlugin/about.properties | 26 + .../sourceTemplatePlugin/build.properties | 3 + .../sourceTemplatePlugin/plugin.properties | 12 + .../sourceTemplatePlugin/wtp_prod32.gif | Bin 0 -> 1752 bytes .../sourceTemplatePlugin/wtp_prod32.png | Bin 0 -> 2672 bytes org.eclipse.wst.jsdt.ui/.classpath | 7 + org.eclipse.wst.jsdt.ui/.options | 1 + org.eclipse.wst.jsdt.ui/.project | 28 + .../.settings/org.eclipse.core.resources.prefs | 3 + .../.settings/org.eclipse.core.runtime.prefs | 3 + .../.settings/org.eclipse.jdt.core.prefs | 110 + .../.settings/org.eclipse.jdt.launching.prefs | 2 + .../.settings/org.eclipse.jdt.ui.prefs | 51 + .../org.eclipse.ltk.core.refactoring.prefs | 3 + .../.settings/org.eclipse.pde.prefs | 28 + org.eclipse.wst.jsdt.ui/JavadocHoverStyleSheet.css | 1 + org.eclipse.wst.jsdt.ui/JavadocViewStyleSheet.css | 33 + org.eclipse.wst.jsdt.ui/META-INF/MANIFEST.MF | 135 + org.eclipse.wst.jsdt.ui/about.html | 87 + org.eclipse.wst.jsdt.ui/about.ini | 12 + org.eclipse.wst.jsdt.ui/about.mappings | 6 + org.eclipse.wst.jsdt.ui/about.properties | 24 + org.eclipse.wst.jsdt.ui/build.properties | 27 + org.eclipse.wst.jsdt.ui/icons/WTP_icon_x32_v2.png | Bin 0 -> 5616 bytes .../icons/full/dlcl16/add_as_source_folder.gif | Bin 0 -> 356 bytes .../icons/full/dlcl16/add_exc.gif | Bin 0 -> 205 bytes .../full/dlcl16/add_linked_source_to_buildpath.gif | Bin 0 -> 336 bytes .../icons/full/dlcl16/add_to_buildpath.gif | Bin 0 -> 217 bytes .../icons/full/dlcl16/alphab_sort_co.gif | Bin 0 -> 157 bytes .../icons/full/dlcl16/category_menu.gif | Bin 0 -> 354 bytes .../icons/full/dlcl16/ch_callees.gif | Bin 0 -> 147 bytes .../icons/full/dlcl16/ch_callers.gif | Bin 0 -> 145 bytes .../icons/full/dlcl16/ch_cancel.gif | Bin 0 -> 152 bytes .../icons/full/dlcl16/class_obj.gif | Bin 0 -> 359 bytes .../icons/full/dlcl16/clear_co.gif | Bin 0 -> 364 bytes .../icons/full/dlcl16/collapseall.gif | Bin 0 -> 155 bytes .../icons/full/dlcl16/configure_build_path.gif | Bin 0 -> 343 bytes .../full/dlcl16/configure_buildpath_filters.gif | Bin 0 -> 222 bytes .../icons/full/dlcl16/configure_output_folder.gif | Bin 0 -> 364 bytes .../icons/full/dlcl16/cpyqual_menu.gif | Bin 0 -> 353 bytes .../icons/full/dlcl16/default_co.gif | Bin 0 -> 124 bytes .../icons/full/dlcl16/definingtype_sort_co.gif | Bin 0 -> 220 bytes .../icons/full/dlcl16/exc_catch.gif | Bin 0 -> 204 bytes .../icons/full/dlcl16/exclude_from_buildpath.gif | Bin 0 -> 145 bytes .../icons/full/dlcl16/exclusion_filter_attrib.gif | Bin 0 -> 892 bytes .../icons/full/dlcl16/fields_co.gif | Bin 0 -> 350 bytes .../icons/full/dlcl16/file_mode.gif | Bin 0 -> 234 bytes .../icons/full/dlcl16/filter_ps.gif | Bin 0 -> 155 bytes .../icons/full/dlcl16/flatLayout.gif | Bin 0 -> 97 bytes .../icons/full/dlcl16/gointo_toplevel_type.gif | Bin 0 -> 315 bytes .../icons/full/dlcl16/goto_input.gif | Bin 0 -> 235 bytes .../icons/full/dlcl16/hide_externalized.gif | Bin 0 -> 374 bytes .../icons/full/dlcl16/hide_ignored.gif | Bin 0 -> 360 bytes .../icons/full/dlcl16/hide_internalized.gif | Bin 0 -> 373 bytes .../icons/full/dlcl16/hierarchicalLayout.gif | Bin 0 -> 101 bytes .../icons/full/dlcl16/hierarchy_co.gif | Bin 0 -> 199 bytes .../icons/full/dlcl16/history_list.gif | Bin 0 -> 225 bytes .../icons/full/dlcl16/impl_co.gif | Bin 0 -> 143 bytes .../icons/full/dlcl16/include_on_buildpath.gif | Bin 0 -> 210 bytes .../icons/full/dlcl16/inclusion_filter_attrib.gif | Bin 0 -> 899 bytes .../icons/full/dlcl16/inher_co.gif | Bin 0 -> 199 bytes .../icons/full/dlcl16/javaassist_co.gif | Bin 0 -> 211 bytes .../icons/full/dlcl16/jtypeassist_co.gif | Bin 0 -> 224 bytes .../icons/full/dlcl16/localtypes_co.gif | Bin 0 -> 138 bytes .../icons/full/dlcl16/metharg_obj.gif | Bin 0 -> 223 bytes .../icons/full/dlcl16/newpackfolder_wiz.gif | Bin 0 -> 350 bytes .../icons/full/dlcl16/output_folder_attrib.gif | Bin 0 -> 905 bytes .../icons/full/dlcl16/pack_empty_co.gif | Bin 0 -> 151 bytes .../icons/full/dlcl16/package_mode.gif | Bin 0 -> 166 bytes .../icons/full/dlcl16/private_co.gif | Bin 0 -> 128 bytes .../icons/full/dlcl16/prj_mode.gif | Bin 0 -> 339 bytes .../icons/full/dlcl16/protected_co.gif | Bin 0 -> 182 bytes .../icons/full/dlcl16/public_co.gif | Bin 0 -> 193 bytes .../icons/full/dlcl16/refresh_nav.gif | Bin 0 -> 211 bytes .../icons/full/dlcl16/remove_as_source_folder.gif | Bin 0 -> 359 bytes .../icons/full/dlcl16/remove_exc.gif | Bin 0 -> 159 bytes .../icons/full/dlcl16/remove_from_buildpath.gif | Bin 0 -> 152 bytes .../icons/full/dlcl16/removea_exc.gif | Bin 0 -> 187 bytes .../icons/full/dlcl16/search_sortmatch.gif | Bin 0 -> 206 bytes .../icons/full/dlcl16/smartmode_co.gif | Bin 0 -> 330 bytes .../icons/full/dlcl16/static_co.gif | Bin 0 -> 140 bytes .../icons/full/dlcl16/sub_co.gif | Bin 0 -> 209 bytes .../icons/full/dlcl16/super_co.gif | Bin 0 -> 206 bytes .../icons/full/dlcl16/synced.gif | Bin 0 -> 149 bytes .../icons/full/dlcl16/templateprop_co.gif | Bin 0 -> 224 bytes .../icons/full/dlcl16/th_automatic.gif | Bin 0 -> 338 bytes .../icons/full/dlcl16/th_horizontal.gif | Bin 0 -> 245 bytes .../icons/full/dlcl16/th_showqualified.gif | Bin 0 -> 156 bytes .../icons/full/dlcl16/th_single.gif | Bin 0 -> 222 bytes .../icons/full/dlcl16/th_vertical.gif | Bin 0 -> 222 bytes .../icons/full/dlcl16/type_mode.gif | Bin 0 -> 230 bytes .../icons/full/dlcl16/view_menu.gif | Bin 0 -> 89 bytes .../icons/full/dlcl16/wordassist_co.gif | Bin 0 -> 141 bytes .../icons/full/dtool16/comment_edit.gif | Bin 0 -> 88 bytes .../icons/full/dtool16/exportapp_wiz.gif | Bin 0 -> 210 bytes .../icons/full/dtool16/exportjar_wiz.gif | Bin 0 -> 338 bytes .../icons/full/dtool16/importjar_wiz.gif | Bin 0 -> 336 bytes .../icons/full/dtool16/java_app.gif | Bin 0 -> 339 bytes .../icons/full/dtool16/java_attach.gif | Bin 0 -> 362 bytes .../icons/full/dtool16/javadoc.gif | Bin 0 -> 358 bytes .../icons/full/dtool16/jdoc_hover_edit.gif | Bin 0 -> 348 bytes .../icons/full/dtool16/mark_occurrences.gif | Bin 0 -> 208 bytes .../icons/full/dtool16/newannotation_wiz.gif | Bin 0 -> 354 bytes .../icons/full/dtool16/newclass_wiz.gif | Bin 0 -> 571 bytes .../icons/full/dtool16/newenum_wiz.gif | Bin 0 -> 353 bytes .../icons/full/dtool16/newint_wiz.gif | Bin 0 -> 361 bytes .../icons/full/dtool16/newjprj_wiz.gif | Bin 0 -> 369 bytes .../icons/full/dtool16/newjworkingSet_wiz.gif | Bin 0 -> 342 bytes .../icons/full/dtool16/newpack_wiz.gif | Bin 0 -> 230 bytes .../icons/full/dtool16/newpackfolder_wiz.gif | Bin 0 -> 350 bytes .../icons/full/dtool16/newsbook_wiz.gif | Bin 0 -> 235 bytes .../icons/full/dtool16/opentype.gif | Bin 0 -> 947 bytes .../icons/full/dtool16/segment_edit.gif | Bin 0 -> 232 bytes .../icons/full/dtool16/shift_l_edit.gif | Bin 0 -> 145 bytes .../icons/full/dtool16/shift_r_edit.gif | Bin 0 -> 145 bytes .../icons/full/elcl16/add_as_source_folder.gif | Bin 0 -> 370 bytes .../icons/full/elcl16/add_exc.gif | Bin 0 -> 318 bytes .../full/elcl16/add_linked_source_to_buildpath.gif | Bin 0 -> 570 bytes .../icons/full/elcl16/add_to_buildpath.gif | Bin 0 -> 341 bytes .../icons/full/elcl16/alphab_sort_co.gif | Bin 0 -> 153 bytes .../icons/full/elcl16/category_menu.gif | Bin 0 -> 588 bytes .../icons/full/elcl16/ch_callees.gif | Bin 0 -> 209 bytes .../icons/full/elcl16/ch_callers.gif | Bin 0 -> 205 bytes .../icons/full/elcl16/ch_cancel.gif | Bin 0 -> 215 bytes .../icons/full/elcl16/class_obj.gif | Bin 0 -> 585 bytes .../icons/full/elcl16/clear_co.gif | Bin 0 -> 595 bytes .../icons/full/elcl16/collapseall.gif | Bin 0 -> 157 bytes .../icons/full/elcl16/configure_build_path.gif | Bin 0 -> 358 bytes .../full/elcl16/configure_buildpath_filters.gif | Bin 0 -> 361 bytes .../icons/full/elcl16/configure_output_folder.gif | Bin 0 -> 384 bytes .../icons/full/elcl16/cpyqual_menu.gif | Bin 0 -> 378 bytes .../icons/full/elcl16/default_co.gif | Bin 0 -> 176 bytes .../icons/full/elcl16/definingtype_sort_co.gif | Bin 0 -> 323 bytes .../icons/full/elcl16/exc_catch.gif | Bin 0 -> 204 bytes .../icons/full/elcl16/exclude_from_buildpath.gif | Bin 0 -> 215 bytes .../icons/full/elcl16/exclusion_filter_attrib.gif | Bin 0 -> 914 bytes .../icons/full/elcl16/fields_co.gif | Bin 0 -> 554 bytes .../icons/full/elcl16/file_mode.gif | Bin 0 -> 368 bytes .../icons/full/elcl16/filter_ps.gif | Bin 0 -> 219 bytes .../icons/full/elcl16/flatLayout.gif | Bin 0 -> 97 bytes .../icons/full/elcl16/gointo_toplevel_type.gif | Bin 0 -> 530 bytes .../icons/full/elcl16/goto_input.gif | Bin 0 -> 372 bytes org.eclipse.wst.jsdt.ui/icons/full/elcl16/help.gif | Bin 0 -> 259 bytes .../icons/full/elcl16/hide_externalized.gif | Bin 0 -> 600 bytes .../icons/full/elcl16/hide_ignored.gif | Bin 0 -> 578 bytes .../icons/full/elcl16/hide_internalized.gif | Bin 0 -> 598 bytes .../icons/full/elcl16/hierarchicalLayout.gif | Bin 0 -> 101 bytes .../icons/full/elcl16/hierarchy_co.gif | Bin 0 -> 199 bytes .../icons/full/elcl16/history_list.gif | Bin 0 -> 586 bytes .../icons/full/elcl16/impl_co.gif | Bin 0 -> 145 bytes .../icons/full/elcl16/include_on_buildpath.gif | Bin 0 -> 229 bytes .../icons/full/elcl16/inclusion_filter_attrib.gif | Bin 0 -> 920 bytes .../icons/full/elcl16/inher_co.gif | Bin 0 -> 200 bytes .../icons/full/elcl16/javaassist_co.gif | Bin 0 -> 344 bytes .../icons/full/elcl16/jtypeassist_co.gif | Bin 0 -> 362 bytes .../icons/full/elcl16/localtypes_co.gif | Bin 0 -> 204 bytes .../icons/full/elcl16/metharg_obj.gif | Bin 0 -> 371 bytes .../icons/full/elcl16/pack_empty_co.gif | Bin 0 -> 212 bytes .../icons/full/elcl16/package_mode.gif | Bin 0 -> 249 bytes .../icons/full/elcl16/private_co.gif | Bin 0 -> 183 bytes .../icons/full/elcl16/prj_mode.gif | Bin 0 -> 363 bytes .../icons/full/elcl16/protected_co.gif | Bin 0 -> 182 bytes .../icons/full/elcl16/public_co.gif | Bin 0 -> 194 bytes .../icons/full/elcl16/refresh_nav.gif | Bin 0 -> 327 bytes .../icons/full/elcl16/remove_as_source_folder.gif | Bin 0 -> 374 bytes .../icons/full/elcl16/remove_exc.gif | Bin 0 -> 163 bytes .../icons/full/elcl16/remove_from_buildpath.gif | Bin 0 -> 216 bytes .../icons/full/elcl16/removea_exc.gif | Bin 0 -> 204 bytes .../icons/full/elcl16/search_sortmatch.gif | Bin 0 -> 330 bytes .../icons/full/elcl16/smartmode_co.gif | Bin 0 -> 553 bytes .../icons/full/elcl16/static_co.gif | Bin 0 -> 213 bytes .../icons/full/elcl16/sub_co.gif | Bin 0 -> 209 bytes .../icons/full/elcl16/super_co.gif | Bin 0 -> 208 bytes .../icons/full/elcl16/synced.gif | Bin 0 -> 160 bytes .../icons/full/elcl16/templateprop_co.gif | Bin 0 -> 359 bytes .../icons/full/elcl16/th_automatic.gif | Bin 0 -> 358 bytes .../icons/full/elcl16/th_horizontal.gif | Bin 0 -> 374 bytes .../icons/full/elcl16/th_showqualified.gif | Bin 0 -> 222 bytes .../icons/full/elcl16/th_single.gif | Bin 0 -> 370 bytes .../icons/full/elcl16/th_vertical.gif | Bin 0 -> 352 bytes .../icons/full/elcl16/type_mode.gif | Bin 0 -> 387 bytes .../icons/full/elcl16/view_menu.gif | Bin 0 -> 90 bytes .../icons/full/elcl16/wordassist_co.gif | Bin 0 -> 152 bytes .../icons/full/etool16/comment_edit.gif | Bin 0 -> 111 bytes .../icons/full/etool16/exportapp_wiz.gif | Bin 0 -> 349 bytes .../icons/full/etool16/exportjar_wiz.gif | Bin 0 -> 581 bytes .../icons/full/etool16/importjar_wiz.gif | Bin 0 -> 580 bytes .../icons/full/etool16/java_app.gif | Bin 0 -> 590 bytes .../icons/full/etool16/java_attach.gif | Bin 0 -> 604 bytes .../icons/full/etool16/javadoc.gif | Bin 0 -> 586 bytes .../icons/full/etool16/jdoc_hover_edit.gif | Bin 0 -> 588 bytes .../icons/full/etool16/mark_occurrences.gif | Bin 0 -> 321 bytes .../icons/full/etool16/newannotation_wiz.gif | Bin 0 -> 371 bytes .../icons/full/etool16/newclass_wiz.gif | Bin 0 -> 598 bytes .../icons/full/etool16/newenum_wiz.gif | Bin 0 -> 580 bytes .../icons/full/etool16/newint_wiz.gif | Bin 0 -> 588 bytes .../icons/full/etool16/newjprj_wiz.gif | Bin 0 -> 382 bytes .../icons/full/etool16/newjscript_wiz.gif | Bin 0 -> 581 bytes .../icons/full/etool16/newjworkingSet_wiz.gif | Bin 0 -> 590 bytes .../icons/full/etool16/newpack_wiz.gif | Bin 0 -> 337 bytes .../icons/full/etool16/newpackfolder_wiz.gif | Bin 0 -> 356 bytes .../icons/full/etool16/newsbook_wiz.gif | Bin 0 -> 588 bytes .../icons/full/etool16/opentype.gif | Bin 0 -> 944 bytes .../icons/full/etool16/segment_edit.gif | Bin 0 -> 585 bytes .../icons/full/etool16/shift_l_edit.gif | Bin 0 -> 323 bytes .../icons/full/etool16/shift_r_edit.gif | Bin 0 -> 328 bytes .../icons/full/eview16/browse_persp.gif | Bin 0 -> 613 bytes .../icons/full/eview16/call_hierarchy.gif | Bin 0 -> 209 bytes .../icons/full/eview16/class_hi.gif | Bin 0 -> 200 bytes .../icons/full/eview16/classfilegeneration_tab.gif | Bin 0 -> 364 bytes .../icons/full/eview16/errorwarning_tab.gif | Bin 0 -> 577 bytes .../icons/full/eview16/hierch_persp.gif | Bin 0 -> 223 bytes .../icons/full/eview16/javadoc.gif | Bin 0 -> 323 bytes .../icons/full/eview16/jdkcompliance_tab.gif | Bin 0 -> 367 bytes .../icons/full/eview16/jperspective.gif | Bin 0 -> 376 bytes .../icons/full/eview16/members.gif | Bin 0 -> 344 bytes .../icons/full/eview16/package.gif | Bin 0 -> 145 bytes .../icons/full/eview16/packages.gif | Bin 0 -> 360 bytes .../icons/full/eview16/projects.gif | Bin 0 -> 365 bytes .../icons/full/eview16/source.gif | Bin 0 -> 583 bytes .../icons/full/eview16/types.gif | Bin 0 -> 364 bytes .../icons/full/obj16/access_restriction_attrib.gif | Bin 0 -> 365 bytes .../icons/full/obj16/add_correction.gif | Bin 0 -> 299 bytes .../icons/full/obj16/annotation_alt_obj.gif | Bin 0 -> 242 bytes .../icons/full/obj16/annotation_default_obj.gif | Bin 0 -> 375 bytes .../icons/full/obj16/annotation_obj.gif | Bin 0 -> 350 bytes .../icons/full/obj16/annotation_private_obj.gif | Bin 0 -> 376 bytes .../icons/full/obj16/annotation_protected_obj.gif | Bin 0 -> 376 bytes .../icons/full/obj16/brkpi_obj.gif | Bin 0 -> 111 bytes .../icons/full/obj16/change.gif | Bin 0 -> 321 bytes .../icons/full/obj16/class_default_obj.gif | Bin 0 -> 604 bytes .../icons/full/obj16/class_obj.gif | Bin 0 -> 586 bytes .../icons/full/obj16/classf_generate.gif | Bin 0 -> 365 bytes .../icons/full/obj16/classf_obj.gif | Bin 0 -> 373 bytes .../icons/full/obj16/classfo_obj.gif | Bin 0 -> 260 bytes .../icons/full/obj16/compare_field.gif | Bin 0 -> 178 bytes .../icons/full/obj16/compare_method.gif | Bin 0 -> 193 bytes .../icons/full/obj16/correction_cast.gif | Bin 0 -> 235 bytes .../icons/full/obj16/correction_change.gif | Bin 0 -> 136 bytes .../icons/full/obj16/correction_delete_import.gif | Bin 0 -> 186 bytes .../icons/full/obj16/correction_linked_rename.gif | Bin 0 -> 208 bytes .../icons/full/obj16/correction_move.gif | Bin 0 -> 560 bytes .../icons/full/obj16/correction_rename.gif | Bin 0 -> 136 bytes .../icons/full/obj16/cp_order_obj.gif | Bin 0 -> 326 bytes .../icons/full/obj16/cu_obj.gif | Bin 0 -> 570 bytes .../icons/full/obj16/empty_logical_package_obj.gif | Bin 0 -> 232 bytes .../icons/full/obj16/empty_pack_fldr_obj.gif | Bin 0 -> 334 bytes .../icons/full/obj16/empty_pack_obj.gif | Bin 0 -> 212 bytes .../icons/full/obj16/enum_alt_obj.gif | Bin 0 -> 250 bytes .../icons/full/obj16/enum_default_obj.gif | Bin 0 -> 587 bytes .../icons/full/obj16/enum_obj.gif | Bin 0 -> 361 bytes .../icons/full/obj16/enum_private_obj.gif | Bin 0 -> 590 bytes .../icons/full/obj16/enum_protected_obj.gif | Bin 0 -> 586 bytes .../icons/full/obj16/envvar_obj.gif | Bin 0 -> 206 bytes .../icons/full/obj16/error_obj.gif | Bin 0 -> 339 bytes .../icons/full/obj16/exclusion_filter_attrib.gif | Bin 0 -> 214 bytes .../icons/full/obj16/externalize.gif | Bin 0 -> 601 bytes .../icons/full/obj16/fatalerror_obj.gif | Bin 0 -> 333 bytes .../icons/full/obj16/field_default_obj.gif | Bin 0 -> 118 bytes .../icons/full/obj16/field_private_obj.gif | Bin 0 -> 87 bytes .../icons/full/obj16/field_protected_obj.gif | Bin 0 -> 119 bytes .../icons/full/obj16/field_public_obj.gif | Bin 0 -> 124 bytes .../icons/full/obj16/file_obj.gif | Bin 0 -> 561 bytes .../icons/full/obj16/history_working_set_obj.gif | Bin 0 -> 594 bytes .../icons/full/obj16/html_tag_obj.gif | Bin 0 -> 82 bytes .../icons/full/obj16/ignore.gif | Bin 0 -> 374 bytes .../icons/full/obj16/imp_obj.gif | Bin 0 -> 114 bytes .../icons/full/obj16/impc_obj.gif | Bin 0 -> 185 bytes .../icons/full/obj16/implm_co.gif | Bin 0 -> 104 bytes .../icons/full/obj16/inclusion_filter_attrib.gif | Bin 0 -> 229 bytes .../icons/full/obj16/info_obj.gif | Bin 0 -> 121 bytes .../icons/full/obj16/innerclass_default_obj.gif | Bin 0 -> 604 bytes .../icons/full/obj16/innerclass_private_obj.gif | Bin 0 -> 603 bytes .../icons/full/obj16/innerclass_protected_obj.gif | Bin 0 -> 600 bytes .../icons/full/obj16/innerclass_public_obj.gif | Bin 0 -> 586 bytes .../full/obj16/innerinterface_default_obj.gif | Bin 0 -> 595 bytes .../full/obj16/innerinterface_private_obj.gif | Bin 0 -> 594 bytes .../full/obj16/innerinterface_protected_obj.gif | Bin 0 -> 592 bytes .../icons/full/obj16/innerinterface_public_obj.gif | Bin 0 -> 574 bytes .../icons/full/obj16/int_default_obj.gif | Bin 0 -> 595 bytes .../icons/full/obj16/int_obj.gif | Bin 0 -> 574 bytes .../icons/full/obj16/internalize.gif | Bin 0 -> 599 bytes .../icons/full/obj16/intf_obj.gif | Bin 0 -> 242 bytes .../icons/full/obj16/jar_desc_obj.gif | Bin 0 -> 618 bytes .../icons/full/obj16/jar_l_obj.gif | Bin 0 -> 581 bytes .../icons/full/obj16/jar_lsrc_obj.gif | Bin 0 -> 589 bytes .../icons/full/obj16/jar_obj.gif | Bin 0 -> 587 bytes .../icons/full/obj16/jar_src_obj.gif | Bin 0 -> 596 bytes .../icons/full/obj16/java_model_obj.gif | Bin 0 -> 208 bytes .../icons/full/obj16/javadoc_location_attrib.gif | Bin 0 -> 596 bytes .../icons/full/obj16/jcu_obj.gif | Bin 0 -> 345 bytes .../icons/full/obj16/jcu_resource_obj.gif | Bin 0 -> 345 bytes .../icons/full/obj16/jdoc_tag_obj.gif | Bin 0 -> 323 bytes .../icons/full/obj16/jexception_obj.gif | Bin 0 -> 205 bytes .../icons/full/obj16/jexceptiond_obj.gif | Bin 0 -> 209 bytes .../icons/full/obj16/jrtexception_obj.gif | Bin 0 -> 207 bytes .../icons/full/obj16/jsbook_obj.gif | Bin 0 -> 374 bytes .../icons/full/obj16/jsearch_obj.gif | Bin 0 -> 383 bytes .../icons/full/obj16/jworkingSet_obj.gif | Bin 0 -> 228 bytes .../icons/full/obj16/library_obj.gif | Bin 0 -> 338 bytes .../icons/full/obj16/localvariable_obj.gif | Bin 0 -> 152 bytes .../icons/full/obj16/logical_package_obj.gif | Bin 0 -> 359 bytes .../icons/full/obj16/methdef_obj.gif | Bin 0 -> 176 bytes .../icons/full/obj16/methpri_obj.gif | Bin 0 -> 183 bytes .../icons/full/obj16/methpro_obj.gif | Bin 0 -> 181 bytes .../icons/full/obj16/methpub_obj.gif | Bin 0 -> 193 bytes .../icons/full/obj16/native_lib_path_attrib.gif | Bin 0 -> 366 bytes .../icons/full/obj16/never_translate.gif | Bin 0 -> 159 bytes .../icons/full/obj16/nls_search_obj.gif | Bin 0 -> 596 bytes .../icons/full/obj16/no_breakpoint.gif | Bin 0 -> 204 bytes .../icons/full/obj16/occ_match.gif | Bin 0 -> 145 bytes .../icons/full/obj16/occ_read.gif | Bin 0 -> 229 bytes .../icons/full/obj16/occ_write.gif | Bin 0 -> 218 bytes .../icons/full/obj16/output_folder_attrib.gif | Bin 0 -> 348 bytes .../icons/full/obj16/over_co.gif | Bin 0 -> 131 bytes .../icons/full/obj16/package_obj.gif | Bin 0 -> 244 bytes .../icons/full/obj16/packagefolder_obj.gif | Bin 0 -> 226 bytes .../icons/full/obj16/packd_obj.gif | Bin 0 -> 222 bytes .../icons/full/obj16/quickassist_obj.gif | Bin 0 -> 225 bytes .../icons/full/obj16/quickfix_error_obj.gif | Bin 0 -> 348 bytes .../icons/full/obj16/quickfix_warning_obj.gif | Bin 0 -> 559 bytes .../icons/full/obj16/remove_correction.gif | Bin 0 -> 120 bytes .../icons/full/obj16/search_decl_obj.gif | Bin 0 -> 361 bytes .../icons/full/obj16/search_ref_obj.gif | Bin 0 -> 356 bytes .../icons/full/obj16/searchm_obj.gif | Bin 0 -> 200 bytes .../icons/full/obj16/settings_obj.gif | Bin 0 -> 343 bytes org.eclipse.wst.jsdt.ui/icons/full/obj16/skip.gif | Bin 0 -> 159 bytes .../icons/full/obj16/source_attach_attrib.gif | Bin 0 -> 582 bytes .../icons/full/obj16/template_obj.gif | Bin 0 -> 359 bytes .../icons/full/obj16/translate.gif | Bin 0 -> 343 bytes .../icons/full/obj16/type_separator.gif | Bin 0 -> 85 bytes .../icons/full/obj16/typevariable_obj.gif | Bin 0 -> 208 bytes .../icons/full/obj16/unknown_obj.gif | Bin 0 -> 368 bytes .../icons/full/obj16/warning_obj.gif | Bin 0 -> 324 bytes .../icons/full/ovr16/abstract_co.gif | Bin 0 -> 79 bytes .../icons/full/ovr16/annotation_tsk.gif | Bin 0 -> 63 bytes .../icons/full/ovr16/callee_co.gif | Bin 0 -> 110 bytes .../icons/full/ovr16/caller_co.gif | Bin 0 -> 110 bytes .../icons/full/ovr16/class_abs_tsk.gif | Bin 0 -> 63 bytes .../icons/full/ovr16/class_tsk.gif | Bin 0 -> 64 bytes .../icons/full/ovr16/constr_ovr.gif | Bin 0 -> 81 bytes .../icons/full/ovr16/deprecated.gif | Bin 0 -> 78 bytes .../icons/full/ovr16/enum_tsk.gif | Bin 0 -> 65 bytes .../icons/full/ovr16/error_co.gif | Bin 0 -> 82 bytes .../icons/full/ovr16/final_co.gif | Bin 0 -> 64 bytes .../icons/full/ovr16/focus_ovr.gif | Bin 0 -> 75 bytes .../icons/full/ovr16/implm_co.gif | Bin 0 -> 63 bytes .../icons/full/ovr16/interface_tsk.gif | Bin 0 -> 65 bytes .../icons/full/ovr16/java_ovr.gif | Bin 0 -> 54 bytes .../icons/full/ovr16/maxlevel_co.gif | Bin 0 -> 82 bytes .../icons/full/ovr16/native_co.gif | Bin 0 -> 74 bytes .../icons/full/ovr16/over_co.gif | Bin 0 -> 79 bytes org.eclipse.wst.jsdt.ui/icons/full/ovr16/read.gif | Bin 0 -> 82 bytes .../icons/full/ovr16/recursive_co.gif | Bin 0 -> 108 bytes .../icons/full/ovr16/run_co.gif | Bin 0 -> 79 bytes .../icons/full/ovr16/static_co.gif | Bin 0 -> 62 bytes .../icons/full/ovr16/sync_impl.gif | Bin 0 -> 112 bytes .../icons/full/ovr16/sync_over.gif | Bin 0 -> 111 bytes .../icons/full/ovr16/synch_co.gif | Bin 0 -> 117 bytes .../icons/full/ovr16/transient_co.gif | Bin 0 -> 99 bytes .../icons/full/ovr16/volatile_co.gif | Bin 0 -> 75 bytes .../icons/full/ovr16/warning_co.gif | Bin 0 -> 173 bytes org.eclipse.wst.jsdt.ui/icons/full/ovr16/write.gif | Bin 0 -> 112 bytes .../icons/full/wizban/addlibrary_wiz.png | Bin 0 -> 8001 bytes .../icons/full/wizban/cleanup_wiz.png | Bin 0 -> 5416 bytes .../icons/full/wizban/coderefact_wiz.png | Bin 0 -> 7686 bytes .../icons/full/wizban/compunitrefact_wiz.png | Bin 0 -> 7572 bytes .../icons/full/wizban/export_javadoc_wiz.png | Bin 0 -> 6525 bytes .../icons/full/wizban/exportapp_wiz.png | Bin 0 -> 5207 bytes .../icons/full/wizban/extractsupertype_wiz.png | Bin 0 -> 4262 bytes .../icons/full/wizban/extstr_wiz.png | Bin 0 -> 6405 bytes .../icons/full/wizban/fieldrefact_wiz.png | Bin 0 -> 8469 bytes .../icons/full/wizban/fixdepr_wiz.png | Bin 0 -> 7277 bytes .../icons/full/wizban/jar_pack_wiz.png | Bin 0 -> 7469 bytes .../icons/full/wizban/java_app_wiz.png | Bin 0 -> 5277 bytes .../icons/full/wizban/java_attach_wiz.png | Bin 0 -> 5468 bytes .../icons/full/wizban/java_workingset_wiz.png | Bin 0 -> 8344 bytes .../icons/full/wizban/methrefact_wiz.png | Bin 0 -> 8538 bytes .../icons/full/wizban/newannotation_wiz.png | Bin 0 -> 6974 bytes .../icons/full/wizban/newclass_wiz.png | Bin 0 -> 7824 bytes .../icons/full/wizban/newenum_wiz.png | Bin 0 -> 7276 bytes .../icons/full/wizban/newint_wiz.png | Bin 0 -> 7173 bytes .../icons/full/wizban/newjprj_wiz.png | Bin 0 -> 6287 bytes .../icons/full/wizban/newjscriptfile_wiz.png | Bin 0 -> 5728 bytes .../icons/full/wizban/newpack_wiz.png | Bin 0 -> 6523 bytes .../icons/full/wizban/newsbook_wiz.png | Bin 0 -> 6507 bytes .../icons/full/wizban/newsrcfldr_wiz.png | Bin 0 -> 6683 bytes .../icons/full/wizban/packrefact_wiz.png | Bin 0 -> 8541 bytes .../icons/full/wizban/pullup_wiz.png | Bin 0 -> 6002 bytes .../icons/full/wizban/refactor_wiz.png | Bin 0 -> 7443 bytes .../icons/full/wizban/replacejar_wiz.png | Bin 0 -> 8624 bytes .../icons/full/wizban/typerefact_wiz.png | Bin 0 -> 8536 bytes org.eclipse.wst.jsdt.ui/plugin.properties | 1026 +++ org.eclipse.wst.jsdt.ui/plugin.xml | 6047 ++++++++++++++++ .../schema/DocumentationProvider.exsd | 102 + .../schema/JsGlobalScopeContainerPage.exsd | 127 + .../schema/JsGlobalScopeUIInitializer.exsd | 104 + .../schema/classpathAttributeConfiguration.exsd | 128 + .../schema/foldingStructureProviders.exsd | 142 + .../schema/javaCompletionProposalComputer.exsd | 209 + .../schema/javaCompletionProposalSorters.exsd | 149 + .../schema/javaEditorTextHovers.exsd | 143 + .../schema/javaElementFilters.exsd | 168 + .../schema/javadocCompletionProcessor.exsd | 137 + .../schema/queryParticipants.exsd | 144 + .../schema/quickAssistProcessors.exsd | 165 + .../schema/quickFixProcessors.exsd | 201 + .../eclipse/wst/jsdt/internal/corext/Corext.java | 27 + .../wst/jsdt/internal/corext/CorextMessages.java | 48 + .../jsdt/internal/corext/CorextMessages.properties | 24 + .../wst/jsdt/internal/corext/SourceRange.java | 125 + .../internal/corext/ValidateEditException.java | 29 + .../internal/corext/buildpath/BuildpathDelta.java | 86 + .../internal/corext/buildpath/CPJavaProject.java | 80 + .../corext/buildpath/ClasspathModifier.java | 1067 +++ .../buildpath/IBuildpathModifierListener.java | 22 + .../corext/callhierarchy/CallHierarchy.java | 229 + .../callhierarchy/CallHierarchyMessages.java | 35 + .../callhierarchy/CallHierarchyMessages.properties | 13 + .../corext/callhierarchy/CallHierarchyVisitor.java | 30 + .../corext/callhierarchy/CallLocation.java | 136 + .../callhierarchy/CallSearchResultCollector.java | 82 + .../callhierarchy/CalleeAnalyzerVisitor.java | 313 + .../corext/callhierarchy/CalleeMethodWrapper.java | 108 + .../corext/callhierarchy/CallerMethodWrapper.java | 116 + .../corext/callhierarchy/IImplementorFinder.java | 32 + .../corext/callhierarchy/Implementors.java | 52 + .../callhierarchy/JavaImplementorFinder.java | 50 + .../internal/corext/callhierarchy/MethodCall.java | 80 + .../MethodReferencesSearchRequestor.java | 63 + .../corext/callhierarchy/MethodWrapper.java | 320 + .../AddCustomConstructorOperation.java | 259 + .../AddDelegateMethodsOperation.java | 244 + .../codemanipulation/AddGetterSetterOperation.java | 357 + .../codemanipulation/AddImportsOperation.java | 406 ++ .../codemanipulation/AddJavaDocStubOperation.java | 197 + .../AddUnimplementedConstructorsOperation.java | 285 + .../AddUnimplementedMethodsOperation.java | 244 + .../codemanipulation/CodeGenerationMessages.java | 46 + .../CodeGenerationMessages.properties | 28 + .../codemanipulation/CodeGenerationSettings.java | 49 + .../ContextSensitiveImportRewriteContext.java | 207 + .../corext/codemanipulation/GetterSetterUtil.java | 215 + .../corext/codemanipulation/IRequestQuery.java | 35 + .../ImportReferencesCollector.java | 395 + .../codemanipulation/OrganizeImportsOperation.java | 546 ++ .../codemanipulation/SortMembersOperation.java | 258 + .../corext/codemanipulation/StubUtility.java | 1474 ++++ .../corext/codemanipulation/StubUtility2.java | 696 ++ .../wst/jsdt/internal/corext/dom/ASTFlattener.java | 1407 ++++ .../jsdt/internal/corext/dom/ASTNodeFactory.java | 200 + .../wst/jsdt/internal/corext/dom/ASTNodes.java | 805 +++ .../wst/jsdt/internal/corext/dom/Bindings.java | 1014 +++ .../corext/dom/BodyDeclarationRewrite.java | 49 + .../jsdt/internal/corext/dom/CodeScopeBuilder.java | 241 + .../jsdt/internal/corext/dom/GenericVisitor.java | 659 ++ .../corext/dom/HierarchicalASTVisitor.java | 789 ++ .../jsdt/internal/corext/dom/JdtASTMatcher.java | 54 + .../jsdt/internal/corext/dom/LinkedNodeFinder.java | 280 + .../internal/corext/dom/LocalVariableIndex.java | 90 + .../jsdt/internal/corext/dom/ModifierRewrite.java | 139 + .../wst/jsdt/internal/corext/dom/NodeFinder.java | 171 + .../jsdt/internal/corext/dom/ReplaceRewrite.java | 94 + .../jsdt/internal/corext/dom/ScopeAnalyzer.java | 787 ++ .../wst/jsdt/internal/corext/dom/Selection.java | 167 + .../internal/corext/dom/SelectionAnalyzer.java | 141 + .../jsdt/internal/corext/dom/StatementRewrite.java | 53 + .../wst/jsdt/internal/corext/dom/TokenScanner.java | 450 ++ .../internal/corext/dom/TypeBindingVisitor.java | 27 + .../wst/jsdt/internal/corext/dom/TypeRules.java | 207 + .../corext/dom/VariableDeclarationRewrite.java | 155 + .../internal/corext/dom/fragments/ASTFragment.java | 28 + .../corext/dom/fragments/ASTFragmentFactory.java | 192 + .../dom/fragments/ASTMatchingFragmentFinder.java | 54 + .../AssociativeInfixExpressionFragment.java | 437 ++ .../corext/dom/fragments/IASTFragment.java | 88 + .../corext/dom/fragments/IExpressionFragment.java | 42 + .../dom/fragments/SimpleExpressionFragment.java | 28 + .../corext/dom/fragments/SimpleFragment.java | 75 + .../jsdt/internal/corext/dom/fragments/Util.java | 63 + .../wst/jsdt/internal/corext/fix/AbstractFix.java | 140 + .../jsdt/internal/corext/fix/CleanUpConstants.java | 1246 ++++ .../corext/fix/CleanUpPostSaveListener.java | 379 + .../internal/corext/fix/CleanUpPreferenceUtil.java | 215 + .../internal/corext/fix/CleanUpRefactoring.java | 1057 +++ .../wst/jsdt/internal/corext/fix/CodeStyleFix.java | 705 ++ .../internal/corext/fix/ControlStatementsFix.java | 485 ++ .../corext/fix/ConvertForLoopOperation.java | 639 ++ .../corext/fix/ConvertIterableLoopOperation.java | 562 ++ .../jsdt/internal/corext/fix/ConvertLoopFix.java | 95 + .../internal/corext/fix/ConvertLoopOperation.java | 99 + .../jsdt/internal/corext/fix/ExpressionsFix.java | 377 + .../wst/jsdt/internal/corext/fix/FixMessages.java | 97 + .../internal/corext/fix/FixMessages.properties | 78 + .../eclipse/wst/jsdt/internal/corext/fix/IFix.java | 58 + .../internal/corext/fix/IFixRewriteOperation.java | 20 + .../corext/fix/ILinkedFixRewriteOperation.java | 20 + .../wst/jsdt/internal/corext/fix/ImportsFix.java | 99 + .../wst/jsdt/internal/corext/fix/LinkedFix.java | 84 + .../internal/corext/fix/LinkedProposalModel.java | 82 + .../corext/fix/LinkedProposalPositionGroup.java | 184 + .../jsdt/internal/corext/fix/SortMembersFix.java | 85 + .../wst/jsdt/internal/corext/fix/StringFix.java | 229 + .../jsdt/internal/corext/fix/UnusedCodeFix.java | 637 ++ .../corext/fix/VariableDeclarationFix.java | 535 ++ .../corext/javadoc/JavaDocCommentReader.java | 93 + .../internal/corext/javadoc/JavaDocLocations.java | 582 ++ .../AbstractJavaElementRenameChange.java | 89 + .../jsdt/internal/corext/refactoring/Checks.java | 829 +++ .../refactoring/CollectingSearchRequestor.java | 45 + .../refactoring/CuCollectingSearchRequestor.java | 69 + .../internal/corext/refactoring/ExceptionInfo.java | 91 + .../refactoring/IRefactoringSearchRequestor.java | 29 + .../refactoring/JDTRefactoringContribution.java | 44 + .../refactoring/JDTRefactoringDescriptor.java | 338 + .../JDTRefactoringDescriptorComment.java | 300 + .../refactoring/JavaRefactoringArguments.java | 99 + .../internal/corext/refactoring/ParameterInfo.java | 226 + .../refactoring/RefactoringAvailabilityTester.java | 1124 +++ .../refactoring/RefactoringCoreMessages.java | 2350 ++++++ .../refactoring/RefactoringElementFilter.java | 28 + .../refactoring/RefactoringExecutionStarter.java | 467 ++ .../refactoring/RefactoringScopeFactory.java | 272 + .../refactoring/RefactoringSearchEngine.java | 229 + .../refactoring/RefactoringSearchEngine2.java | 726 ++ .../corext/refactoring/ReturnTypeInfo.java | 56 + .../corext/refactoring/SearchResultGroup.java | 79 + .../corext/refactoring/StubTypeContext.java | 39 + .../corext/refactoring/TypeContextChecker.java | 753 ++ .../internal/corext/refactoring/TypedSource.java | 181 + .../corext/refactoring/base/JDTChange.java | 260 + .../corext/refactoring/base/JavaStatusContext.java | 272 + .../refactoring/base/JavaStringStatusContext.java | 54 + .../refactoring/base/RefactoringStatusCodes.java | 42 + .../binary/AbstractCodeCreationOperation.java | 182 + .../binary/SourceCreationOperation.java | 76 + .../refactoring/binary/StubCreationOperation.java | 95 + .../corext/refactoring/binary/StubCreator.java | 255 + .../refactoring/changes/AbstractDeleteChange.java | 56 + .../refactoring/changes/AddToClasspathChange.java | 128 + .../refactoring/changes/CompilationUnitChange.java | 132 + .../changes/CompilationUnitReorgChange.java | 104 + .../changes/CopyCompilationUnitChange.java | 47 + .../refactoring/changes/CopyPackageChange.java | 38 + .../changes/CopyPackageFragmentRootChange.java | 39 + .../refactoring/changes/CopyResourceChange.java | 47 + .../changes/CreateCompilationUnitChange.java | 41 + .../refactoring/changes/CreatePackageChange.java | 65 + .../refactoring/changes/DeleteFileChange.java | 81 + .../refactoring/changes/DeleteFolderChange.java | 95 + .../changes/DeleteFromClasspathChange.java | 108 + .../changes/DeletePackageFragmentRootChange.java | 170 + .../changes/DeleteSourceManipulationChange.java | 131 + .../DynamicValidationRefactoringChange.java | 68 + .../changes/DynamicValidationStateChange.java | 141 + .../changes/MoveCompilationUnitChange.java | 81 + .../refactoring/changes/MovePackageChange.java | 37 + .../changes/MovePackageFragmentRootChange.java | 38 + .../refactoring/changes/MoveResourceChange.java | 50 + .../changes/MultiStateCompilationUnitChange.java | 89 + .../changes/PackageFragmentRootReorgChange.java | 141 + .../refactoring/changes/PackageReorgChange.java | 89 + .../changes/RefactoringDescriptorChange.java | 66 + .../changes/RenameCompilationUnitChange.java | 62 + .../changes/RenameJavaProjectChange.java | 127 + .../refactoring/changes/RenamePackageChange.java | 199 + .../refactoring/changes/RenameResourceChange.java | 104 + .../changes/RenameSourceFolderChange.java | 114 + .../refactoring/changes/ResourceReorgChange.java | 153 + .../changes/TextChangeCompatibility.java | 102 + .../changes/UndoCompilationUnitChange.java | 78 + .../changes/UndoDeleteResourceChange.java | 80 + .../changes/UndoablePackageDeleteChange.java | 52 + .../internal/corext/refactoring/changes/Utils.java | 43 + .../refactoring/changes/WorkspaceTracker.java | 64 + .../refactoring/code/AstMatchingNodeFinder.java | 594 ++ .../corext/refactoring/code/CallContext.java | 49 + .../corext/refactoring/code/CallInliner.java | 833 +++ .../refactoring/code/CodeRefactoringUtil.java | 70 + .../corext/refactoring/code/ConstantChecks.java | 194 + .../code/ConvertAnonymousToNestedRefactoring.java | 1032 +++ .../corext/refactoring/code/ExceptionAnalyzer.java | 67 + .../code/ExtractConstantRefactoring.java | 831 +++ .../refactoring/code/ExtractMethodAnalyzer.java | 719 ++ .../refactoring/code/ExtractMethodRefactoring.java | 993 +++ .../refactoring/code/ExtractTempRefactoring.java | 1007 +++ .../code/InlineConstantRefactoring.java | 970 +++ .../refactoring/code/InlineMethodRefactoring.java | 566 ++ .../refactoring/code/InlineTempRefactoring.java | 437 ++ .../code/IntroduceFactoryRefactoring.java | 1238 ++++ .../code/IntroduceIndirectionRefactoring.java | 1275 ++++ .../code/IntroduceParameterRefactoring.java | 575 ++ .../corext/refactoring/code/Invocations.java | 102 + .../corext/refactoring/code/LocalTypeAnalyzer.java | 110 + .../corext/refactoring/code/NameCollector.java | 64 + .../refactoring/code/OperatorPrecedence.java | 101 + .../corext/refactoring/code/ParameterData.java | 105 + .../code/PromoteTempToFieldRefactoring.java | 929 +++ .../code/ReplaceInvocationsRefactoring.java | 554 ++ .../refactoring/code/ScriptableRefactoring.java | 121 + .../corext/refactoring/code/SnippetFinder.java | 221 + .../corext/refactoring/code/SourceAnalyzer.java | 465 ++ .../corext/refactoring/code/SourceProvider.java | 637 ++ .../corext/refactoring/code/TargetProvider.java | 431 ++ .../refactoring/code/TempAssignmentFinder.java | 92 + .../refactoring/code/flow/BlockFlowInfo.java | 19 + .../refactoring/code/flow/BranchFlowInfo.java | 26 + .../refactoring/code/flow/ConditionalFlowInfo.java | 45 + .../refactoring/code/flow/DoWhileFlowInfo.java | 37 + .../refactoring/code/flow/EnhancedForFlowInfo.java | 36 + .../corext/refactoring/code/flow/FlowAnalyzer.java | 889 +++ .../corext/refactoring/code/flow/FlowContext.java | 147 + .../corext/refactoring/code/flow/FlowInfo.java | 515 ++ .../corext/refactoring/code/flow/ForFlowInfo.java | 44 + .../code/flow/GenericConditionalFlowInfo.java | 36 + .../code/flow/GenericSequentialFlowInfo.java | 35 + .../corext/refactoring/code/flow/IfFlowInfo.java | 38 + .../refactoring/code/flow/InOutFlowAnalyzer.java | 126 + .../refactoring/code/flow/InputFlowAnalyzer.java | 299 + .../refactoring/code/flow/LocalFlowInfo.java | 44 + .../refactoring/code/flow/MessageSendFlowInfo.java | 31 + .../refactoring/code/flow/ReturnFlowInfo.java | 37 + .../refactoring/code/flow/SwitchFlowInfo.java | 41 + .../refactoring/code/flow/ThrowFlowInfo.java | 34 + .../corext/refactoring/code/flow/TryFlowInfo.java | 40 + .../code/flow/TypeVariableFlowInfo.java | 22 + .../refactoring/code/flow/WhileFlowInfo.java | 31 + .../corext/refactoring/code/flow/WithFlowInfo.java | 31 + .../refactoring/delegates/DelegateCreator.java | 460 ++ .../delegates/DelegateFieldCreator.java | 102 + .../delegates/DelegateMethodCreator.java | 221 + .../refactoring/nls/AccessorClassCreator.java | 331 + .../refactoring/nls/AccessorClassModifier.java | 281 + .../refactoring/nls/AccessorClassReference.java | 57 + .../corext/refactoring/nls/KeyValuePair.java | 38 + .../corext/refactoring/nls/NLSElement.java | 154 + .../internal/corext/refactoring/nls/NLSHint.java | 304 + .../corext/refactoring/nls/NLSHintHelper.java | 454 ++ .../internal/corext/refactoring/nls/NLSLine.java | 74 + .../corext/refactoring/nls/NLSMessages.java | 56 + .../corext/refactoring/nls/NLSMessages.properties | 45 + .../refactoring/nls/NLSPropertyFileModifier.java | 221 + .../corext/refactoring/nls/NLSRefactoring.java | 527 ++ .../corext/refactoring/nls/NLSScanner.java | 166 + .../corext/refactoring/nls/NLSSourceModifier.java | 333 + .../corext/refactoring/nls/NLSSubstitution.java | 331 + .../internal/corext/refactoring/nls/NLSUtil.java | 209 + .../refactoring/nls/PropertyFileDocumentModel.java | 327 + .../corext/refactoring/nls/SimpleLineReader.java | 71 + .../refactoring/nls/changes/CreateFileChange.java | 218 + .../nls/changes/CreateTextFileChange.java | 62 + .../refactoring/nls/changes/DeleteFileChange.java | 110 + .../nls/changes/NLSChangesMessages.java | 34 + .../nls/changes/NLSChangesMessages.properties | 16 + .../refactoring/participants/JavaProcessors.java | 48 + .../participants/RefactoringProcessors.java | 31 + .../participants/ResourceModifications.java | 352 + .../participants/ResourceProcessors.java | 52 + .../corext/refactoring/refactoring.properties | 1354 ++++ .../GenericRefactoringHandleTransplanter.java | 147 + .../refactoring/rename/JavaRenameProcessor.java | 97 + .../refactoring/rename/JavaRenameRefactoring.java | 51 + .../corext/refactoring/rename/MethodChecks.java | 124 + .../rename/MethodOccurenceCollector.java | 75 + .../refactoring/rename/RefactoringAnalyzeUtil.java | 120 + .../rename/RefactoringHandleTransplanter.java | 230 + .../refactoring/rename/RefactoringScanner.java | 214 + .../refactoring/rename/RenameAnalyzeUtil.java | 455 ++ .../rename/RenameCompilationUnitProcessor.java | 464 ++ .../refactoring/rename/RenameFieldProcessor.java | 907 +++ .../rename/RenameJavaProjectProcessor.java | 227 + .../rename/RenameLocalVariableProcessor.java | 438 ++ .../refactoring/rename/RenameMethodProcessor.java | 883 +++ .../refactoring/rename/RenameModifications.java | 265 + .../rename/RenameNonVirtualMethodProcessor.java | 235 + .../refactoring/rename/RenamePackageProcessor.java | 1073 +++ .../rename/RenameResourceProcessor.java | 214 + .../rename/RenameSourceFolderProcessor.java | 203 + .../refactoring/rename/RenameTypeProcessor.java | 1702 +++++ .../rename/RenameVirtualMethodProcessor.java | 217 + .../refactoring/rename/RenamingNameSuggestor.java | 570 ++ .../refactoring/rename/RippleMethodFinder2.java | 358 + .../refactoring/rename/TempDeclarationFinder.java | 123 + .../refactoring/rename/TempOccurrenceAnalyzer.java | 122 + .../refactoring/rename/TextMatchUpdater.java | 199 + .../rename/TypeOccurrenceCollector.java | 78 + .../internal/corext/refactoring/rename/todo.txt | 3 + .../refactoring/reorg/ASTNodeDeleteUtil.java | 120 + .../refactoring/reorg/ArrayTypeConverter.java | 51 + .../refactoring/reorg/CopyModifications.java | 159 + .../reorg/CreateCopyOfCompilationUnitChange.java | 208 + .../reorg/CreateTargetExecutionLog.java | 66 + .../refactoring/reorg/DeleteChangeCreator.java | 229 + .../refactoring/reorg/DeleteModifications.java | 240 + .../corext/refactoring/reorg/IConfirmQuery.java | 18 + .../refactoring/reorg/ICreateTargetQueries.java | 17 + .../refactoring/reorg/ICreateTargetQuery.java | 28 + .../corext/refactoring/reorg/INewNameQueries.java | 26 + .../corext/refactoring/reorg/INewNameQuery.java | 17 + .../IPackageFragmentRootManipulationQuery.java | 25 + .../reorg/IReorgDestinationValidator.java | 22 + .../corext/refactoring/reorg/IReorgPolicy.java | 71 + .../corext/refactoring/reorg/IReorgQueries.java | 36 + .../reorg/JDTCopyRefactoringDescriptor.java | 62 + .../reorg/JDTMoveRefactoringDescriptor.java | 61 + .../refactoring/reorg/JavaCopyProcessor.java | 238 + .../refactoring/reorg/JavaCopyRefactoring.java | 51 + .../refactoring/reorg/JavaDeleteProcessor.java | 884 +++ .../refactoring/reorg/JavaDeleteRefactoring.java | 51 + .../refactoring/reorg/JavaElementTransfer.java | 136 + .../refactoring/reorg/JavaMoveProcessor.java | 312 + .../reorg/LoggedCreateTargetChange.java | 89 + .../reorg/LoggedCreateTargetQueries.java | 133 + .../refactoring/reorg/LoggedNewNameQueries.java | 148 + .../reorg/MonitoringCreateTargetQueries.java | 72 + .../reorg/MonitoringNewNameQueries.java | 88 + .../refactoring/reorg/MoveCuUpdateCreator.java | 420 ++ .../refactoring/reorg/MoveModifications.java | 181 + .../corext/refactoring/reorg/NullReorgQueries.java | 63 + .../corext/refactoring/reorg/OverwriteHelper.java | 228 + .../corext/refactoring/reorg/ParentChecker.java | 192 + .../refactoring/reorg/ReadOnlyResourceFinder.java | 134 + .../reorg/RefactoringModifications.java | 94 + .../refactoring/reorg/ReorgPolicyFactory.java | 3474 +++++++++ .../corext/refactoring/reorg/ReorgUtils.java | 603 ++ .../refactoring/reorg/SourceReferenceUtil.java | 104 + ...angeMethodSignatureRefactoringContribution.java | 32 + .../ChangeTypeRefactoringContribution.java | 32 + .../ConvertAnonymousRefactoringContribution.java | 32 + .../scripting/CopyRefactoringContribution.java | 33 + .../scripting/DeleteRefactoringContribution.java | 33 + .../ExtractConstantRefactoringContribution.java | 33 + .../ExtractMethodRefactoringContribution.java | 32 + .../ExtractSupertypeRefactoringContribution.java | 33 + .../ExtractTempRefactoringContribution.java | 33 + .../InlineConstantRefactoringContribution.java | 32 + .../InlineMethodRefactoringContribution.java | 111 + .../InlineTempRefactoringContribution.java | 32 + .../IntroduceFactoryRefactoringContribution.java | 32 + ...ntroduceIndirectionRefactoringContribution.java | 32 + .../IntroduceParameterRefactoringContribution.java | 32 + .../MoveMemberTypeRefactoringContribution.java | 32 + .../MoveMethodRefactoringContribution.java | 33 + .../scripting/MoveRefactoringContribution.java | 33 + .../MoveStaticMembersRefactoringContribution.java | 41 + .../PromoteTempToFieldRefactoringContribution.java | 32 + .../scripting/PullUpRefactoringContribution.java | 33 + .../scripting/PushDownRefactoringContribution.java | 33 + ...nameCompilationUnitRefactoringContribution.java | 42 + .../RenameFieldRefactoringContribution.java | 41 + .../RenameJavaProjectRefactoringContribution.java | 41 + ...RenameLocalVariableRefactoringContribution.java | 41 + .../RenameMethodRefactoringContribution.java | 60 + .../RenamePackageRefactoringContribution.java | 41 + .../RenameResourceRefactoringContribution.java | 41 + .../RenameSourceFolderRefactoringContribution.java | 41 + .../RenameTypeRefactoringContribution.java | 41 + .../SelfEncapsulateRefactoringContribution.java | 32 + .../UseSupertypeRefactoringContribution.java | 41 + .../corext/refactoring/sef/AccessAnalyzer.java | 316 + .../sef/SelfEncapsulateFieldRefactoring.java | 823 +++ .../refactoring/structure/ASTNodeSearchUtil.java | 237 + .../corext/refactoring/structure/BodyUpdater.java | 43 + .../structure/ChangeSignatureRefactoring.java | 2623 +++++++ .../structure/ChangeTypeRefactoring.java | 1419 ++++ .../structure/CompilationUnitRewrite.java | 323 + .../structure/ConstructorReferenceFinder.java | 265 + .../ExtractInterfaceConstraintsSolver.java | 56 + .../structure/ExtractSupertypeProcessor.java | 1110 +++ .../structure/ExtractSupertypeRefactoring.java | 47 + .../refactoring/structure/HierarchyProcessor.java | 634 ++ .../structure/IDefaultValueAdvisor.java | 45 + .../refactoring/structure/IMemberActionInfo.java | 14 + .../refactoring/structure/ImportRemover.java | 232 + .../refactoring/structure/ImportRewriteUtil.java | 177 + .../refactoring/structure/JavaMoveRefactoring.java | 51 + .../refactoring/structure/MemberCheckUtil.java | 161 + .../structure/MemberVisibilityAdjustor.java | 1331 ++++ .../structure/MoveInnerToTopRefactoring.java | 1488 ++++ .../structure/MoveInstanceMethodProcessor.java | 2980 ++++++++ .../structure/MoveInstanceMethodRefactoring.java | 45 + .../structure/MoveStaticMemberAnalyzer.java | 204 + .../structure/MoveStaticMembersProcessor.java | 1035 +++ .../refactoring/structure/MovedMemberAnalyzer.java | 189 + .../refactoring/structure/PullUpRefactoring.java | 68 + .../structure/PullUpRefactoringProcessor.java | 1862 +++++ .../refactoring/structure/PushDownRefactoring.java | 68 + .../structure/PushDownRefactoringProcessor.java | 993 +++ .../refactoring/structure/ReferenceAnalyzer.java | 132 + .../refactoring/structure/ReferenceFinderUtil.java | 181 + .../refactoring/structure/TypeVariableMaplet.java | 104 + .../structure/UseSuperTypeProcessor.java | 460 ++ .../structure/UseSuperTypeRefactoring.java | 71 + .../constraints/ConditionalTypeConstraint.java | 93 + .../constraints/CovariantTypeConstraint.java | 78 + .../constraints/SuperTypeConstraintsCreator.java | 758 ++ .../constraints/SuperTypeConstraintsModel.java | 564 ++ .../constraints/SuperTypeConstraintsSolver.java | 279 + .../constraints/SuperTypeRefactoringProcessor.java | 1250 ++++ .../structure/constraints/SuperTypeSet.java | 287 + .../refactoring/surround/ExceptionAnalyzer.java | 132 + .../surround/ISurroundWithTryCatchQuery.java | 17 + .../surround/LocalDeclarationAnalyzer.java | 64 + .../refactoring/surround/SurroundWithAnalyzer.java | 135 + .../surround/SurroundWithTryCatchAnalyzer.java | 54 + .../surround/SurroundWithTryCatchRefactoring.java | 361 + .../refactoring/tagging/ICommentProvider.java | 48 + .../refactoring/tagging/IDelegateUpdating.java | 76 + .../corext/refactoring/tagging/INameUpdating.java | 53 + .../tagging/IQualifiedNameUpdating.java | 43 + .../refactoring/tagging/IReferenceUpdating.java | 35 + .../tagging/IScriptableRefactoring.java | 34 + .../tagging/ISimilarDeclarationUpdating.java | 65 + .../corext/refactoring/tagging/ITextUpdating.java | 61 + .../refactoring/typeconstraints/ASTCreator.java | 51 + .../typeconstraints/CompilationUnitRange.java | 74 + .../typeconstraints/CompositeOrTypeConstraint.java | 82 + .../typeconstraints/ConstraintCollector.java | 622 ++ .../typeconstraints/ConstraintCreator.java | 533 ++ .../typeconstraints/ConstraintOperator.java | 107 + .../typeconstraints/ConstraintVariable.java | 70 + .../typeconstraints/ConstraintVariableFactory.java | 258 + .../typeconstraints/DeclaringTypeVariable.java | 53 + .../typeconstraints/ExpressionVariable.java | 82 + .../typeconstraints/FullConstraintCreator.java | 675 ++ .../IConstraintVariableFactory.java | 32 + .../refactoring/typeconstraints/IContext.java | 20 + .../typeconstraints/ITypeConstraint.java | 28 + .../typeconstraints/ITypeConstraintFactory.java | 36 + .../refactoring/typeconstraints/NullContext.java | 16 + .../typeconstraints/ParameterTypeVariable.java | 46 + .../typeconstraints/RawBindingVariable.java | 21 + .../typeconstraints/ReturnTypeVariable.java | 49 + .../typeconstraints/SimpleTypeConstraint.java | 78 + .../typeconstraints/TypeConstraintFactory.java | 147 + .../refactoring/typeconstraints/TypeVariable.java | 48 + .../types/AbstractTypeVariable.java | 72 + .../typeconstraints/types/ArrayType.java | 159 + .../typeconstraints/types/CaptureType.java | 106 + .../typeconstraints/types/GenericType.java | 62 + .../typeconstraints/types/HierarchyType.java | 73 + .../typeconstraints/types/NullType.java | 44 + .../typeconstraints/types/PrimitiveType.java | 133 + .../refactoring/typeconstraints/types/RawType.java | 96 + .../typeconstraints/types/StandardType.java | 88 + .../refactoring/typeconstraints/types/TType.java | 574 ++ .../typeconstraints/types/TypeEnvironment.java | 367 + .../typeconstraints/types/TypeTuple.java | 36 + .../typeconstraints/types/UnboundWildcardType.java | 72 + .../typeconstraints/types/VoidType.java | 45 + .../typeconstraints/types/WildcardType.java | 77 + .../typesets/ArraySuperTypeSet.java | 197 + .../typeconstraints/typesets/ArrayTypeSet.java | 207 + .../typeconstraints/typesets/EmptyTypeSet.java | 148 + .../typesets/EnumeratedTypeSet.java | 488 ++ .../typeconstraints/typesets/SingletonTypeSet.java | 178 + .../typesets/SubTypesOfSingleton.java | 265 + .../typeconstraints/typesets/SubTypesSet.java | 300 + .../typesets/SuperTypesOfSingleton.java | 253 + .../typeconstraints/typesets/SuperTypesSet.java | 293 + .../typeconstraints/typesets/TypeSet.java | 236 + .../typesets/TypeSetEnvironment.java | 124 + .../typesets/TypeSetIntersection.java | 321 + .../typeconstraints/typesets/TypeSetUnion.java | 152 + .../typeconstraints/typesets/TypeUniverseSet.java | 52 + .../typeconstraints2/ArrayElementVariable2.java | 45 + .../typeconstraints2/ArrayTypeVariable2.java | 27 + .../typeconstraints2/CastVariable2.java | 48 + .../CollectionElementVariable2.java | 79 + .../typeconstraints2/ConstraintVariable2.java | 114 + .../ISourceConstraintVariable.java | 26 + .../typeconstraints2/ITypeConstraint2.java | 18 + .../typeconstraints2/ITypeConstraintVariable.java | 18 + .../refactoring/typeconstraints2/ITypeSet.java | 24 + .../typeconstraints2/ImmutableTypeVariable2.java | 49 + .../typeconstraints2/IndependentTypeVariable2.java | 22 + .../typeconstraints2/ParameterTypeVariable2.java | 77 + .../ParameterizedTypeVariable2.java | 34 + .../typeconstraints2/ReturnTypeVariable2.java | 63 + .../typeconstraints2/SubTypeConstraint2.java | 61 + .../refactoring/typeconstraints2/TTypes.java | 138 + .../typeconstraints2/TypeEquivalenceSet.java | 87 + .../typeconstraints2/TypeVariable2.java | 70 + .../typeconstraints2/VariableVariable2.java | 63 + .../util/AbstractExceptionAnalyzer.java | 125 + .../internal/corext/refactoring/util/Changes.java | 44 + .../corext/refactoring/util/CodeAnalyzer.java | 38 + .../corext/refactoring/util/CommentAnalyzer.java | 104 + .../corext/refactoring/util/JavaElementUtil.java | 240 + .../corext/refactoring/util/JavadocUtil.java | 100 + .../util/NoCommentSourceRangeComputer.java | 20 + .../refactoring/util/QualifiedNameFinder.java | 158 + .../util/QualifiedNameSearchResult.java | 71 + .../refactoring/util/RefactoringASTParser.java | 147 + .../refactoring/util/RefactoringFileBuffers.java | 81 + .../corext/refactoring/util/ResourceUtil.java | 64 + .../util/SelectionAwareSourceRangeComputer.java | 105 + .../corext/refactoring/util/StatementAnalyzer.java | 272 + .../corext/refactoring/util/TextChangeManager.java | 130 + .../util/TextEditBasedChangeManager.java | 130 + .../refactoring/util/TightSourceRangeComputer.java | 71 + .../corext/template/java/CodeTemplateContext.java | 107 + .../template/java/CodeTemplateContextType.java | 353 + .../corext/template/java/CodeTemplates.java | 91 + .../template/java/CompilationUnitCompletion.java | 700 ++ .../template/java/CompilationUnitContext.java | 133 + .../template/java/CompilationUnitContextType.java | 214 + .../corext/template/java/ElementTypeResolver.java | 69 + .../template/java/ExclusivePositionUpdater.java | 101 + .../corext/template/java/FieldResolver.java | 85 + .../internal/corext/template/java/JavaContext.java | 603 ++ .../corext/template/java/JavaContextType.java | 350 + .../corext/template/java/JavaDocContext.java | 218 + .../corext/template/java/JavaDocContextType.java | 66 + .../corext/template/java/JavaFormatter.java | 354 + .../corext/template/java/JavaTemplateMessages.java | 82 + .../template/java/JavaTemplateMessages.properties | 73 + .../corext/template/java/JavaVariable.java | 51 + .../corext/template/java/LocalVarResolver.java | 85 + .../corext/template/java/NameResolver.java | 87 + .../corext/template/java/SignatureUtil.java | 150 + .../internal/corext/template/java/TemplateSet.java | 376 + .../internal/corext/template/java/Templates.java | 97 + .../corext/template/java/TypeVariableResolver.java | 89 + .../internal/corext/template/java/VarResolver.java | 96 + .../internal/corext/util/CodeFormatterUtil.java | 383 + .../wst/jsdt/internal/corext/util/History.java | 311 + .../wst/jsdt/internal/corext/util/IOCloser.java | 39 + .../corext/util/JavaElementResourceMapping.java | 398 + .../jsdt/internal/corext/util/JavaModelUtil.java | 947 +++ .../wst/jsdt/internal/corext/util/JdtFlags.java | 228 + .../wst/jsdt/internal/corext/util/LRUMap.java | 32 + .../wst/jsdt/internal/corext/util/Messages.java | 33 + .../internal/corext/util/MethodOverrideTester.java | 373 + .../jsdt/internal/corext/util/OpenTypeHistory.java | 419 ++ .../corext/util/QualifiedTypeNameHistory.java | 67 + .../wst/jsdt/internal/corext/util/Resources.java | 238 + .../wst/jsdt/internal/corext/util/SearchUtils.java | 76 + .../wst/jsdt/internal/corext/util/Strings.java | 433 ++ .../corext/util/SuperTypeHierarchyCache.java | 211 + .../wst/jsdt/internal/corext/util/TypeFilter.java | 114 + .../jsdt/internal/corext/util/TypeInfoFilter.java | 259 + .../corext/util/TypeInfoRequestorAdapter.java | 55 + .../corext/util/TypeNameMatchCollector.java | 41 + .../internal/ui/CompatibilityTemplateStore.java | 117 + .../internal/ui/EditorInputAdapterFactory.java | 66 + .../wst/jsdt/internal/ui/IJavaHelpContextIds.java | 440 ++ .../wst/jsdt/internal/ui/IJavaStatusConstants.java | 60 + .../wst/jsdt/internal/ui/IJavaThemeConstants.java | 152 + ...JsGlobalScopeContainerInitializerExtension.java | 27 + .../wst/jsdt/internal/ui/IProductConstants.java | 30 + .../wst/jsdt/internal/ui/IResourceLocator.java | 65 + .../eclipse/wst/jsdt/internal/ui/IUIConstants.java | 31 + .../jsdt/internal/ui/InitializeAfterLoadJob.java | 55 + .../internal/ui/JavaElementAdapterFactory.java | 213 + .../internal/ui/JavaElementContainmentAdapter.java | 137 + .../jsdt/internal/ui/JavaElementProperties.java | 64 + .../jsdt/internal/ui/JavaPerspectiveFactory.java | 103 + .../wst/jsdt/internal/ui/JavaPluginImages.java | 595 ++ .../internal/ui/JavaProjectAdapterFactory.java | 39 + .../wst/jsdt/internal/ui/JavaScriptPlugin.java | 927 +++ .../wst/jsdt/internal/ui/JavaTaskListAdapter.java | 36 + .../wst/jsdt/internal/ui/JavaUIException.java | 29 + .../wst/jsdt/internal/ui/JavaUIMessages.java | 171 + .../wst/jsdt/internal/ui/JavaUIMessages.properties | 179 + .../internal/ui/JavaUIPreferenceInitializer.java | 33 + .../eclipse/wst/jsdt/internal/ui/JavaUIStatus.java | 45 + .../wst/jsdt/internal/ui/JavaWorkbenchAdapter.java | 74 + .../org/eclipse/wst/jsdt/internal/ui/Logger.java | 156 + .../internal/ui/LogicalPackageAdapterFactory.java | 63 + .../wst/jsdt/internal/ui/MarkerAdapterFactory.java | 50 + .../internal/ui/PersistableJavaElementFactory.java | 74 + .../wst/jsdt/internal/ui/ProductProperties.java | 43 + .../jsdt/internal/ui/ResourceAdapterFactory.java | 45 + .../wst/jsdt/internal/ui/ResourceLocator.java | 48 + .../wst/jsdt/internal/ui/SetupProjectsWizzard.java | 70 + .../eclipse/wst/jsdt/internal/ui/SharedImages.java | 39 + .../ui/actions/AbstractToggleLinkingAction.java | 42 + .../jsdt/internal/ui/actions/ActionMessages.java | 376 + .../internal/ui/actions/ActionMessages.properties | 412 ++ .../wst/jsdt/internal/ui/actions/ActionUtil.java | 178 + .../internal/ui/actions/AddBlockCommentAction.java | 215 + .../jsdt/internal/ui/actions/AddTaskAction.java | 53 + .../internal/ui/actions/AllCleanUpsAction.java | 110 + .../internal/ui/actions/BlockCommentAction.java | 327 + .../ui/actions/CategoryFilterActionGroup.java | 530 ++ .../jsdt/internal/ui/actions/CleanUpAction.java | 287 + .../internal/ui/actions/CompositeActionGroup.java | 97 + .../ui/actions/ConfigureContainerAction.java | 138 + .../ui/actions/CopyQualifiedNameAction.java | 269 + .../ui/actions/ExtractSuperClassAction.java | 191 + .../ui/actions/FindBrokenNLSKeysAction.java | 358 + .../internal/ui/actions/FoldingActionGroup.java | 246 + .../jsdt/internal/ui/actions/FoldingMessages.java | 81 + .../internal/ui/actions/FoldingMessages.properties | 49 + ...erateConstructorUsingFieldsContentProvider.java | 201 + ...erateConstructorUsingFieldsSelectionDialog.java | 352 + .../GenerateConstructorUsingFieldsValidator.java | 87 + .../internal/ui/actions/GenerateJavadocAction.java | 48 + .../wst/jsdt/internal/ui/actions/IndentAction.java | 570 ++ .../internal/ui/actions/JDTQuickMenuAction.java | 79 + .../internal/ui/actions/LexicalSortingAction.java | 65 + .../jsdt/internal/ui/actions/MultiActionGroup.java | 126 + .../ui/actions/MultiOrganizeImportAction.java | 60 + .../ui/actions/MultiSortMembersAction.java | 108 + .../internal/ui/actions/NewWizardsActionGroup.java | 84 + .../ui/actions/OccurrencesSearchMenuAction.java | 182 + .../jsdt/internal/ui/actions/OpenBrowserUtil.java | 36 + .../jsdt/internal/ui/actions/OpenTypeAction.java | 119 + .../ui/actions/OpenTypeInHierarchyAction.java | 77 + .../jsdt/internal/ui/actions/QuickMenuAction.java | 300 + .../ui/actions/RemoveBlockCommentAction.java | 87 + .../jsdt/internal/ui/actions/SelectAllAction.java | 84 + .../internal/ui/actions/SelectionConverter.java | 310 + .../ui/actions/SurroundWithActionGroup.java | 91 + .../ui/actions/SurroundWithTemplateMenuAction.java | 412 ++ .../ui/actions/WorkbenchRunnableAdapter.java | 123 + .../internal/ui/browsing/IPackagesViewViewer.java | 40 + .../ui/browsing/JavaBrowsingContentProvider.java | 537 ++ .../internal/ui/browsing/JavaBrowsingMessages.java | 39 + .../ui/browsing/JavaBrowsingMessages.properties | 24 + .../internal/ui/browsing/JavaBrowsingPart.java | 1315 ++++ .../browsing/JavaBrowsingPerspectiveFactory.java | 180 + .../ui/browsing/JavaElementTypeComparator.java | 84 + .../jsdt/internal/ui/browsing/LogicalPackage.java | 141 + .../ui/browsing/LogicalPackagesProvider.java | 214 + .../wst/jsdt/internal/ui/browsing/MembersView.java | 336 + .../internal/ui/browsing/PackageViewerWrapper.java | 343 + .../jsdt/internal/ui/browsing/PackagesView.java | 653 ++ .../browsing/PackagesViewFlatContentProvider.java | 300 + .../PackagesViewHierarchicalContentProvider.java | 646 ++ .../ui/browsing/PackagesViewLabelProvider.java | 162 + .../ui/browsing/PackagesViewTableViewer.java | 111 + .../ui/browsing/PackagesViewTreeViewer.java | 121 + .../ui/browsing/PatchedOpenInNewWindowAction.java | 61 + .../ProjectAndSourceFolderContentProvider.java | 99 + .../jsdt/internal/ui/browsing/ProjectsView.java | 211 + .../internal/ui/browsing/ToggleLinkingAction.java | 41 + .../TopLevelTypeProblemsLabelDecorator.java | 69 + .../wst/jsdt/internal/ui/browsing/TypesView.java | 219 + .../CallHierarchyContentProvider.java | 204 + .../CallHierarchyFiltersActionGroup.java | 86 + .../CallHierarchyImageDescriptor.java | 154 + .../callhierarchy/CallHierarchyLabelDecorator.java | 106 + .../callhierarchy/CallHierarchyLabelProvider.java | 106 + .../ui/callhierarchy/CallHierarchyMessages.java | 116 + .../callhierarchy/CallHierarchyMessages.properties | 116 + .../CallHierarchyTransferDropAdapter.java | 76 + .../internal/ui/callhierarchy/CallHierarchyUI.java | 276 + .../ui/callhierarchy/CallHierarchyViewPart.java | 948 +++ .../ui/callhierarchy/CallHierarchyViewer.java | 138 + .../ui/callhierarchy/CancelSearchAction.java | 38 + .../ui/callhierarchy/CopyCallHierarchyAction.java | 128 + .../ui/callhierarchy/DeferredMethodWrapper.java | 122 + .../internal/ui/callhierarchy/FiltersDialog.java | 226 + .../ui/callhierarchy/FocusOnSelectionAction.java | 86 + .../internal/ui/callhierarchy/HistoryAction.java | 73 + .../ui/callhierarchy/HistoryDropDownAction.java | 108 + .../ui/callhierarchy/HistoryListAction.java | 181 + .../ui/callhierarchy/ICallHierarchyViewPart.java | 19 + .../ui/callhierarchy/LocationCopyAction.java | 72 + .../ui/callhierarchy/LocationLabelProvider.java | 103 + .../internal/ui/callhierarchy/LocationViewer.java | 127 + .../MethodWrapperWorkbenchAdapter.java | 75 + .../ui/callhierarchy/OpenCallHierarchyAction.java | 239 + .../ui/callhierarchy/OpenDeclarationAction.java | 50 + .../ui/callhierarchy/OpenLocationAction.java | 77 + .../internal/ui/callhierarchy/RefreshAction.java | 37 + .../ui/callhierarchy/SearchScopeAction.java | 37 + .../ui/callhierarchy/SearchScopeActionGroup.java | 355 + .../callhierarchy/SearchScopeHierarchyAction.java | 67 + .../ui/callhierarchy/SearchScopeProjectAction.java | 61 + .../callhierarchy/SearchScopeWorkingSetAction.java | 58 + .../callhierarchy/SearchScopeWorkspaceAction.java | 48 + .../jsdt/internal/ui/callhierarchy/SearchUtil.java | 137 + .../ui/callhierarchy/SelectWorkingSetAction.java | 55 + .../ui/callhierarchy/ToggleCallModeAction.java | 59 + .../ui/callhierarchy/ToggleOrientationAction.java | 72 + .../jsdt/internal/ui/callhierarchy/TreeRoot.java | 28 + .../internal/ui/callhierarchy/TreeTermination.java | 17 + .../ui/commands/JavaElementReferenceConverter.java | 233 + .../ui/commands/OpenElementInEditorHandler.java | 47 + .../commands/ShowElementInPackageViewHandler.java | 38 + .../ShowElementInTypeHierarchyViewHandler.java | 42 + .../ui/compare/AddFromHistoryAction.properties | 33 + .../internal/ui/compare/CompareAction.properties | 20 + .../jsdt/internal/ui/compare/CompareDialog.java | 114 + .../jsdt/internal/ui/compare/CompareMessages.java | 64 + .../internal/ui/compare/CompareMessages.properties | 89 + .../ui/compare/CompareWithEditionAction.properties | 33 + .../ui/compare/EclipsePreferencesAdapter.java | 317 + .../ui/compare/JavaAddElementFromHistory.java | 22 + .../ui/compare/JavaAddElementFromHistoryImpl.java | 304 + .../internal/ui/compare/JavaCompareAction.java | 183 + .../internal/ui/compare/JavaCompareUtilities.java | 454 ++ .../ui/compare/JavaCompareWithEditionAction.java | 25 + .../compare/JavaCompareWithEditionActionImpl.java | 64 + .../ui/compare/JavaContentViewerCreator.java | 28 + .../ui/compare/JavaElementHistoryPageSource.java | 76 + .../internal/ui/compare/JavaHistoryAction.java | 80 + .../internal/ui/compare/JavaHistoryActionImpl.java | 334 + .../jsdt/internal/ui/compare/JavaMergeViewer.java | 423 ++ .../wst/jsdt/internal/ui/compare/JavaNode.java | 171 + .../internal/ui/compare/JavaParseTreeBuilder.java | 205 + .../ui/compare/JavaReplaceWithEditionAction.java | 24 + .../compare/JavaReplaceWithEditionActionImpl.java | 212 + .../JavaReplaceWithPreviousEditionAction.java | 25 + .../internal/ui/compare/JavaStructureCreator.java | 501 ++ .../ui/compare/JavaStructureDiffViewer.java | 215 + .../ui/compare/JavaStructureDiffViewerCreator.java | 29 + .../internal/ui/compare/JavaTextBufferNode.java | 134 + .../jsdt/internal/ui/compare/JavaTextViewer.java | 97 + .../internal/ui/compare/JavaTextViewerCreator.java | 30 + .../internal/ui/compare/JavaTokenComparator.java | 225 + .../ui/compare/LocalHistoryActionGroup.java | 82 + .../ui/compare/ReplaceWithEditionAction.properties | 33 + .../jsdt/internal/ui/compare/ResizableDialog.java | 148 + .../ui/compare/TextMergeViewerCreator.java | 30 + .../jsdt/internal/ui/dialogs/DialogsMessages.java | 33 + .../internal/ui/dialogs/DialogsMessages.properties | 18 + .../ui/dialogs/FilteredTypesSelectionDialog.java | 1649 +++++ .../wst/jsdt/internal/ui/dialogs/ListDialog.java | 107 + .../dialogs/MultiElementListSelectionDialog.java | 323 + .../ui/dialogs/OpenTypeSelectionDialog.java | 61 + .../ui/dialogs/OpenTypeSelectionDialog2.java | 136 + .../internal/ui/dialogs/OptionalMessageDialog.java | 121 + .../internal/ui/dialogs/OverrideMethodDialog.java | 391 + .../ui/dialogs/PackageSelectionDialog.java | 321 + .../ui/dialogs/SortMembersMessageDialog.java | 186 + .../internal/ui/dialogs/SourceActionDialog.java | 655 ++ .../wst/jsdt/internal/ui/dialogs/StatusInfo.java | 196 + .../wst/jsdt/internal/ui/dialogs/StatusUtil.java | 81 + .../internal/ui/dialogs/TableTextCellEditor.java | 437 ++ .../ui/dialogs/TextFieldNavigationHandler.java | 505 ++ .../jsdt/internal/ui/dialogs/TypeInfoViewer.java | 1583 ++++ .../ui/dialogs/TypeSelectionComponent.java | 437 ++ .../internal/ui/dialogs/TypeSelectionDialog2.java | 332 + .../ui/dnd/BasicSelectionTransferDragAdapter.java | 82 + .../internal/ui/dnd/DelegatingDragAdapter.java | 115 + .../internal/ui/dnd/DelegatingDropAdapter.java | 268 + .../jsdt/internal/ui/dnd/JdtViewerDragAdapter.java | 37 + .../jsdt/internal/ui/dnd/JdtViewerDropAdapter.java | 295 + .../ui/dnd/ResourceTransferDragAdapter.java | 131 + .../wst/jsdt/internal/ui/filters/ClassFilter.java | 33 + .../internal/ui/filters/ClosedProjectFilter.java | 34 + .../ui/filters/ContainedLibraryFilter.java | 44 + .../internal/ui/filters/CustomFiltersDialog.java | 417 ++ .../ui/filters/EmptyInnerPackageFilter.java | 42 + .../internal/ui/filters/EmptyPackageFilter.java | 44 + .../wst/jsdt/internal/ui/filters/FieldsFilter.java | 25 + .../jsdt/internal/ui/filters/FilterDescriptor.java | 277 + .../jsdt/internal/ui/filters/FilterMessages.java | 37 + .../internal/ui/filters/FilterMessages.properties | 23 + .../ui/filters/ImportDeclarationFilter.java | 31 + .../jsdt/internal/ui/filters/JavaFileFilter.java | 49 + .../jsdt/internal/ui/filters/LibraryFilter.java | 36 + .../jsdt/internal/ui/filters/LocalTypesFilter.java | 24 + .../internal/ui/filters/NamePatternFilter.java | 105 + .../filters/NoPackageContainingFoldersFilter.java | 54 + .../internal/ui/filters/NonJavaElementFilter.java | 47 + .../jsdt/internal/ui/filters/NonPublicFilter.java | 25 + .../internal/ui/filters/NonPublicTypeFilter.java | 40 + .../ui/filters/NonSharedProjectFilter.java | 44 + .../jsdt/internal/ui/filters/StaticsFilter.java | 25 + .../wst/jsdt/internal/ui/fix/AbstractCleanUp.java | 96 + .../internal/ui/fix/CleanUpRefactoringWizard.java | 494 ++ ...UpSaveParticipantConfigurationModifyDialog.java | 285 + ...anUpSaveParticipantPreferenceConfiguration.java | 345 + .../jsdt/internal/ui/fix/CodeFormatCleanUp.java | 118 + .../wst/jsdt/internal/ui/fix/CodeFormatFix.java | 171 + .../wst/jsdt/internal/ui/fix/CodeStyleCleanUp.java | 237 + .../jsdt/internal/ui/fix/CommentFormatCleanUp.java | 106 + .../wst/jsdt/internal/ui/fix/CommentFormatFix.java | 204 + .../internal/ui/fix/ControlStatementsCleanUp.java | 157 + .../jsdt/internal/ui/fix/ConvertLoopCleanUp.java | 114 + .../jsdt/internal/ui/fix/ExpressionsCleanUp.java | 123 + .../eclipse/wst/jsdt/internal/ui/fix/ICleanUp.java | 175 + .../wst/jsdt/internal/ui/fix/ImportsCleanUp.java | 145 + .../wst/jsdt/internal/ui/fix/MultiFixMessages.java | 92 + .../internal/ui/fix/MultiFixMessages.properties | 73 + .../internal/ui/fix/SaveParticipantMessages.java | 43 + .../ui/fix/SaveParticipantMessages.properties | 25 + .../jsdt/internal/ui/fix/SortMembersCleanUp.java | 175 + .../wst/jsdt/internal/ui/fix/StringCleanUp.java | 130 + .../internal/ui/fix/UnnecessaryCodeCleanUp.java | 124 + .../jsdt/internal/ui/fix/UnusedCodeCleanUp.java | 219 + .../ui/fix/VariableDeclarationCleanUp.java | 134 + .../internal/ui/infoviews/AbstractInfoView.java | 572 ++ .../ui/infoviews/CopyToClipboardAction.java | 73 + .../internal/ui/infoviews/GotoInputAction.java | 41 + .../internal/ui/infoviews/InfoViewMessages.java | 49 + .../ui/infoviews/InfoViewMessages.properties | 35 + .../jsdt/internal/ui/infoviews/JavadocView.java | 703 ++ .../wst/jsdt/internal/ui/infoviews/SourceView.java | 518 ++ .../ui/infoviews/TextSelectionConverter.java | 110 + .../ui/javadocexport/CheckboxTreeAndListGroup.java | 804 +++ .../javadocexport/CreateJavadocActionDelegate.java | 54 + .../javadocexport/JavadocConsoleLineTracker.java | 158 + .../ui/javadocexport/JavadocExportMessages.java | 125 + .../javadocexport/JavadocExportMessages.properties | 119 + .../JavadocLinkDialogLabelProvider.java | 62 + .../internal/ui/javadocexport/JavadocLinkRef.java | 91 + .../JavadocMemberContentProvider.java | 81 + .../ui/javadocexport/JavadocOptionsManager.java | 1158 +++ .../JavadocProjectContentProvider.java | 122 + .../internal/ui/javadocexport/JavadocReader.java | 92 + .../javadocexport/JavadocSpecificsWizardPage.java | 302 + .../javadocexport/JavadocStandardWizardPage.java | 573 ++ .../ui/javadocexport/JavadocTreeWizardPage.java | 706 ++ .../internal/ui/javadocexport/JavadocWizard.java | 456 ++ .../ui/javadocexport/JavadocWizardPage.java | 168 + .../internal/ui/javadocexport/JavadocWriter.java | 310 + .../ui/javadocexport/RecentSettingsStore.java | 277 + .../jsdt/internal/ui/javaeditor/ASTProvider.java | 672 ++ .../ui/javaeditor/AddClassFileMarkerAction.java | 77 + .../ui/javaeditor/AddImportOnSelectionAction.java | 245 + ...asicCompilationUnitEditorActionContributor.java | 191 + .../BasicJavaEditorActionContributor.java | 230 + .../ui/javaeditor/ClassFileDocumentProvider.java | 388 + .../internal/ui/javaeditor/ClassFileEditor.java | 871 +++ .../ClassFileEditorActionContributor.java | 20 + .../ui/javaeditor/ClassFileEditorInputFactory.java | 73 + .../javaeditor/ClassFileMarkerAnnotationModel.java | 157 + .../ui/javaeditor/ClassFileMarkerRulerAction.java | 74 + .../ui/javaeditor/ClipboardOperationAction.java | 507 ++ .../CompilationUnitAnnotationModelEvent.java | 111 + .../CompilationUnitDocumentProvider.java | 1603 +++++ .../ui/javaeditor/CompilationUnitEditor.java | 1739 +++++ .../CompilationUnitEditorActionContributor.java | 115 + .../ui/javaeditor/CompoundEditExitStrategy.java | 242 + .../ConstructedJavaEditorMessages.properties | 218 + .../internal/ui/javaeditor/DocumentAdapter.java | 524 ++ .../javaeditor/EditorHighlightingSynchronizer.java | 72 + .../jsdt/internal/ui/javaeditor/EditorUtility.java | 633 ++ .../javaeditor/ExternalClassFileEditorInput.java | 58 + .../ui/javaeditor/GotoMatchingBracketAction.java | 37 + .../ui/javaeditor/IClassFileEditorInput.java | 29 + .../ICompilationUnitDocumentProvider.java | 82 + .../ui/javaeditor/ICompoundEditListener.java | 25 + .../internal/ui/javaeditor/IJavaAnnotation.java | 123 + .../ui/javaeditor/IJavaEditorActionConstants.java | 48 + .../jsdt/internal/ui/javaeditor/ISavePolicy.java | 30 + .../jsdt/internal/ui/javaeditor/IndentUtil.java | 476 ++ .../javaeditor/InternalClassFileEditorInput.java | 129 + .../ui/javaeditor/JarEntryEditorInput.java | 120 + .../ui/javaeditor/JavaAnnotationImageProvider.java | 165 + .../ui/javaeditor/JavaAnnotationIterator.java | 99 + .../javaeditor/JavaDocumentSetupParticipant.java | 34 + .../jsdt/internal/ui/javaeditor/JavaEditor.java | 3636 ++++++++++ .../ui/javaeditor/JavaEditorErrorTickUpdater.java | 99 + .../internal/ui/javaeditor/JavaEditorMessages.java | 127 + .../ui/javaeditor/JavaEditorMessages.properties | 115 + .../ui/javaeditor/JavaElementHyperlink.java | 72 + .../javaeditor/JavaElementHyperlinkDetector.java | 146 + .../ui/javaeditor/JavaMarkerAnnotation.java | 159 + .../ui/javaeditor/JavaMoveLinesAction.java | 481 ++ .../internal/ui/javaeditor/JavaOutlinePage.java | 1409 ++++ .../JavaSelectAnnotationRulerAction.java | 179 + .../javaeditor/JavaSelectMarkerRulerAction2.java | 115 + .../ui/javaeditor/JavaSelectRulerAction.java | 26 + .../internal/ui/javaeditor/JavaSourceViewer.java | 630 ++ .../internal/ui/javaeditor/JavaTextSelection.java | 211 + .../internal/ui/javaeditor/NLSKeyHyperlink.java | 184 + .../ui/javaeditor/NLSKeyHyperlinkDetector.java | 96 + .../javaeditor/OverrideIndicatorImageProvider.java | 68 + .../ui/javaeditor/OverrideIndicatorManager.java | 248 + .../ui/javaeditor/RemoveOccurrenceAnnotations.java | 41 + .../ui/javaeditor/SemanticHighlighting.java | 130 + .../ui/javaeditor/SemanticHighlightingManager.java | 627 ++ .../javaeditor/SemanticHighlightingPresenter.java | 772 ++ .../javaeditor/SemanticHighlightingReconciler.java | 469 ++ .../ui/javaeditor/SemanticHighlightings.java | 1665 +++++ .../jsdt/internal/ui/javaeditor/SemanticToken.java | 116 + .../ui/javaeditor/SpecificContentAssistAction.java | 148 + .../javaeditor/SpecificContentAssistExecutor.java | 75 + .../javaeditor/StorageMarkerAnnotationModel.java | 102 + .../ui/javaeditor/ToggleCommentAction.java | 318 + .../ui/javaeditor/ToggleMarkOccurrencesAction.java | 96 + .../ui/javaeditor/TogglePresentationAction.java | 149 + .../ui/javaeditor/ToggleTextHoverAction.java | 97 + .../internal/ui/javaeditor/WorkingCopyManager.java | 129 + ...ractSaveParticipantPreferenceConfiguration.java | 177 + .../saveparticipant/IPostSaveListener.java | 72 + .../ISaveParticipantPreferenceConfiguration.java | 102 + .../saveparticipant/SaveParticipantDescriptor.java | 90 + .../saveparticipant/SaveParticipantMessages.java | 33 + .../SaveParticipantMessages.properties | 12 + .../saveparticipant/SaveParticipantRegistry.java | 160 + .../GoToNextPreviousMemberAction.java | 241 + .../selectionactions/SelectionActionMessages.java | 49 + .../SelectionActionMessages.properties | 32 + .../selectionactions/SelectionHistory.java | 84 + .../StructureSelectEnclosingAction.java | 47 + .../StructureSelectHistoryAction.java | 52 + .../StructureSelectNextAction.java | 98 + .../StructureSelectPreviousAction.java | 102 + .../selectionactions/StructureSelectionAction.java | 170 + .../internal/ui/model/JavaModelAdapterFactory.java | 56 + .../ui/model/JavaModelContentProvider.java | 83 + .../internal/ui/model/JavaModelLabelProvider.java | 124 + .../jsdt/internal/ui/model/JavaModelMerger.java | 85 + .../jsdt/internal/ui/model/JavaModelProvider.java | 80 + .../JavaRefactoringDescriptorResourceMapping.java | 39 + .../JavaRefactoringHistoryResourceMapping.java | 39 + .../internal/ui/model/JavaResourceMapping.java | 69 + .../model/JavaSynchronizationCompareAdapter.java | 171 + .../model/JavaSynchronizationContentProvider.java | 808 +++ .../ui/model/JavaSynchronizationLabelProvider.java | 173 + .../wst/jsdt/internal/ui/model/ModelMessages.java | 30 + .../internal/ui/model/ModelMessages.properties | 12 + .../ui/navigator/CommonLayoutActionGroup.java | 146 + .../internal/ui/navigator/ContainerFolder.java | 44 + .../ui/navigator/IExtensionStateConstants.java | 25 + .../ui/navigator/JavaDropAdapterAssistant.java | 252 + .../internal/ui/navigator/JavaFileLinkHelper.java | 53 + .../ui/navigator/JavaNavigatorActionProvider.java | 108 + .../ui/navigator/JavaNavigatorContentProvider.java | 345 + .../ui/navigator/JavaNavigatorLabelProvider.java | 206 + .../JavaNavigatorRefactorActionProvider.java | 68 + .../navigator/JavaNavigatorViewActionProvider.java | 154 + .../ui/navigator/NonEssentialElementsFilter.java | 110 + .../NonEssentialEmptyInnerPackageFilter.java | 21 + .../navigator/NonEssentialEmptyPackageFilter.java | 27 + .../jsdt/internal/ui/navigator/OpenAndExpand.java | 264 + .../PackageExplorerOpenActionProvider.java | 92 + .../internal/ui/packageview/CollapseAllAction.java | 38 + .../internal/ui/packageview/CustomHashtable.java | 403 ++ .../ui/packageview/DefaultElementComparer.java | 25 + .../ui/packageview/FileTransferDragAdapter.java | 240 + .../ui/packageview/FileTransferDropAdapter.java | 123 + .../internal/ui/packageview/GotoPackageAction.java | 83 + .../ui/packageview/GotoRequiredProjectAction.java | 38 + .../ui/packageview/GotoResourceAction.java | 122 + .../internal/ui/packageview/GotoTypeAction.java | 100 + .../packageview/HierarchicalDecorationContext.java | 94 + .../IMultiElementTreeContentProvider.java | 18 + .../ui/packageview/JsGlobalScopeContainer.java | 188 + .../internal/ui/packageview/LayoutActionGroup.java | 112 + .../internal/ui/packageview/LibraryContainer.java | 74 + .../internal/ui/packageview/NamespaceGroup.java | 314 + .../ui/packageview/PackageExplorerActionGroup.java | 393 + .../PackageExplorerContentProvider.java | 1510 ++++ .../packageview/PackageExplorerLabelProvider.java | 183 + .../ui/packageview/PackageExplorerPart.java | 1608 +++++ .../PackageExplorerProblemsDecorator.java | 46 + .../packageview/PackageFragmentRootContainer.java | 87 + .../ui/packageview/PackagesFrameSource.java | 41 + .../internal/ui/packageview/PackagesMessages.java | 72 + .../ui/packageview/PackagesMessages.properties | 71 + .../packageview/ScriptExplorerContentProvider.java | 77 + .../packageview/SelectionTransferDragAdapter.java | 21 + .../packageview/SelectionTransferDropAdapter.java | 244 + .../ui/packageview/ToggleLinkingAction.java | 42 + .../WorkingSetAwareContentProvider.java | 249 + .../WorkingSetAwareJavaElementSorter.java | 25 + .../ui/packageview/WorkingSetDropAdapter.java | 262 + .../ui/preferences/AbstractConfigurationBlock.java | 469 ++ ...onfigurationBlockPreferenceAndPropertyPage.java | 131 + .../AbstractConfigurationBlockPreferencePage.java | 124 + .../ui/preferences/AppearancePreferencePage.java | 235 + .../ui/preferences/BuildPathsPropertyPage.java | 269 + .../internal/ui/preferences/BulletListBlock.java | 77 + .../ui/preferences/CleanUpPreferencePage.java | 56 + .../CodeAssistAdvancedConfigurationBlock.java | 768 ++ .../CodeAssistAdvancedPreferencePage.java | 86 + .../preferences/CodeAssistConfigurationBlock.java | 420 ++ .../CodeAssistFavoritesConfigurationBlock.java | 464 ++ .../CodeAssistFavoritesPreferencePage.java | 97 + .../ui/preferences/CodeAssistPreferencePage.java | 98 + .../preferences/CodeFormatterPreferencePage.java | 59 + .../ui/preferences/CodeFormatterPreviewCode.txt | 44 + .../ui/preferences/CodeStylePreferencePage.java | 126 + .../internal/ui/preferences/CodeTemplateBlock.java | 580 ++ .../ui/preferences/CodeTemplatePreferencePage.java | 141 + .../CodeTemplateSourceViewerConfiguration.java | 159 + .../ui/preferences/ColorSettingPreviewCode.txt | 31 + .../preferences/ComplianceConfigurationBlock.java | 617 ++ .../ui/preferences/CompliancePreferencePage.java | 146 + .../ui/preferences/EditTemplateDialog.java | 608 ++ .../ui/preferences/FoldingConfigurationBlock.java | 377 + .../ui/preferences/FoldingPreferencePage.java | 58 + .../IPreferenceAndPropertyConfigurationBlock.java | 35 + .../preferences/IPreferenceConfigurationBlock.java | 63 + .../ImportOrganizeConfigurationBlock.java | 508 ++ .../ui/preferences/ImportOrganizeInputDialog.java | 240 + .../preferences/ImportOrganizePreferencePage.java | 135 + .../ui/preferences/JavaBasePreferencePage.java | 223 + .../preferences/JavaBuildConfigurationBlock.java | 310 + .../ui/preferences/JavaBuildPreferencePage.java | 134 + .../ui/preferences/JavaCategoryPropertyPage.java | 113 + .../JavaEditorAppearanceConfigurationBlock.java | 433 ++ .../JavaEditorColoringConfigurationBlock.java | 960 +++ .../JavaEditorColoringPreferencePage.java | 64 + .../JavaEditorHoverConfigurationBlock.java | 580 ++ .../preferences/JavaEditorHoverPreferencePage.java | 64 + .../ui/preferences/JavaEditorPreferencePage.java | 58 + .../ui/preferences/JavaEditorPropertyPage.java | 49 + .../ui/preferences/JavaElementInfoPage.java | 142 + .../ui/preferences/JavaPreferencesSettings.java | 113 + .../ui/preferences/JavaScriptMainPage.java | 60 + .../ui/preferences/JavaSourcePreviewerUpdater.java | 78 + .../ui/preferences/JavaTemplatePreferencePage.java | 164 + .../ui/preferences/JavadocConfigurationBlock.java | 917 +++ .../JavadocConfigurationPropertyPage.java | 254 + .../JavadocProblemsConfigurationBlock.java | 266 + .../preferences/JavadocProblemsPreferencePage.java | 134 + .../MarkOccurrencesConfigurationBlock.java | 267 + .../preferences/MarkOccurrencesPreferencePage.java | 59 + .../preferences/MembersOrderPreferenceCache.java | 181 + .../ui/preferences/MembersOrderPreferencePage.java | 409 ++ .../ui/preferences/MockupPreferenceStore.java | 273 + .../NameConventionConfigurationBlock.java | 513 ++ .../preferences/NewJavaProjectPreferencePage.java | 519 ++ .../ui/preferences/OccurrencesPreferencePage.java | 56 + .../ui/preferences/OptionsConfigurationBlock.java | 881 +++ .../ui/preferences/OverlayPreferenceStore.java | 486 ++ .../internal/ui/preferences/PreferencesAccess.java | 123 + .../ui/preferences/PreferencesMessages.java | 780 ++ .../ui/preferences/PreferencesMessages.properties | 911 +++ .../ProblemSeveritiesConfigurationBlock.java | 606 ++ .../ProblemSeveritiesPreferencePage.java | 154 + .../ui/preferences/ProfilePreferencePage.java | 95 + .../ui/preferences/ProjectSelectionDialog.java | 157 + ...PropertiesFileEditorColorSettingPreviewCode.txt | 5 + .../ui/preferences/PropertyAndPreferencePage.java | 339 + .../SaveParticipantConfigurationBlock.java | 171 + .../preferences/SaveParticipantPreferencePage.java | 63 + .../ui/preferences/ScrolledPageContent.java | 53 + .../preferences/SmartTypingConfigurationBlock.java | 263 + .../ui/preferences/SmartTypingPreferencePage.java | 58 + .../preferences/SourceAttachmentPropertyPage.java | 212 + .../ui/preferences/TodoTaskConfigurationBlock.java | 369 + .../ui/preferences/TodoTaskInputDialog.java | 162 + .../ui/preferences/TodoTaskPreferencePage.java | 143 + .../ui/preferences/TypeFilterInputDialog.java | 150 + .../ui/preferences/TypeFilterPreferencePage.java | 280 + .../ui/preferences/UserLibraryPreferencePage.java | 1311 ++++ .../preferences/WorkInProgressPreferencePage.java | 165 + .../cleanup/CleanUpConfigurationBlock.java | 269 + .../ui/preferences/cleanup/CleanUpMessages.java | 79 + .../preferences/cleanup/CleanUpMessages.properties | 55 + .../preferences/cleanup/CleanUpModifyDialog.java | 46 + .../ui/preferences/cleanup/CleanUpPreview.java | 99 + .../preferences/cleanup/CleanUpProfileManager.java | 61 + .../cleanup/CleanUpProfileVersioner.java | 66 + .../ui/preferences/cleanup/CleanUpTabPage.java | 158 + .../preferences/cleanup/CodeFormatingTabPage.java | 131 + .../ui/preferences/cleanup/CodeStyleTabPage.java | 73 + .../cleanup/UnnecessaryCodeTabPage.java | 69 + .../preferences/formatter/AlreadyExistsDialog.java | 208 + .../preferences/formatter/BlankLinesTabPage.java | 133 + .../ui/preferences/formatter/BracesTabPage.java | 182 + .../formatter/CodeFormatterConfigurationBlock.java | 122 + .../ui/preferences/formatter/CommentsTabPage.java | 242 + .../formatter/CompilationUnitPreview.java | 75 + .../formatter/ControlStatementsTabPage.java | 143 + .../preferences/formatter/CreateProfileDialog.java | 215 + .../preferences/formatter/FormatterMessages.java | 498 ++ .../formatter/FormatterMessages.properties | 561 ++ .../formatter/FormatterModifyDialog.java | 35 + .../formatter/FormatterProfileManager.java | 128 + .../formatter/FormatterProfileStore.java | 144 + .../ui/preferences/formatter/FormatterTabPage.java | 76 + .../preferences/formatter/IProfileVersioner.java | 29 + .../preferences/formatter/IndentationTabPage.java | 191 + .../ui/preferences/formatter/JavaPreview.java | 216 + .../preferences/formatter/LineWrappingTabPage.java | 893 +++ .../ui/preferences/formatter/ModifyDialog.java | 389 + .../preferences/formatter/ModifyDialogTabPage.java | 817 +++ .../ui/preferences/formatter/NewLinesTabPage.java | 130 + .../formatter/ProfileConfigurationBlock.java | 452 ++ .../ui/preferences/formatter/ProfileManager.java | 795 ++ .../ui/preferences/formatter/ProfileStore.java | 342 + .../ui/preferences/formatter/ProfileVersioner.java | 687 ++ .../ui/preferences/formatter/SnippetPreview.java | 96 + .../preferences/formatter/WhiteSpaceOptions.java | 1261 ++++ .../preferences/formatter/WhiteSpaceTabPage.java | 475 ++ .../ui/refactoring/ChangeExceptionHandler.java | 160 + .../ui/refactoring/ChangeExceptionsControl.java | 317 + .../ui/refactoring/ChangeParametersControl.java | 732 ++ .../ui/refactoring/ChangeSignatureWizard.java | 396 + .../ui/refactoring/ChangeTypeContentProvider.java | 93 + .../internal/ui/refactoring/ChangeTypeWizard.java | 371 + .../ui/refactoring/ComboSelectionDialog.java | 92 + .../ui/refactoring/CompilationUnitChangeNode.java | 202 + .../ConvertAnonymousToNestedWizard.java | 152 + .../CreateTextFileChangePreviewViewer.java | 148 + .../internal/ui/refactoring/DelegateUIHelper.java | 116 + .../ui/refactoring/ExtractConstantWizard.java | 315 + .../ui/refactoring/ExtractSupertypeMemberPage.java | 563 ++ .../ui/refactoring/ExtractSupertypeMethodPage.java | 77 + .../ui/refactoring/ExtractSupertypeWizard.java | 47 + .../internal/ui/refactoring/ExtractTempWizard.java | 172 + .../refactoring/IExceptionListChangeListener.java | 40 + .../refactoring/IParameterListChangeListener.java | 35 + .../ui/refactoring/IScheduledRefactoring.java | 25 + .../ui/refactoring/IVisibilityChangeListener.java | 15 + .../ui/refactoring/InlineConstantWizard.java | 143 + .../internal/ui/refactoring/InlineTempWizard.java | 67 + .../ui/refactoring/IntroduceFactoryInputPage.java | 223 + .../ui/refactoring/IntroduceFactoryWizard.java | 44 + .../refactoring/IntroduceIndirectionInputPage.java | 236 + .../ui/refactoring/IntroduceIndirectionWizard.java | 42 + .../ui/refactoring/IntroduceParameterWizard.java | 195 + .../ui/refactoring/JavaStatusContextViewer.java | 133 + .../internal/ui/refactoring/MessageWizardPage.java | 91 + .../ui/refactoring/MoveInnerToTopWizard.java | 184 + .../ui/refactoring/MoveInstanceMethodWizard.java | 339 + .../internal/ui/refactoring/MoveMembersWizard.java | 293 + .../ui/refactoring/ParameterEditDialog.java | 226 + .../internal/ui/refactoring/PromoteTempWizard.java | 234 + .../refactoring/PullPushCheckboxTableViewer.java | 71 + .../internal/ui/refactoring/PullUpMemberPage.java | 972 +++ .../internal/ui/refactoring/PullUpMethodPage.java | 562 ++ .../jsdt/internal/ui/refactoring/PullUpWizard.java | 45 + .../internal/ui/refactoring/PushDownWizard.java | 599 ++ .../ui/refactoring/QualifiedNameComponent.java | 70 + .../ui/refactoring/RefactoringAdapterFactory.java | 36 + .../ui/refactoring/RefactoringExecutionHelper.java | 211 + .../ui/refactoring/RefactoringMessages.java | 968 +++ .../ui/refactoring/RefactoringSaveHelper.java | 226 + .../ui/refactoring/RefactoringSavePreferences.java | 31 + .../ui/refactoring/TextInputWizardPage.java | 195 + .../ui/refactoring/UseSupertypeWizard.java | 320 + .../ui/refactoring/UserInterfaceManager.java | 66 + .../ui/refactoring/UserInterfaceStarter.java | 59 + .../ui/refactoring/VisibilityControlUtil.java | 79 + .../actions/ApplyRefactoringScriptAction.java | 59 + .../actions/CreateRefactoringScriptAction.java | 59 + .../refactoring/actions/InlineConstantAction.java | 155 + .../ui/refactoring/actions/InlineMethodAction.java | 149 + .../ui/refactoring/actions/ListDialog.java | 93 + .../actions/MoveInstanceMethodAction.java | 144 + .../actions/MoveStaticMembersAction.java | 130 + .../ui/refactoring/actions/RefactoringActions.java | 83 + .../ui/refactoring/actions/RefactoringStarter.java | 65 + .../actions/RenameJavaElementAction.java | 215 + .../refactoring/actions/RenameResourceAction.java | 57 + .../actions/ShowRefactoringHistoryAction.java | 59 + .../binary/BinaryRefactoringHistoryWizard.java | 731 ++ .../refactoring/code/ExtractMethodInputPage.java | 407 ++ .../ui/refactoring/code/ExtractMethodWizard.java | 45 + .../ui/refactoring/code/InlineMethodInputPage.java | 116 + .../ui/refactoring/code/InlineMethodWizard.java | 31 + .../code/ReplaceInvocationsInputPage.java | 152 + .../refactoring/code/ReplaceInvocationsWizard.java | 27 + .../CUPositionCompletionProcessor.java | 260 + .../contentassist/CompletionContextRequestor.java | 34 + .../contentassist/ControlContentAssistHelper.java | 67 + .../contentassist/FieldNameProcessor.java | 121 + .../JavaPackageCompletionProcessor.java | 155 + ...JavaPackageFragmentRootCompletionProcessor.java | 150 + ...urcePackageFragmentRootCompletionProcessor.java | 137 + .../contentassist/JavaTypeCompletionProcessor.java | 194 + .../contentassist/VariableNamesProcessor.java | 127 + .../ui/refactoring/nls/AccessorDescription.java | 146 + .../ui/refactoring/nls/ExternalizeWizard.java | 51 + .../ui/refactoring/nls/ExternalizeWizardPage.java | 1332 ++++ .../ui/refactoring/nls/MultiStateCellEditor.java | 85 + .../nls/NLSAccessorConfigurationDialog.java | 442 ++ .../internal/ui/refactoring/nls/NLSUIMessages.java | 110 + .../ui/refactoring/nls/NLSUIMessages.properties | 97 + .../ui/refactoring/nls/PackageBrowseAdapter.java | 144 + .../refactoring/nls/PackageFragmentSelection.java | 96 + .../nls/PackageSelectionDialogButtonField.java | 52 + .../nls/PackageSelectionStringButtonAdapter.java | 73 + .../ui/refactoring/nls/RenameKeysDialog.java | 106 + .../ui/refactoring/nls/SourceChangeListener.java | 18 + .../ui/refactoring/nls/SourceContainerDialog.java | 107 + .../SourceFirstPackageSelectionDialogField.java | 202 + .../SourceFolderSelectionDialogButtonField.java | 130 + .../nls/search/CompilationUnitEntry.java | 40 + .../ui/refactoring/nls/search/FileEntry.java | 45 + .../ui/refactoring/nls/search/LineReader.java | 68 + .../nls/search/NLSSearchEditorOpener.java | 34 + .../refactoring/nls/search/NLSSearchMessages.java | 43 + .../nls/search/NLSSearchMessages.properties | 25 + .../ui/refactoring/nls/search/NLSSearchQuery.java | 185 + .../ui/refactoring/nls/search/NLSSearchResult.java | 234 + .../nls/search/NLSSearchResultLabelProvider2.java | 65 + .../nls/search/NLSSearchResultPage.java | 108 + .../nls/search/NLSSearchResultRequestor.java | 377 + .../ui/refactoring/nls/search/Properties.java | 47 + .../nls/search/SearchBrokenNLSKeysUtil.java | 26 + .../ui/refactoring/refactoringui.properties | 618 ++ .../refactoring/reorg/CopyToClipboardAction.java | 357 + .../ui/refactoring/reorg/CreateTargetQueries.java | 45 + .../internal/ui/refactoring/reorg/CutAction.java | 105 + .../ui/refactoring/reorg/DeleteAction.java | 84 + .../reorg/DeleteUserInterfaceManager.java | 27 + .../ui/refactoring/reorg/DeleteWizard.java | 287 + .../reorg/DestinationContentProvider.java | 132 + .../ui/refactoring/reorg/NewNameQueries.java | 213 + .../internal/ui/refactoring/reorg/PasteAction.java | 1141 +++ .../ui/refactoring/reorg/RenameCuWizard.java | 68 + .../ui/refactoring/reorg/RenameFieldWizard.java | 221 + .../refactoring/reorg/RenameInformationPopup.java | 822 +++ .../refactoring/reorg/RenameInputWizardPage.java | 313 + .../refactoring/reorg/RenameJavaProjectWizard.java | 27 + .../ui/refactoring/reorg/RenameLinkedMode.java | 610 ++ .../reorg/RenameLocalVariableWizard.java | 27 + .../reorg/RenameMethodUserInterfaceStarter.java | 58 + .../ui/refactoring/reorg/RenameMethodWizard.java | 27 + .../ui/refactoring/reorg/RenamePackageWizard.java | 84 + .../refactoring/reorg/RenameRefactoringWizard.java | 111 + .../ui/refactoring/reorg/RenameResourceWizard.java | 27 + .../ui/refactoring/reorg/RenameSelectionState.java | 140 + .../reorg/RenameSourceFolderWizard.java | 27 + .../reorg/RenameTypeParameterWizard.java | 32 + .../ui/refactoring/reorg/RenameTypeWizard.java | 75 + .../reorg/RenameTypeWizardInputPage.java | 192 + ...nameTypeWizardSimilarElementsOptionsDialog.java | 165 + .../reorg/RenameTypeWizardSimilarElementsPage.java | 778 ++ .../reorg/RenameUserInterfaceManager.java | 45 + .../reorg/RenameUserInterfaceStarter.java | 37 + .../ui/refactoring/reorg/ReorgCopyAction.java | 89 + .../ui/refactoring/reorg/ReorgCopyStarter.java | 71 + .../ui/refactoring/reorg/ReorgCopyWizard.java | 73 + .../ui/refactoring/reorg/ReorgMessages.java | 168 + .../ui/refactoring/reorg/ReorgMessages.properties | 176 + .../ui/refactoring/reorg/ReorgMoveAction.java | 103 + .../ui/refactoring/reorg/ReorgMoveStarter.java | 91 + .../ui/refactoring/reorg/ReorgMoveWizard.java | 262 + .../ui/refactoring/reorg/ReorgQueries.java | 418 ++ .../ui/refactoring/reorg/ReorgUserInputPage.java | 146 + .../ui/refactoring/reorg/TypedSourceTransfer.java | 134 + .../sef/SelfEncapsulateFieldInputPage.java | 330 + .../sef/SelfEncapsulateFieldWizard.java | 31 + .../ui/search/BreakContinueTargetFinder.java | 281 + .../ui/search/ExceptionOccurrencesFinder.java | 252 + .../ui/search/ExceptionOccurrencesGroupKey.java | 34 + .../internal/ui/search/FindOccurrencesEngine.java | 115 + .../wst/jsdt/internal/ui/search/GroupAction.java | 34 + .../internal/ui/search/IOccurrencesFinder.java | 57 + .../ui/search/ImplementOccurrencesFinder.java | 168 + .../jsdt/internal/ui/search/JavaElementLine.java | 41 + .../jsdt/internal/ui/search/JavaElementMatch.java | 59 + .../jsdt/internal/ui/search/JavaMatchFilter.java | 507 ++ .../ui/search/JavaSearchContentProvider.java | 50 + .../internal/ui/search/JavaSearchEditorOpener.java | 151 + .../jsdt/internal/ui/search/JavaSearchPage.java | 976 +++ .../ui/search/JavaSearchPageScoreComputer.java | 30 + .../jsdt/internal/ui/search/JavaSearchQuery.java | 261 + .../jsdt/internal/ui/search/JavaSearchResult.java | 214 + .../internal/ui/search/JavaSearchResultPage.java | 547 ++ .../internal/ui/search/JavaSearchScopeFactory.java | 436 ++ .../ui/search/JavaSearchTableContentProvider.java | 93 + .../internal/ui/search/LRUWorkingSetsList.java | 81 + .../ui/search/LevelTreeContentProvider.java | 251 + .../jsdt/internal/ui/search/MethodExitsFinder.java | 239 + .../ui/search/NewSearchResultCollector.java | 69 + .../ui/search/NewSearchViewActionGroup.java | 49 + .../jsdt/internal/ui/search/OccurrencesFinder.java | 295 + .../internal/ui/search/OccurrencesGroupKey.java | 46 + .../ui/search/OccurrencesSearchLabelProvider.java | 47 + .../internal/ui/search/OccurrencesSearchQuery.java | 108 + .../ui/search/OccurrencesSearchResult.java | 168 + .../ui/search/OccurrencesSearchResultPage.java | 95 + .../ui/search/OpenJavaSearchPageAction.java | 59 + .../jsdt/internal/ui/search/PatternStrings.java | 89 + .../internal/ui/search/PostfixLabelProvider.java | 95 + .../internal/ui/search/SearchLabelProvider.java | 238 + .../jsdt/internal/ui/search/SearchMessages.java | 250 + .../internal/ui/search/SearchMessages.properties | 312 + .../ui/search/SearchParticipantDescriptor.java | 87 + .../ui/search/SearchParticipantRecord.java | 39 + .../search/SearchParticipantsExtensionPoint.java | 98 + .../internal/ui/search/SearchResultUpdater.java | 159 + .../wst/jsdt/internal/ui/search/SearchUtil.java | 236 + .../wst/jsdt/internal/ui/search/SortAction.java | 38 + .../internal/ui/search/SortingLabelProvider.java | 101 + .../ui/search/TextSearchLabelProvider.java | 38 + .../ui/search/TextSearchTableContentProvider.java | 74 + .../internal/ui/search/WorkingSetComparator.java | 38 + .../internal/ui/search/WorkingSetsComparator.java | 44 + .../ui/text/AbstractInformationControl.java | 775 ++ .../jsdt/internal/ui/text/AbstractJavaScanner.java | 356 + .../internal/ui/text/BufferedDocumentScanner.java | 176 + .../ui/text/ChangeHoverInformationControl.java | 222 + .../jsdt/internal/ui/text/CombinedWordRule.java | 371 + .../ui/text/CompositeReconcilingStrategy.java | 117 + .../internal/ui/text/ContentAssistPreference.java | 233 + .../ui/text/DocumentCharacterIterator.java | 222 + .../internal/ui/text/FastJavaPartitionScanner.java | 572 ++ .../jsdt/internal/ui/text/HTMLAnnotationHover.java | 56 + .../internal/ui/text/ISourceVersionDependent.java | 30 + .../jsdt/internal/ui/text/ITypingRunListener.java | 36 + .../jsdt/internal/ui/text/JavaBreakIterator.java | 420 ++ .../wst/jsdt/internal/ui/text/JavaChangeHover.java | 148 + .../wst/jsdt/internal/ui/text/JavaCodeReader.java | 239 + .../jsdt/internal/ui/text/JavaColorManager.java | 141 + .../jsdt/internal/ui/text/JavaCommentScanner.java | 294 + .../ui/text/JavaCompositeReconcilingStrategy.java | 138 + .../jsdt/internal/ui/text/JavaElementProvider.java | 89 + .../internal/ui/text/JavaHeuristicScanner.java | 950 +++ .../wst/jsdt/internal/ui/text/JavaIndenter.java | 1649 +++++ .../ui/text/JavaOutlineInformationControl.java | 755 ++ .../wst/jsdt/internal/ui/text/JavaPairMatcher.java | 155 + .../internal/ui/text/JavaPartitionScanner.java | 124 + .../ui/text/JavaPresentationReconciler.java | 49 + .../wst/jsdt/internal/ui/text/JavaReconciler.java | 416 ++ .../internal/ui/text/JavaWhitespaceDetector.java | 27 + .../jsdt/internal/ui/text/JavaWordDetector.java | 34 + .../wst/jsdt/internal/ui/text/JavaWordFinder.java | 63 + .../jsdt/internal/ui/text/JavaWordIterator.java | 223 + .../jsdt/internal/ui/text/LineBreakingReader.java | 132 + .../jsdt/internal/ui/text/PreferencesAdapter.java | 330 + .../ui/text/SequenceCharacterIterator.java | 167 + .../text/SimpleJavaSourceViewerConfiguration.java | 142 + .../internal/ui/text/SingleTokenJavaScanner.java | 50 + .../internal/ui/text/SmartBackspaceManager.java | 275 + .../eclipse/wst/jsdt/internal/ui/text/Symbols.java | 55 + .../wst/jsdt/internal/ui/text/TextMessages.java | 39 + .../jsdt/internal/ui/text/TextMessages.properties | 25 + .../wst/jsdt/internal/ui/text/TypingRun.java | 103 + .../jsdt/internal/ui/text/TypingRunDetector.java | 469 ++ .../ui/text/comment/CommentFormattingContext.java | 57 + .../ui/text/comment/CommentFormattingStrategy.java | 373 + .../internal/ui/text/correction/ASTResolving.java | 930 +++ .../correction/ASTRewriteCorrectionProposal.java | 111 + .../AbstractMethodCompletionProposal.java | 200 + .../correction/AddArgumentCorrectionProposal.java | 127 + .../correction/AddImportCorrectionProposal.java | 52 + .../correction/AdvancedQuickAssistProcessor.java | 2172 ++++++ .../correction/AssignToVariableAssistProposal.java | 342 + .../internal/ui/text/correction/AssistContext.java | 102 + .../ui/text/correction/CUCorrectionProposal.java | 584 ++ .../text/correction/ChangeCorrectionProposal.java | 280 + .../correction/ChangeMethodSignatureProposal.java | 481 ++ .../ConstructorFromSuperclassProposal.java | 230 + .../correction/ContributedProcessorDescriptor.java | 137 + .../correction/CorrectMainTypeNameProposal.java | 81 + .../text/correction/CorrectionCommandHandler.java | 156 + .../correction/CorrectionCommandInstaller.java | 79 + .../CorrectionMarkerResolutionGenerator.java | 590 ++ .../ui/text/correction/CorrectionMessages.java | 315 + .../text/correction/CorrectionMessages.properties | 353 + .../ui/text/correction/FixCorrectionProposal.java | 201 + .../ui/text/correction/ICommandAccess.java | 26 + .../ui/text/correction/IStatusLineProposal.java | 30 + .../text/correction/JavaCorrectionAssistant.java | 329 + .../text/correction/JavaCorrectionProcessor.java | 513 ++ .../text/correction/JavadocTagsSubProcessor.java | 517 ++ .../text/correction/LinkedCorrectionProposal.java | 95 + .../text/correction/LinkedNamesAssistProposal.java | 288 + .../correction/LocalCorrectionsSubProcessor.java | 896 +++ .../text/correction/MarkerResolutionProposal.java | 114 + .../MissingReturnTypeCorrectionProposal.java | 168 + .../ModifierChangeCompletionProposal.java | 93 + .../correction/ModifierCorrectionSubProcessor.java | 1073 +++ .../internal/ui/text/correction/NameMatcher.java | 69 + .../NewCUCompletionUsingWizardProposal.java | 395 + .../text/correction/NewDefiningMethodProposal.java | 119 + .../correction/NewMethodCompletionProposal.java | 239 + .../correction/NewVariableCompletionProposal.java | 483 ++ .../ui/text/correction/ProblemLocation.java | 174 + .../correction/QuickAssistLightBulbUpdater.java | 281 + .../ui/text/correction/QuickAssistProcessor.java | 1366 ++++ .../ui/text/correction/QuickFixProcessor.java | 449 ++ .../ui/text/correction/QuickTemplateProcessor.java | 195 + .../RemoveDeclarationCorrectionProposal.java | 237 + .../correction/RenameNodeCompletionProposal.java | 65 + .../correction/ReorgCorrectionsSubProcessor.java | 512 ++ .../text/correction/ReplaceCorrectionProposal.java | 44 + .../ui/text/correction/ReturnTypeSubProcessor.java | 315 + .../ui/text/correction/SimilarElement.java | 82 + .../text/correction/SimilarElementsRequestor.java | 219 + .../internal/ui/text/correction/SurroundWith.java | 563 ++ .../ui/text/correction/TaskMarkerProposal.java | 152 + .../correction/TypeChangeCompletionProposal.java | 161 + .../text/correction/TypeMismatchSubProcessor.java | 294 + .../UnimplementedMethodsCompletionProposal.java | 109 + .../correction/UnresolvedElementsSubProcessor.java | 1464 ++++ .../folding/DefaultJavaFoldingPreferenceBlock.java | 153 + .../folding/EmptyJavaFoldingPreferenceBlock.java | 79 + .../internal/ui/text/folding/FoldingMessages.java | 38 + .../ui/text/folding/FoldingMessages.properties | 22 + .../JavaFoldingStructureProviderDescriptor.java | 115 + .../JavaFoldingStructureProviderRegistry.java | 139 + .../ui/text/html/BrowserInformationControl.java | 591 ++ .../internal/ui/text/html/HTML2TextReader.java | 330 + .../jsdt/internal/ui/text/html/HTMLMessages.java | 83 + .../internal/ui/text/html/HTMLMessages.properties | 16 + .../jsdt/internal/ui/text/html/HTMLPrinter.java | 306 + .../internal/ui/text/html/HTMLTextPresenter.java | 315 + .../internal/ui/text/html/SingleCharReader.java | 67 + .../ui/text/html/SubstitutionTextReader.java | 162 + .../text/java/AbstractJavaCompletionProposal.java | 1037 +++ .../internal/ui/text/java/AlphabeticSorter.java | 37 + .../text/java/AnonymousTypeCompletionProposal.java | 261 + .../ui/text/java/AnonymousTypeProposalInfo.java | 49 + .../ui/text/java/CompletionProposalCategory.java | 327 + .../java/CompletionProposalComputerDescriptor.java | 547 ++ .../java/CompletionProposalComputerRegistry.java | 388 + .../text/java/ContentAssistComputerParameter.java | 38 + .../ui/text/java/ContentAssistHistory.java | 481 ++ .../ui/text/java/ContentAssistProcessor.java | 559 ++ .../internal/ui/text/java/FieldProposalInfo.java | 68 + .../java/FilledArgumentNamesMethodProposal.java | 168 + .../text/java/GetterSetterCompletionProposal.java | 144 + .../ui/text/java/HippieProposalComputer.java | 69 + .../ui/text/java/IJavaReconcilingListener.java | 37 + .../ui/text/java/IProblemRequestorExtension.java | 59 + .../ui/text/java/IReconcilingParticipant.java | 27 + .../ui/text/java/ImportCompletionProposal.java | 206 + .../ui/text/java/JavaAutoIndentStrategy.java | 1362 ++++ .../internal/ui/text/java/JavaCodeScanner.java | 561 ++ .../ui/text/java/JavaCompletionProcessor.java | 93 + .../ui/text/java/JavaCompletionProposal.java | 122 + .../text/java/JavaCompletionProposalComputer.java | 247 + .../ui/text/java/JavaContentAssistHandler.java | 64 + .../ui/text/java/JavaDoubleClickSelector.java | 340 + .../ui/text/java/JavaFormattingStrategy.java | 100 + .../ui/text/java/JavaMethodCompletionProposal.java | 246 + .../java/JavaNoTypeCompletionProposalComputer.java | 77 + .../ui/text/java/JavaParameterListValidator.java | 318 + .../ui/text/java/JavaReconcilingStrategy.java | 191 + .../ui/text/java/JavaStringAutoIndentStrategy.java | 199 + .../text/java/JavaStringDoubleClickSelector.java | 70 + .../internal/ui/text/java/JavaTextMessages.java | 69 + .../ui/text/java/JavaTextMessages.properties | 69 + .../ui/text/java/JavaTypeCompletionProposal.java | 120 + .../java/JavaTypeCompletionProposalComputer.java | 190 + .../ui/text/java/JavadocDoubleClickStrategy.java | 249 + .../ui/text/java/LazyGenericTypeProposal.java | 455 ++ .../ui/text/java/LazyJavaCompletionProposal.java | 428 ++ .../text/java/LazyJavaTypeCompletionProposal.java | 372 + .../ui/text/java/LocalVariableProposalInfo.java | 62 + .../internal/ui/text/java/MemberProposalInfo.java | 70 + .../java/MethodDeclarationCompletionProposal.java | 181 + .../internal/ui/text/java/MethodProposalInfo.java | 233 + .../ui/text/java/OverrideCompletionProposal.java | 174 + .../internal/ui/text/java/ParameterGuesser.java | 654 ++ .../ui/text/java/ParameterGuessingProposal.java | 318 + .../ui/text/java/ProposalContextInformation.java | 105 + .../jsdt/internal/ui/text/java/ProposalInfo.java | 163 + .../ui/text/java/ProposalSorterHandle.java | 280 + .../ui/text/java/ProposalSorterRegistry.java | 123 + .../internal/ui/text/java/RelevanceSorter.java | 37 + .../text/java/SmartSemicolonAutoEditStrategy.java | 1012 +++ .../java/TemplateCompletionProposalComputer.java | 208 + .../internal/ui/text/java/TypeProposalInfo.java | 53 + .../text/java/hover/AbstractAnnotationHover.java | 176 + .../java/hover/AbstractJavaEditorTextHover.java | 187 + .../ui/text/java/hover/AnnotationExpandHover.java | 308 + .../java/hover/AnnotationExpansionControl.java | 844 +++ .../ui/text/java/hover/AnnotationHover.java | 25 + .../ui/text/java/hover/BestMatchHover.java | 162 + .../java/hover/JavaEditorTextHoverDescriptor.java | 293 + .../text/java/hover/JavaEditorTextHoverProxy.java | 123 + .../ui/text/java/hover/JavaExpandHover.java | 205 + .../ui/text/java/hover/JavaHoverMessages.java | 39 + .../text/java/hover/JavaHoverMessages.properties | 23 + .../text/java/hover/JavaInformationProvider.java | 183 + .../ui/text/java/hover/JavaSourceHover.java | 141 + .../internal/ui/text/java/hover/JavaTypeHover.java | 54 + .../internal/ui/text/java/hover/JavadocHover.java | 256 + .../ui/text/java/hover/NLSStringHover.java | 157 + .../internal/ui/text/java/hover/ProblemHover.java | 29 + .../java/hover/SourceViewerInformationControl.java | 458 ++ .../javadoc/HTMLTagCompletionProposalComputer.java | 250 + .../ui/text/javadoc/IHtmlTagConstants.java | 49 + .../ui/text/javadoc/IJavaDocTagConstants.java | 38 + .../ui/text/javadoc/JavaDoc2HTMLTextReader.java | 371 + .../ui/text/javadoc/JavaDocAutoIndentStrategy.java | 435 ++ .../internal/ui/text/javadoc/JavaDocMessages.java | 36 + .../ui/text/javadoc/JavaDocMessages.properties | 18 + .../internal/ui/text/javadoc/JavaDocScanner.java | 214 + .../text/javadoc/JavadocCompletionProcessor.java | 61 + .../javadoc/JavadocCompletionProposalComputer.java | 46 + .../JavadocContentAssistInvocationContext.java | 73 + .../JavadocInlineTagCompletionProposal.java | 61 + .../javadoc/JavadocLinkTypeCompletionProposal.java | 64 + .../LegacyJavadocCompletionProposalComputer.java | 157 + .../internal/ui/text/javadoc/OAADocReader.java | 121 + .../spelling/JavaSpellingReconcileStrategy.java | 91 + .../text/spelling/SpellingQuickFixProcessor.java | 228 + .../spelling/engine/AbstractSpellDictionary.java | 615 ++ .../engine/DefaultPhoneticDistanceAlgorithm.java | 103 + .../engine/DefaultPhoneticHashProvider.java | 683 ++ .../text/spelling/engine/DefaultSpellChecker.java | 375 + .../engine/IPhoneticDistanceAlgorithm.java | 31 + .../spelling/engine/IPhoneticHashProvider.java | 36 + .../ui/text/spelling/engine/ISpellCheckEngine.java | 82 + .../text/spelling/engine/ISpellCheckIterator.java | 52 + .../ui/text/spelling/engine/ISpellChecker.java | 126 + .../ui/text/spelling/engine/ISpellDictionary.java | 77 + .../ui/text/spelling/engine/ISpellEvent.java | 64 + .../text/spelling/engine/ISpellEventListener.java | 29 + .../engine/LocaleSensitiveSpellDictionary.java | 59 + .../spelling/engine/PersistentSpellDictionary.java | 99 + .../text/spelling/engine/RankedWordProposal.java | 102 + .../ui/text/spelling/engine/SpellEvent.java | 109 + .../contentassist/InclusivePositionUpdater.java | 103 + .../text/template/contentassist/MultiVariable.java | 133 + .../template/contentassist/MultiVariableGuess.java | 283 + .../PositionBasedCompletionProposal.java | 197 + .../SurroundWithTemplateProposal.java | 267 + .../TemplateContentAssistMessages.java | 32 + .../TemplateContentAssistMessages.properties | 17 + .../template/contentassist/TemplateEngine.java | 164 + .../TemplateInformationControlCreator.java | 69 + .../template/contentassist/TemplateProposal.java | 537 ++ .../template/contentassist/VariablePosition.java | 74 + .../preferences/TemplateContentProvider.java | 44 + .../preferences/TemplatePreferencesMessages.java | 31 + .../TemplatePreferencesMessages.properties | 12 + .../preferences/TemplateVariableProcessor.java | 167 + .../preferences/TemplateVariableProposal.java | 114 + .../AbstractHierarchyViewerSorter.java | 148 + .../ui/typehierarchy/EnableMemberFilterAction.java | 51 + .../ui/typehierarchy/FocusOnSelectionAction.java | 70 + .../ui/typehierarchy/FocusOnTypeAction.java | 61 + .../typehierarchy/HierarchyInformationControl.java | 369 + .../ui/typehierarchy/HierarchyLabelProvider.java | 182 + .../ui/typehierarchy/HierarchyViewerSorter.java | 64 + .../internal/ui/typehierarchy/HistoryAction.java | 58 + .../ui/typehierarchy/HistoryDropDownAction.java | 105 + .../ui/typehierarchy/HistoryListAction.java | 181 + .../ITypeHierarchyLifeCycleListener.java | 27 + .../ui/typehierarchy/MethodsContentProvider.java | 131 + .../ui/typehierarchy/MethodsLabelProvider.java | 147 + .../internal/ui/typehierarchy/MethodsViewer.java | 313 + .../typehierarchy/ShowInheritedMembersAction.java | 54 + .../ShowQualifiedTypeNamesAction.java | 50 + .../ui/typehierarchy/SortByDefiningTypeAction.java | 53 + .../ui/typehierarchy/SubTypeHierarchyViewer.java | 97 + .../ui/typehierarchy/SuperTypeHierarchyViewer.java | 80 + .../ui/typehierarchy/ToggleLinkingAction.java | 42 + .../ui/typehierarchy/ToggleOrientationAction.java | 71 + .../ui/typehierarchy/ToggleViewAction.java | 69 + .../typehierarchy/TraditionalHierarchyViewer.java | 151 + .../TypeHierarchyContentProvider.java | 353 + .../ui/typehierarchy/TypeHierarchyLifeCycle.java | 274 + .../ui/typehierarchy/TypeHierarchyMessages.java | 99 + .../typehierarchy/TypeHierarchyMessages.properties | 109 + .../TypeHierarchyTransferDropAdapter.java | 69 + .../ui/typehierarchy/TypeHierarchyViewPart.java | 1646 +++++ .../ui/typehierarchy/TypeHierarchyViewer.java | 194 + .../ui/util/BusyIndicatorRunnableContext.java | 132 + .../wst/jsdt/internal/ui/util/ConvertAction.java | 264 + .../wst/jsdt/internal/ui/util/CoreUtility.java | 208 + .../jsdt/internal/ui/util/ElementValidator.java | 203 + .../jsdt/internal/ui/util/ExceptionHandler.java | 134 + .../wst/jsdt/internal/ui/util/JSDScopeUiUtil.java | 82 + .../wst/jsdt/internal/ui/util/JavaUIHelp.java | 133 + .../jsdt/internal/ui/util/JavadocHelpContext.java | 242 + .../internal/ui/util/OpenTypeHierarchyUtil.java | 131 + .../jsdt/internal/ui/util/PatternConstructor.java | 129 + .../wst/jsdt/internal/ui/util/PixelConverter.java | 28 + .../wst/jsdt/internal/ui/util/RowLayouter.java | 184 + .../eclipse/wst/jsdt/internal/ui/util/SWTUtil.java | 109 + .../wst/jsdt/internal/ui/util/SelectionUtil.java | 122 + .../wst/jsdt/internal/ui/util/StringMatcher.java | 384 + .../internal/ui/util/TableLayoutComposite.java | 186 + .../ui/util/TypeNameMatchLabelProvider.java | 120 + .../wst/jsdt/internal/ui/util/ViewerPane.java | 73 + .../viewsupport/AppearanceAwareLabelProvider.java | 120 + .../ui/viewsupport/BindingLabelProvider.java | 424 ++ .../ui/viewsupport/ColoredJavaElementLabels.java | 895 +++ .../internal/ui/viewsupport/ColoredString.java | 173 + .../ui/viewsupport/ColoredViewersManager.java | 218 + .../viewsupport/DecoratingJavaLabelProvider.java | 101 + .../internal/ui/viewsupport/FilterUpdater.java | 78 + .../ui/viewsupport/HistoryDropDownAction.java | 153 + .../internal/ui/viewsupport/HistoryListAction.java | 242 + .../ui/viewsupport/IProblemChangedListener.java | 31 + .../ui/viewsupport/IRichLabelProvider.java | 19 + .../ui/viewsupport/ISelectionListenerWithAST.java | 35 + .../ui/viewsupport/IViewPartInputProvider.java | 25 + .../ui/viewsupport/ImageDescriptorRegistry.java | 91 + .../internal/ui/viewsupport/ImageDisposer.java | 46 + .../ui/viewsupport/ImageImageDescriptor.java | 52 + .../ui/viewsupport/JavaElementImageProvider.java | 399 + .../ui/viewsupport/JavaUILabelProvider.java | 278 + .../internal/ui/viewsupport/JavaViewerFilter.java | 56 + .../ui/viewsupport/LabelProviderDisposer.java | 35 + .../internal/ui/viewsupport/LibraryFilter.java | 33 + .../jsdt/internal/ui/viewsupport/MemberFilter.java | 104 + .../ui/viewsupport/MemberFilterAction.java | 49 + .../internal/ui/viewsupport/OwnerDrawSupport.java | 163 + .../ui/viewsupport/ProblemMarkerManager.java | 180 + .../ui/viewsupport/ProblemTableViewer.java | 141 + .../internal/ui/viewsupport/ProblemTreeViewer.java | 328 + .../ui/viewsupport/ProjectTemplateStore.java | 172 + .../ui/viewsupport/ResourceToItemsMapper.java | 179 + .../SelectionListenerWithASTManager.java | 226 + .../ui/viewsupport/SelectionProviderMediator.java | 206 + .../ui/viewsupport/SourcePositionComparator.java | 113 + .../internal/ui/viewsupport/StatusBarUpdater.java | 106 + .../ui/viewsupport/StorageLabelProvider.java | 136 + .../TreeHierarchyLayoutProblemsDecorator.java | 74 + .../jsdt/internal/ui/viewsupport/ViewHistory.java | 103 + .../internal/ui/wizards/ClassPathDetector.java | 238 + .../internal/ui/wizards/IStatusChangeListener.java | 23 + .../internal/ui/wizards/JavaProjectWizard.java | 188 + .../ui/wizards/JavaProjectWizardFirstPage.java | 725 ++ .../ui/wizards/JavaProjectWizardSecondPage.java | 462 ++ .../ui/wizards/NewClassCreationWizard.java | 91 + .../jsdt/internal/ui/wizards/NewElementWizard.java | 168 + .../internal/ui/wizards/NewJSFileWizardPage.java | 323 + .../wst/jsdt/internal/ui/wizards/NewJSWizard.java | 94 + .../ui/wizards/NewSourceFolderWizardPage.java | 510 ++ .../internal/ui/wizards/NewWizardMessages.java | 686 ++ .../ui/wizards/NewWizardMessages.properties | 904 +++ .../OpenJavaScriptFileWizardToolbarAction.java | 62 + .../OpenJavaScriptProjectWizardToolbarAction.java | 56 + .../ui/wizards/TypedElementSelectionValidator.java | 100 + .../internal/ui/wizards/TypedViewerFilter.java | 64 + .../wizards/buildpaths/AccessRuleEntryDialog.java | 173 + .../ui/wizards/buildpaths/AccessRulesDialog.java | 361 + .../buildpaths/AccessRulesLabelProvider.java | 78 + .../wizards/buildpaths/AddSourceFolderWizard.java | 117 + .../buildpaths/AddSourceFolderWizardPage.java | 732 ++ .../ui/wizards/buildpaths/ArchiveFileFilter.java | 110 + .../ui/wizards/buildpaths/BuildPathBasePage.java | 167 + .../ui/wizards/buildpaths/BuildPathSupport.java | 303 + .../ui/wizards/buildpaths/BuildPathWizard.java | 104 + .../ui/wizards/buildpaths/BuildPathsBlock.java | 1018 +++ .../ui/wizards/buildpaths/CPListElement.java | 828 +++ .../wizards/buildpaths/CPListElementAttribute.java | 148 + .../ui/wizards/buildpaths/CPListElementSorter.java | 98 + .../ui/wizards/buildpaths/CPListLabelProvider.java | 360 + .../wizards/buildpaths/CPUserLibraryElement.java | 165 + ...ClasspathAttributeConfigurationDescriptors.java | 122 + .../buildpaths/ClasspathOrderingWorkbookPage.java | 233 + .../CreateMultipleSourceFoldersDialog.java | 298 + .../ui/wizards/buildpaths/EditFilterWizard.java | 62 + .../buildpaths/ExclusionInclusionDialog.java | 314 + .../buildpaths/ExclusionInclusionEntryDialog.java | 285 + .../wizards/buildpaths/FolderSelectionDialog.java | 115 + .../wizards/buildpaths/JARFileSelectionDialog.java | 186 + .../buildpaths/JavadocAttributeConfiguration.java | 116 + .../wizards/buildpaths/JavadocLocationDialog.java | 85 + .../JsGlobalScopeContainerDefaultPage.java | 142 + .../JsGlobalScopeContainerDescriptor.java | 133 + .../JsGlobalScopeContainerSelectionPage.java | 157 + .../buildpaths/JsGlobalScopeContainerWizard.java | 212 + .../wizards/buildpaths/LibrariesWorkbookPage.java | 863 +++ .../buildpaths/MultipleFolderSelectionDialog.java | 312 + .../ui/wizards/buildpaths/NewContainerDialog.java | 158 + .../wizards/buildpaths/NewSourceFolderDialog.java | 194 + .../wizards/buildpaths/ProjectsWorkbookPage.java | 473 ++ .../ui/wizards/buildpaths/SetFilterWizardPage.java | 333 + .../wizards/buildpaths/SourceAttachmentBlock.java | 583 ++ .../wizards/buildpaths/SourceAttachmentDialog.java | 89 + .../buildpaths/SourceContainerWorkbookPage.java | 919 +++ .../UserLibraryMarkerResolutionGenerator.java | 254 + .../wizards/buildpaths/UserLibraryWizardPage.java | 326 + .../newsourcepage/AddFolderToBuildpathAction.java | 226 + .../newsourcepage/BuildpathModifierAction.java | 189 + .../ClasspathModifierDropDownAction.java | 178 + .../newsourcepage/ClasspathModifierQueries.java | 342 + .../CreateLinkedSourceFolderAction.java | 117 + .../CreateLinkedSourceFolderAction2.java | 35 + .../newsourcepage/CreateSourceFolderAction.java | 120 + .../newsourcepage/CreateSourceFolderAction2.java | 36 + .../newsourcepage/DialogPackageExplorer.java | 451 ++ .../DialogPackageExplorerActionGroup.java | 292 + .../buildpaths/newsourcepage/EditFilterAction.java | 154 + .../newsourcepage/ExcludeFromBuildpathAction.java | 175 + .../buildpaths/newsourcepage/HelpAction.java | 34 + .../buildpaths/newsourcepage/HintTextGroup.java | 318 + .../newsourcepage/IncludeToBuildpathAction.java | 171 + .../buildpaths/newsourcepage/LinkFolderDialog.java | 515 ++ .../NewSourceContainerWorkbookPage.java | 334 + .../newsourcepage/RemoveFromBuildpathAction.java | 263 + .../newsourcepage/RemoveLinkedFolderDialog.java | 96 + .../buildpaths/newsourcepage/ResetAllAction.java | 177 + .../dialogfields/CheckedListDialogField.java | 284 + .../ui/wizards/dialogfields/ComboDialogField.java | 252 + .../ui/wizards/dialogfields/DialogField.java | 239 + .../wizards/dialogfields/IDialogFieldListener.java | 23 + .../ui/wizards/dialogfields/IListAdapter.java | 33 + .../wizards/dialogfields/IStringButtonAdapter.java | 20 + .../ui/wizards/dialogfields/ITreeListAdapter.java | 46 + .../ui/wizards/dialogfields/LayoutUtil.java | 132 + .../ui/wizards/dialogfields/ListDialogField.java | 942 +++ .../ObjectStringStatusButtonDialogField.java | 73 + .../dialogfields/SelectionButtonDialogField.java | 209 + .../SelectionButtonDialogFieldGroup.java | 274 + .../ui/wizards/dialogfields/Separator.java | 93 + .../dialogfields/StringButtonDialogField.java | 141 + .../StringButtonStatusDialogField.java | 180 + .../ui/wizards/dialogfields/StringDialogField.java | 190 + .../wizards/dialogfields/TreeListDialogField.java | 909 +++ .../workingsets/AbstractWorkingSetWizardPage.java | 136 + .../ui/workingsets/ClearWorkingSetAction.java | 42 + .../ui/workingsets/ConfigureWorkingSetAction.java | 52 + .../ConfigureWorkingSetAssignementAction.java | 573 ++ .../ui/workingsets/EditWorkingSetAction.java | 89 + .../internal/ui/workingsets/EditorTracker.java | 71 + .../ui/workingsets/IWorkingSetActionGroup.java | 23 + .../workingsets/JavaWorkingSetElementAdapter.java | 73 + .../ui/workingsets/JavaWorkingSetPage.java | 480 ++ .../JavaWorkingSetPageContentProvider.java | 57 + .../ui/workingsets/JavaWorkingSetUpdater.java | 242 + .../wst/jsdt/internal/ui/workingsets/Mementos.java | 48 + .../OpenPropertiesWorkingSetAction.java | 55 + .../ui/workingsets/OthersWorkingSetUpdater.java | 204 + .../workingsets/RemoveWorkingSetElementAction.java | 82 + .../ui/workingsets/SelectWorkingSetAction.java | 85 + .../SimpleWorkingSetSelectionDialog.java | 335 + .../jsdt/internal/ui/workingsets/ViewAction.java | 35 + .../internal/ui/workingsets/ViewActionGroup.java | 177 + .../workingsets/WorkingSetConfigurationBlock.java | 403 ++ .../workingsets/WorkingSetConfigurationDialog.java | 609 ++ .../internal/ui/workingsets/WorkingSetFilter.java | 222 + .../workingsets/WorkingSetFilterActionGroup.java | 355 + .../WorkingSetMenuContributionItem.java | 101 + .../ui/workingsets/WorkingSetMessages.java | 87 + .../ui/workingsets/WorkingSetMessages.properties | 79 + .../internal/ui/workingsets/WorkingSetModel.java | 456 ++ .../ui/workingsets/WorkingSetShowActionGroup.java | 76 + .../BasicBrowserLibraryContainerUIExtension.java | 37 + .../wst/jsdt/libraries/internal_browser.gif | Bin 0 -> 587 bytes .../org/eclipse/wst/jsdt/ui/CodeGeneration.java | 336 + .../wst/jsdt/ui/CodeStyleConfiguration.java | 96 + .../eclipse/wst/jsdt/ui/IContextMenuConstants.java | 149 + .../eclipse/wst/jsdt/ui/IDocumentationReader.java | 40 + .../jsdt/ui/IJavaScriptElementSearchConstants.java | 93 + .../org/eclipse/wst/jsdt/ui/IPackagesViewPart.java | 56 + .../src/org/eclipse/wst/jsdt/ui/ISharedImages.java | 317 + .../wst/jsdt/ui/ITypeHierarchyViewPart.java | 204 + .../eclipse/wst/jsdt/ui/IWorkingCopyManager.java | 88 + .../wst/jsdt/ui/IWorkingCopyManagerExtension.java | 48 + .../eclipse/wst/jsdt/ui/IWorkingCopyProvider.java | 38 + .../eclipse/wst/jsdt/ui/JSdocContentAccess.java | 372 + .../org/eclipse/wst/jsdt/ui/JavaElementSorter.java | 66 + .../wst/jsdt/ui/JavaScriptElementComparator.java | 358 + .../jsdt/ui/JavaScriptElementImageDescriptor.java | 297 + .../jsdt/ui/JavaScriptElementLabelProvider.java | 268 + .../wst/jsdt/ui/JavaScriptElementLabels.java | 1200 ++++ .../wst/jsdt/ui/JavaScriptLibrariesAction.java | 97 + .../wst/jsdt/ui/JavaScriptSourceFoldersAction.java | 44 + .../wst/jsdt/ui/JavaScriptSuperTypeAction.java | 44 + .../src/org/eclipse/wst/jsdt/ui/JavaScriptUI.java | 753 ++ .../src/org/eclipse/wst/jsdt/ui/Messages.java | 42 + .../jsdt/ui/OverrideIndicatorLabelDecorator.java | 237 + .../eclipse/wst/jsdt/ui/PreferenceConstants.java | 3772 ++++++++++ .../wst/jsdt/ui/ProblemsLabelDecorator.java | 398 + .../eclipse/wst/jsdt/ui/ProjectLibraryRoot.java | 181 + .../StandardJavaScriptElementContentProvider.java | 509 ++ .../jsdt/ui/actions/AbstractOpenWizardAction.java | 179 + .../jsdt/ui/actions/AddDelegateMethodsAction.java | 596 ++ .../wst/jsdt/ui/actions/AddGetterSetterAction.java | 1083 +++ .../wst/jsdt/ui/actions/AddJavaDocStubAction.java | 223 + .../wst/jsdt/ui/actions/AddToClasspathAction.java | 166 + .../AddUnimplementedConstructorsAction.java | 597 ++ .../wst/jsdt/ui/actions/BuildActionGroup.java | 133 + .../wst/jsdt/ui/actions/CCPActionGroup.java | 176 + .../wst/jsdt/ui/actions/ChangeTypeAction.java | 157 + .../ui/actions/ConvertAnonymousToNestedAction.java | 161 + .../jsdt/ui/actions/ConvertLocalToFieldAction.java | 91 + .../jsdt/ui/actions/ConvertNestedToTopAction.java | 167 + .../ui/actions/ConvertingSelectionProvider.java | 177 + .../jsdt/ui/actions/CustomFiltersActionGroup.java | 757 ++ .../jsdt/ui/actions/DeclarationsSearchGroup.java | 207 + .../jsdt/ui/actions/ExternalizeStringsAction.java | 541 ++ .../wst/jsdt/ui/actions/ExtractConstantAction.java | 86 + .../wst/jsdt/ui/actions/ExtractMethodAction.java | 88 + .../wst/jsdt/ui/actions/ExtractTempAction.java | 86 + .../eclipse/wst/jsdt/ui/actions/FindAction.java | 323 + .../jsdt/ui/actions/FindDeclarationsAction.java | 78 + .../actions/FindDeclarationsInHierarchyAction.java | 88 + .../actions/FindDeclarationsInProjectAction.java | 85 + .../FindDeclarationsInWorkingSetAction.java | 112 + .../ui/actions/FindExceptionOccurrencesAction.java | 125 + .../ui/actions/FindImplementOccurrencesAction.java | 124 + .../jsdt/ui/actions/FindImplementorsAction.java | 82 + .../actions/FindImplementorsInProjectAction.java | 84 + .../FindImplementorsInWorkingSetAction.java | 112 + .../ui/actions/FindOccurrencesInFileAction.java | 219 + .../jsdt/ui/actions/FindReadReferencesAction.java | 75 + .../FindReadReferencesInHierarchyAction.java | 77 + .../actions/FindReadReferencesInProjectAction.java | 85 + .../FindReadReferencesInWorkingSetAction.java | 99 + .../wst/jsdt/ui/actions/FindReferencesAction.java | 98 + .../actions/FindReferencesInHierarchyAction.java | 89 + .../ui/actions/FindReferencesInProjectAction.java | 97 + .../actions/FindReferencesInWorkingSetAction.java | 111 + .../jsdt/ui/actions/FindWriteReferencesAction.java | 76 + .../FindWriteReferencesInHierarchyAction.java | 76 + .../FindWriteReferencesInProjectAction.java | 85 + .../FindWriteReferencesInWorkingSetAction.java | 100 + .../wst/jsdt/ui/actions/FormatAllAction.java | 430 ++ .../wst/jsdt/ui/actions/GenerateActionGroup.java | 535 ++ .../GenerateNewConstructorUsingFieldsAction.java | 387 + .../ui/actions/IJavaEditorActionDefinitionIds.java | 635 ++ .../jsdt/ui/actions/ImplementorsSearchGroup.java | 195 + .../wst/jsdt/ui/actions/ImportActionGroup.java | 74 + .../eclipse/wst/jsdt/ui/actions/InlineAction.java | 135 + .../wst/jsdt/ui/actions/InlineTempAction.java | 125 + .../jsdt/ui/actions/IntroduceFactoryAction.java | 136 + .../ui/actions/IntroduceIndirectionAction.java | 154 + .../jsdt/ui/actions/IntroduceParameterAction.java | 83 + .../wst/jsdt/ui/actions/JavaSearchActionGroup.java | 183 + .../wst/jsdt/ui/actions/JdtActionConstants.java | 565 ++ .../jsdt/ui/actions/MemberFilterActionGroup.java | 346 + .../jsdt/ui/actions/ModifyParametersAction.java | 167 + .../eclipse/wst/jsdt/ui/actions/MoveAction.java | 256 + .../wst/jsdt/ui/actions/NavigateActionGroup.java | 107 + .../jsdt/ui/actions/OccurrencesSearchGroup.java | 192 + .../eclipse/wst/jsdt/ui/actions/OpenAction.java | 225 + .../wst/jsdt/ui/actions/OpenEditorActionGroup.java | 157 + .../jsdt/ui/actions/OpenExternalJavadocAction.java | 202 + .../jsdt/ui/actions/OpenJavaPerspectiveAction.java | 66 + .../jsdt/ui/actions/OpenNewClassWizardAction.java | 84 + .../ui/actions/OpenNewJavaProjectWizardAction.java | 66 + .../wst/jsdt/ui/actions/OpenProjectAction.java | 227 + .../ui/actions/OpenSuperImplementationAction.java | 195 + .../jsdt/ui/actions/OpenTypeHierarchyAction.java | 259 + .../wst/jsdt/ui/actions/OpenViewActionGroup.java | 314 + .../wst/jsdt/ui/actions/OrganizeImportsAction.java | 397 + .../wst/jsdt/ui/actions/OverrideMethodsAction.java | 276 + .../wst/jsdt/ui/actions/ProjectActionGroup.java | 218 + .../eclipse/wst/jsdt/ui/actions/PullUpAction.java | 179 + .../wst/jsdt/ui/actions/PushDownAction.java | 179 + .../jsdt/ui/actions/ReadReferencesSearchGroup.java | 205 + .../wst/jsdt/ui/actions/RefactorActionGroup.java | 670 ++ .../wst/jsdt/ui/actions/ReferencesSearchGroup.java | 217 + .../eclipse/wst/jsdt/ui/actions/RefreshAction.java | 221 + .../jsdt/ui/actions/RemoveFromClasspathAction.java | 138 + .../eclipse/wst/jsdt/ui/actions/RenameAction.java | 116 + .../jsdt/ui/actions/ReplaceInvocationsAction.java | 141 + .../jsdt/ui/actions/SelectionDispatchAction.java | 254 + .../ui/actions/SelfEncapsulateFieldAction.java | 165 + .../wst/jsdt/ui/actions/ShowActionGroup.java | 134 + .../jsdt/ui/actions/ShowInNavigatorViewAction.java | 171 + .../jsdt/ui/actions/ShowInPackageViewAction.java | 135 + .../wst/jsdt/ui/actions/SortMembersAction.java | 257 + .../ui/actions/SurroundWithTryCatchAction.java | 145 + .../wst/jsdt/ui/actions/UseSupertypeAction.java | 157 + .../wst/jsdt/ui/actions/WorkingSetFindAction.java | 90 + .../ui/actions/WriteReferencesSearchGroup.java | 205 + .../jsdt/ui/dialogs/ITypeInfoFilterExtension.java | 39 + .../jsdt/ui/dialogs/ITypeInfoImageProvider.java | 45 + .../wst/jsdt/ui/dialogs/ITypeInfoRequestor.java | 61 + .../jsdt/ui/dialogs/ITypeSelectionComponent.java | 31 + .../jsdt/ui/dialogs/TypeSelectionExtension.java | 97 + .../org/eclipse/wst/jsdt/ui/messages.properties | 11 + .../org/eclipse/wst/jsdt/ui/project/JsNature.java | 273 + .../ui/refactoring/IRefactoringProcessorIds.java | 274 + .../wst/jsdt/ui/refactoring/RenameSupport.java | 471 ++ .../jsdt/ui/search/ElementQuerySpecification.java | 54 + .../wst/jsdt/ui/search/IMatchPresentation.java | 65 + .../wst/jsdt/ui/search/IQueryParticipant.java | 63 + .../wst/jsdt/ui/search/ISearchRequestor.java | 34 + .../jsdt/ui/search/PatternQuerySpecification.java | 86 + .../wst/jsdt/ui/search/QuerySpecification.java | 72 + .../eclipse/wst/jsdt/ui/text/IColorManager.java | 54 + .../wst/jsdt/ui/text/IColorManagerExtension.java | 44 + .../jsdt/ui/text/IJavaScriptColorConstants.java | 177 + .../wst/jsdt/ui/text/IJavaScriptPartitions.java | 52 + .../text/JavaScriptSourceViewerConfiguration.java | 851 +++ .../wst/jsdt/ui/text/JavaScriptTextTools.java | 306 + .../DefaultJavaFoldingStructureProvider.java | 1456 ++++ .../text/folding/IJavaFoldingPreferenceBlock.java | 67 + .../folding/IJavaFoldingStructureProvider.java | 69 + .../IJavaFoldingStructureProviderExtension.java | 53 + .../jsdt/ui/text/java/AbstractProposalSorter.java | 92 + .../ui/text/java/CompletionProposalCollector.java | 773 ++ .../ui/text/java/CompletionProposalComparator.java | 94 + .../text/java/CompletionProposalLabelProvider.java | 714 ++ .../text/java/ContentAssistInvocationContext.java | 196 + .../wst/jsdt/ui/text/java/IInvocationContext.java | 67 + .../jsdt/ui/text/java/IJavaCompletionProposal.java | 41 + .../text/java/IJavaCompletionProposalComputer.java | 73 + .../ui/text/java/IJavadocCompletionProcessor.java | 77 + .../wst/jsdt/ui/text/java/IProblemLocation.java | 91 + .../jsdt/ui/text/java/IQuickAssistProcessor.java | 49 + .../wst/jsdt/ui/text/java/IQuickFixProcessor.java | 57 + .../java/JavaContentAssistInvocationContext.java | 308 + .../wst/jsdt/ui/text/java/JavaTextMessages.java | 37 + .../jsdt/ui/text/java/JavaTextMessages.properties | 13 + .../ui/text/java/hover/IJavaEditorTextHover.java | 43 + .../wst/jsdt/ui/wizards/BaseLibraryWizardPage.java | 129 + .../wst/jsdt/ui/wizards/BuildPathDialogAccess.java | 601 ++ .../wizards/ClasspathAttributeConfiguration.java | 123 + .../ui/wizards/IJsGlobalScopeContainerPage.java | 71 + .../IJsGlobalScopeContainerPageExtension.java | 41 + .../IJsGlobalScopeContainerPageExtension2.java | 39 + .../wizards/JavaCapabilityConfigurationPage.java | 264 + .../wst/jsdt/ui/wizards/NewClassWizardPage.java | 286 + .../jsdt/ui/wizards/NewContainerWizardPage.java | 519 ++ .../wst/jsdt/ui/wizards/NewElementWizardPage.java | 90 + .../jsdt/ui/wizards/NewJavaProjectWizardPage.java | 333 + .../wst/jsdt/ui/wizards/NewTypeWizardPage.java | 2407 +++++++ .../templates/default-codetemplates.xml | 90 + .../templates/default-templates.properties | 137 + .../templates/default-templates.xml | 187 + org.tizen.base.feature/IDE.bat | 13 +- org.tizen.base.feature/build.properties | 6 +- org.tizen.base.feature/feature.xml | 148 +- .../rootfiles/resources/icons/tizen-ide.ico | Bin 0 -> 143332 bytes .../rootfiles/resources/icons/tizen-sdk-ide.ico | Bin 107078 -> 0 bytes .../rootfiles_for_linux/startup.sh | 8 +- .../rootfiles_for_mac/startup.sh | 26 + .../rootfiles_for_windows/IDE.exe | Bin 130048 -> 0 bytes .../rootfiles_for_windows_x86/IDE.exe | Bin 0 -> 169472 bytes .../rootfiles_for_windows_x86_64/IDE.exe | Bin 0 -> 175616 bytes .../OSGI-INF/l10n/bundle.properties | 4 +- .../TizenIDE_base_linux.product | 11 +- .../TizenIDE_base_macos.product | 90 + .../TizenIDE_base_windows.product | 11 +- org.tizen.base.platform/about.mappings | 2 +- org.tizen.base.platform/content/home.html | 18 +- org.tizen.base.platform/content/icon_01_hover.png | Bin 8008 -> 11825 bytes org.tizen.base.platform/content/icon_01_normal.png | Bin 8169 -> 12397 bytes org.tizen.base.platform/content/icon_02_hover.png | Bin 10822 -> 11534 bytes org.tizen.base.platform/content/icon_02_normal.png | Bin 11426 -> 12273 bytes org.tizen.base.platform/content/icon_03_hover.png | Bin 10984 -> 12037 bytes org.tizen.base.platform/content/icon_03_normal.png | Bin 11602 -> 12775 bytes org.tizen.base.platform/content/icon_04_hover.png | Bin 8451 -> 8452 bytes org.tizen.base.platform/content/icon_04_normal.png | Bin 8945 -> 8926 bytes .../content/tizen_sdk_welcome_page_bg.jpg | Bin 1255637 -> 847173 bytes .../icons/branding/128_TIZEN_SDK_icon.png | Bin 28329 -> 18038 bytes .../icons/branding/16_TIZEN_SDK_icon.png | Bin 3554 -> 3614 bytes .../icons/branding/256_TIZEN_SDK_icon.png | Bin 106111 -> 37504 bytes .../icons/branding/32_TIZEN_SDK_icon.png | Bin 5168 -> 5237 bytes .../icons/branding/48_TIZEN_SDK_icon.png | Bin 7461 -> 7090 bytes .../icons/branding/64_TIZEN_SDK_icon.png | Bin 10353 -> 9025 bytes .../icons/branding/about_tizen_sdk.png | Bin 45492 -> 29162 bytes .../icons/launching/128_TIZEN_SDK_icon.xpm | 530 +- .../icons/launching/48_TIZEN_SDK_icon.xpm | 68 - .../icons/launching/TIZEN_SDK_icon.ico | Bin 107078 -> 143332 bytes org.tizen.base.platform/plugin.xml | 7 +- org.tizen.base.platform/plugin_customization.ini | 2 +- org.tizen.base.platform/splash.bmp | Bin 471064 -> 471064 bytes .../src/org/tizen/base/platform/Activator.java | 26 + .../org/tizen/base/platform/InitPreferences.java | 26 + package/base-ide-product.install.linux | 4 +- package/base-ide-product.install.windows | 4 +- package/base-ide-product.remove.linux | 4 +- package/base-ide-product.remove.windows | 2 +- package/build.linux | 494 +- package/pkginfo.manifest | 45 +- 3591 files changed, 795536 insertions(+), 545 deletions(-) create mode 100644 org.eclipse.cdt.mylyn.ui/.classpath create mode 100644 org.eclipse.cdt.mylyn.ui/.project create mode 100644 org.eclipse.cdt.mylyn.ui/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.eclipse.cdt.mylyn.ui/META-INF/MANIFEST.MF create mode 100644 org.eclipse.cdt.mylyn.ui/META-INF/eclipse.inf create mode 100644 org.eclipse.cdt.mylyn.ui/about.html create mode 100644 org.eclipse.cdt.mylyn.ui/build.properties create mode 100644 org.eclipse.cdt.mylyn.ui/icons/elcl16/focus-disabled.gif create mode 100644 org.eclipse.cdt.mylyn.ui/icons/elcl16/focus.gif create mode 100644 org.eclipse.cdt.mylyn.ui/icons/elcl16/interest-decrease.gif create mode 100644 org.eclipse.cdt.mylyn.ui/icons/elcl16/interest-folding.gif create mode 100644 org.eclipse.cdt.mylyn.ui/icons/elcl16/interest-increase.gif create mode 100644 org.eclipse.cdt.mylyn.ui/icons/elcl16/proposals-other.gif create mode 100644 org.eclipse.cdt.mylyn.ui/plugin.properties create mode 100644 org.eclipse.cdt.mylyn.ui/plugin.xml create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTContextLabelProvider.java create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTDeclarationsFilter.java create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTEditorMonitor.java create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTStructureBridge.java create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTUIBridgePlugin.java create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTUiBridge.java create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/InterestUpdateDeltaListener.java create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/LandmarkMarkerManager.java create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/Messages.java create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/actions/FocusCViewAction.java create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/actions/Messages.java create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/actions/ToggleActiveFoldingAction.java create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/actions/messages.properties create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/contentassist/CCompletionProposal.java create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/contentassist/CDTContentAssistUtils.java create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/contentassist/DOMCompletionProposalComputer.java create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/contentassist/FocusedCProposalProcessor.java create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/contentassist/FocusedDOMCompletionProposalComputer.java create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/editor/ActiveFoldingEditorTracker.java create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/editor/ActiveFoldingListener.java create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/editor/Messages.java create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/editor/messages.properties create mode 100644 org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/messages.properties create mode 100644 org.eclipse.cdt.mylyn/.project create mode 100644 org.eclipse.cdt.mylyn/build.properties create mode 100644 org.eclipse.cdt.mylyn/epl-v10.html create mode 100644 org.eclipse.cdt.mylyn/feature.properties create mode 100644 org.eclipse.cdt.mylyn/feature.xml create mode 100644 org.eclipse.cdt.mylyn/license.html create mode 100644 org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CDocBrowserInformationControl.java create mode 100644 org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CDocBrowserInformationControlInput.java create mode 100644 org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CElementLinks.java create mode 100644 org.eclipse.wst.jsdt.core/.classpath create mode 100644 org.eclipse.wst.jsdt.core/.project create mode 100644 org.eclipse.wst.jsdt.core/.settings/.jsdtscope create mode 100644 org.eclipse.wst.jsdt.core/.settings/org.eclipse.core.resources.prefs create mode 100644 org.eclipse.wst.jsdt.core/.settings/org.eclipse.core.runtime.prefs create mode 100644 org.eclipse.wst.jsdt.core/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.eclipse.wst.jsdt.core/.settings/org.eclipse.jdt.ui.prefs create mode 100644 org.eclipse.wst.jsdt.core/.settings/org.eclipse.ltk.core.refactoring.prefs create mode 100644 org.eclipse.wst.jsdt.core/.settings/org.eclipse.pde.prefs create mode 100644 org.eclipse.wst.jsdt.core/.settings/org.eclipse.wst.jsdt.ui.superType.container create mode 100644 org.eclipse.wst.jsdt.core/.settings/org.eclipse.wst.jsdt.ui.superType.name create mode 100644 org.eclipse.wst.jsdt.core/META-INF/MANIFEST.MF create mode 100644 org.eclipse.wst.jsdt.core/about.html create mode 100644 org.eclipse.wst.jsdt.core/build.properties create mode 100644 org.eclipse.wst.jsdt.core/grammar/js.g create mode 100644 org.eclipse.wst.jsdt.core/grammar/js_original.g create mode 100644 org.eclipse.wst.jsdt.core/libraries/baseBrowserLibrary--WrapperObjects.js create mode 100644 org.eclipse.wst.jsdt.core/libraries/baseBrowserLibrary.js create mode 100644 org.eclipse.wst.jsdt.core/libraries/browserWindow.js create mode 100644 org.eclipse.wst.jsdt.core/libraries/dom5.js create mode 100644 org.eclipse.wst.jsdt.core/libraries/system.js create mode 100644 org.eclipse.wst.jsdt.core/libraries/xhr.js create mode 100644 org.eclipse.wst.jsdt.core/plugin.properties create mode 100644 org.eclipse.wst.jsdt.core/plugin.xml create mode 100644 org.eclipse.wst.jsdt.core/schema/JsGlobalScopeContainerInitializer.exsd create mode 100644 org.eclipse.wst.jsdt.core/schema/JsGlobalScopeVariableInitializer.exsd create mode 100644 org.eclipse.wst.jsdt.core/schema/codeFormatter.exsd create mode 100644 org.eclipse.wst.jsdt.core/schema/inferrenceSupport.exsd create mode 100644 org.eclipse.wst.jsdt.core/schema/sourcePathProvider.exsd create mode 100644 org.eclipse.wst.jsdt.core/schema/validationParticipant.exsd create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/BindingKey.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/BufferChangedEvent.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CompletionContext.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CompletionFlags.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CompletionRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CorrectionEngine.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ElementChangedEvent.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/Flags.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IAccessRule.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IBuffer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IBufferChangedListener.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IBufferFactory.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IClassFile.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ICodeAssist.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ICorrectionRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IElementChangedListener.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IField.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IFunction.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IFunctionContainer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IImportContainer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IImportDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IIncludePathAttribute.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IIncludePathEntry.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IInitializer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJarEntryResource.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptElement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptElementDelta.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptModel.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptModelMarker.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptModelStatus.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptModelStatusConstants.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptProject.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptUnit.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJsGlobalScopeContainer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJsGlobalScopeContainerInitializer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ILocalVariable.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ILookupScope.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IMember.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IOpenable.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IPackageFragment.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IPackageFragmentRoot.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IParent.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IProblemRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IRegion.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ISourceManipulation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ISourceRange.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ISourceReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ITypeHierarchy.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ITypeHierarchyChangedListener.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ITypeRoot.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JSDScopeUtil.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JavaScriptConventions.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JavaScriptCore.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JavaScriptModelException.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JsGlobalScopeContainerInitializer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JsGlobalScopeVariableInitializer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/LibrarySuperType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/Messages.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/NamingConventions.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/Signature.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ToolFactory.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/UnimplementedException.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/WorkingCopyOwner.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ASTVisitor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IAND_AND_Expression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IASTNode.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IAbstractFunctionDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IAbstractVariableDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IAllocationExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArgument.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArrayAllocationExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArrayInitializer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArrayQualifiedTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArrayReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArrayTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IAssignment.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IBinaryExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IBlock.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IBranchStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IBreakStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ICaseStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ICombinedBinaryExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ICompoundAssignment.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IConditionalExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IConstructorDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IContinueStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IDebuggerStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IDoStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IDoubleLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IEmptyExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IEmptyStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IEqualExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IExplicitConstructorCall.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IExtendedStringLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFalseLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFieldDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFieldReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IForInStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IForStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IForeachStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFunctionCall.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFunctionDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFunctionExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IIfStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IImportReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IInitializer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IInstanceOfExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IIntLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IIntLiteralMinValue.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDoc.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocAllocationExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocArgumentExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocArrayQualifiedTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocArraySingleTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocFieldReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocImplicitTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocMessageSend.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocQualifiedTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocReturnStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocSingleNameReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocSingleTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ILabeledStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IListExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ILiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ILocalDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IMagicLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/INameReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/INullLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/INumberLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IOR_OR_Expression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IObjectLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IObjectLiteralField.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IOperatorExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IPostfixExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IPrefixExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IProgramElement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IQualifiedAllocationExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IQualifiedNameReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IQualifiedThisReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IQualifiedTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IRegExLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IReturnStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IScriptFileDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ISingleNameReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ISingleTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IStringLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IStringLiteralConcatenation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ISubRoutineStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ISuperReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ISwitchStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IThisReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IThrowStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ITrueLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ITryStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ITypeDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ITypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IUnaryExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IUndefinedLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IWhileStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IWithStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/BuildContext.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/CategorizedProblem.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/CharOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/IProblem.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/IScanner.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/ITerminalSymbols.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/InvalidInputException.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/ReconcileContext.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/ValidationParticipant.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/libraries/LibraryLocation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/libraries/SystemLibraryLocation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AST.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTConverter.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTMatcher.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTNode.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTParser.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTRecoveryPropagator.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTSyntaxErrorPropagator.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTVisitor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AbstractTypeDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AnonymousClassDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ArrayAccess.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ArrayCreation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ArrayInitializer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ArrayType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/Assignment.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/BindingComparator.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/BindingResolver.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/Block.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/BlockComment.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/BodyDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/BooleanLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/BreakStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/CatchClause.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/CharacterLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ChildListPropertyDescriptor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ChildPropertyDescriptor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ClassInstanceCreation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/Comment.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ConditionalExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ConstructorInvocation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ContinueStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/DefaultASTVisitor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/DefaultBindingResolver.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/DefaultCommentMapper.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/DoStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/DocCommentParser.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/EmptyExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/EmptyStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/EnhancedForStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/Expression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ExpressionStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/FieldAccess.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/FieldDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ForInStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ForStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/FunctionBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/FunctionDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/FunctionExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/FunctionInvocation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/FunctionRef.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/FunctionRefParameter.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/IBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/IDocElement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/IExtendedModifier.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/IFunctionBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/IPackageBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ITypeBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/IVariableBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/IfStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ImportDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/InferredType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/InfixExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/Initializer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/InstanceofExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/InternalASTRewrite.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/JSdoc.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/JavaScriptUnit.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/JavaScriptUnitBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/JavaScriptUnitResolver.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/LabeledStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/LineComment.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ListExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/MemberRef.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/Message.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/Modifier.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/NaiveASTFlattener.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/Name.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/NodeEventHandler.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/NodeSearcher.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/NullLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/NumberLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ObjectLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ObjectLiteralField.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/PackageBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/PackageDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ParenthesizedExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/PostfixExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/PrefixExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/PrimitiveType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ProgramElement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/QualifiedName.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/QualifiedType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/RecoveredTypeBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/RecoveredVariableBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/RegularExpressionLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ReturnStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/SimpleName.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/SimplePropertyDescriptor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/SimpleType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/SingleVariableDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/Statement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/StringLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/StructuralPropertyDescriptor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/SuperConstructorInvocation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/SuperFieldAccess.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/SuperMethodInvocation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/SwitchCase.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/SwitchStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/TagElement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/TextElement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ThisExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ThrowStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/TryStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/Type.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/TypeBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/TypeDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/TypeDeclarationStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/TypeLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/UndefinedLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/VariableBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/VariableDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/VariableDeclarationExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/VariableDeclarationFragment.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/VariableDeclarationStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/WhileStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/WithStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/rewrite/ASTRewrite.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/rewrite/ITrackedNodePosition.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/rewrite/ImportRewrite.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/rewrite/ListRewrite.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/rewrite/TargetSourceRangeComputer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/eval/ICodeSnippetRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/eval/IEvaluationContext.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/eval/IGlobalVariable.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/formatter/CodeFormatter.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/formatter/CodeFormatterApplication.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/formatter/DefaultCodeFormatterConstants.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/formatter/IndentManipulation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/formatter/messages.properties create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/infer/DefaultInferrenceProvider.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/infer/IInferEngine.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/infer/IInferenceFile.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/infer/ImportRewriteSupport.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/infer/InferEngine.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/infer/InferOptions.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/infer/InferredAttribute.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/infer/InferredMember.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/infer/InferredMethod.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/infer/InferredType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/infer/InferrenceManager.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/infer/InferrenceProvider.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/infer/InferrenceSupportExtension.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/infer/RefactoringSupport.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/infer/ResolutionConfiguration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/messages.properties create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/FieldDeclarationMatch.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/FieldReferenceMatch.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/IJavaScriptSearchConstants.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/IJavaScriptSearchScope.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/LocalVariableDeclarationMatch.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/LocalVariableReferenceMatch.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/MethodDeclarationMatch.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/MethodReferenceMatch.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/PackageReferenceMatch.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/SearchDocument.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/SearchEngine.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/SearchMatch.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/SearchParticipant.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/SearchPattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/SearchRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/TypeDeclarationMatch.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/TypeNameMatch.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/TypeNameMatchRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/TypeNameRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/TypeReferenceMatch.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/util/IModifierConstants.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/util/JavaScriptUnitSorter.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/util/SequenceReader.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/CompletionEngine.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/ISearchRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/ISelectionRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/InternalCompletionContext.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/InternalCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/MissingTypesGuesser.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/RelevanceConstants.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/SelectionEngine.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/ThrownExceptionFinder.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/UnresolvedReferenceNameFinder.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionJavadoc.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionJavadocParser.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionNodeDetector.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionNodeFound.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnArgumentName.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnBrankStatementLabel.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnClassLiteralAccess.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnExplicitConstructorCall.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnFieldName.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnFieldType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnImportReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnJavadoc.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnJavadocAllocationExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnJavadocFieldReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnJavadocMessageSend.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnJavadocParamNameReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnJavadocQualifiedTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnJavadocSingleTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnJavadocTag.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnKeyword.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnKeyword1.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnKeyword2.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnKeyword3.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnLocalName.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnMemberAccess.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnMessageSend.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnMessageSendName.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnMethodName.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnQualifiedNameReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnQualifiedType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnSingleNameReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnSingleTypeName.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionOnStringLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionParser.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/CompletionScanner.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/complete/InvalidCursorLocation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/impl/AssistOptions.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/impl/AssistParser.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/impl/Engine.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/impl/Keywords.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionJavadoc.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionJavadocParser.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionNodeFound.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionOnArgumentName.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionOnExplicitConstructorCall.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionOnFieldReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionOnFieldType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionOnImportReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionOnLocalName.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionOnMessageSend.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionOnPackageReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionOnQualifiedAllocationExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionOnQualifiedNameReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionOnQualifiedType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionOnQualifiedTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionOnSingleNameReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionOnSingleType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionOnSingleTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionOnSuperReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionParser.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/select/SelectionScanner.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ASTVisitor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/CompilationResult.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/Compiler.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/DefaultErrorHandlingPolicies.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/DelegateASTVisitor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ICompilerRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/IDebugRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/IErrorHandlingPolicy.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/IProblemFactory.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ISourceElementRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/SourceElementParser.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/SourceJavadocParser.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/AND_AND_Expression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ASTNode.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/AbstractMethodDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/AbstractVariableDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/AllocationExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/Argument.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ArrayAllocationExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ArrayInitializer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ArrayQualifiedTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ArrayReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ArrayTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/Assignment.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/BinaryExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/Block.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/BranchStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/BreakStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/CaseStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ClassLiteralAccess.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/Clinit.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/CombinedBinaryExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/CompilationUnitDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/CompoundAssignment.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ConditionalExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ConstructorDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ContinueStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/DebuggerStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/DoStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/DoubleLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/EmptyExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/EmptyStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/EqualExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ExplicitConstructorCall.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/Expression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ExtendedStringLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/FalseLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/FieldDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/FieldReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ForInStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ForStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ForeachStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/FunctionExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/HoistingFinder.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/IfStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ImportReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/Initializer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/InstanceOfExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/IntLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/IntLiteralMinValue.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/Javadoc.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/JavadocAllocationExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/JavadocArgumentExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/JavadocArrayQualifiedTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/JavadocArraySingleTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/JavadocFieldReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/JavadocImplicitTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/JavadocMessageSend.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/JavadocQualifiedTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/JavadocReturnStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/JavadocSingleNameReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/JavadocSingleTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/LabeledStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ListExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/Literal.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/LocalDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/MagicLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/MessageSend.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/MethodDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/NameReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/NullLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/NumberLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/OR_OR_Expression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ObjectGetterSetterField.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ObjectLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ObjectLiteralField.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/OperatorExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/OperatorIds.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/PostfixExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/PrefixExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ProgramElement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/QualifiedAllocationExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/QualifiedNameReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/QualifiedThisReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/QualifiedTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/Reference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/RegExLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ReturnStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/SingleNameReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/SingleTypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/Statement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/StringLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/StringLiteralConcatenation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/SubRoutineStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/SuperReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/SwitchStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ThisReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ThrowStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/TrueLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/TryStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/TypeDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/TypeReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/UnaryExpression.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/UndefinedLiteral.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/WhileStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/WithStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/batch/ClasspathFile.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/batch/ClasspathLocation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/batch/ClasspathMetadataFile.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/batch/CompilationUnit.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/batch/FileFinder.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/batch/FileSystem.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/batch/Main.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/batch/messages.properties create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/classfmt/ClassFileConstants.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/env/AccessRestriction.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/env/AccessRule.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/env/AccessRuleSet.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/env/ClassSignature.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/env/IBinaryField.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/env/IBinaryMethod.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/env/IBinaryNestedType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/env/IBinaryType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/env/ICompilationUnit.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/env/IDependent.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/env/IGenericField.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/env/IGenericMethod.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/env/IGenericType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/env/INameEnvironment.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/env/ISourceField.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/env/ISourceImport.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/env/ISourceMethod.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/env/ISourceType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/env/NameEnvironmentAnswer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/flow/ConditionalFlowInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/flow/ExceptionHandlingFlowContext.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/flow/FinallyFlowContext.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/flow/FlowContext.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/flow/FlowInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/flow/InitializationFlowContext.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/flow/InsideSubRoutineFlowContext.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/flow/LabelFlowContext.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/flow/LoopingFlowContext.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/flow/NullInfoRegistry.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/flow/SwitchFlowContext.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/flow/UnconditionalFlowInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/impl/BooleanConstant.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/impl/CharConstant.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/impl/CompilerOptions.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/impl/Constant.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/impl/DoubleConstant.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/impl/FloatConstant.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/impl/ITypeRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/impl/ITypeRequestor2.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/impl/IntConstant.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/impl/LongConstant.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/impl/ReferenceContext.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/impl/ShortConstant.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/impl/StringConstant.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ArrayBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/BaseTypeBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/BinaryTypeBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/Binding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/BlockScope.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ClassScope.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/CombinedSourceTypeBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/CompilationUnitBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/CompilationUnitScope.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ExtraCompilerModifiers.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/FieldBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/FunctionTypeBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/GlobalBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ImportBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ImportConflictBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/IndirectMethodBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/InnerEmulationDependency.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/InvocationSite.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/LibraryAPIsBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/LibraryAPIsScope.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/LocalFunctionBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/LocalTypeBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/LocalVariableBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/LookupEnvironment.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/MemberTypeBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/Messages.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/MetatdataTypeBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/MethodBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/MethodScope.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/MethodVerifier.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/MissingBinaryTypeBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/MultipleTypeBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/NestedTypeBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/PackageBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ProblemBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ProblemFieldBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ProblemMethodBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ProblemReasons.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ProblemReferenceBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ReferenceBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/Scope.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/SignatureWrapper.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/SourceTypeBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/TagBits.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/TypeBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/TypeConstants.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/TypeIds.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/UnresolvedReferenceBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/UpdatedMethodBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/VariableBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/WithScope.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/messages.properties create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/AbstractCommentParser.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/JavadocParser.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/JavadocTagConstants.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/NLSTag.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/Parser.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/ParserBasicInformation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/RecoveredBlock.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/RecoveredElement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/RecoveredField.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/RecoveredImport.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/RecoveredInitializer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/RecoveredLocalVariable.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/RecoveredMethod.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/RecoveredStatement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/RecoveredType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/RecoveredUnit.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/RecoveryScanner.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/RecoveryScannerData.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/Scanner.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/ScannerHelper.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/SourceTypeConverter.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/TerminalTokens.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/UpdateParserFiles.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/diagnose/DiagnoseParser.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/diagnose/LexStream.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/diagnose/RangeUtil.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser1.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser10.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser11.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser12.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser13.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser14.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser15.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser16.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser17.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser18.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser19.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser2.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser20.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser21.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser22.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser23.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser24.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser25.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser3.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser4.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser5.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser6.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser7.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser8.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/parser9.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/part1.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/part14.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/part2.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/readableNames.properties create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/start1.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/start2.rsc create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/AbortCompilation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/AbortCompilationUnit.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/AbortMethod.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/AbortType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/DefaultProblem.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/DefaultProblemFactory.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemHandler.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemReporter.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemSeverities.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/ShouldNotImplement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/messages.properties create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/CompoundNameVector.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/EclipseUtil.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/FloatUtil.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/GenericXMLWriter.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/HashtableOfBinding.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/HashtableOfInt.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/HashtableOfIntValues.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/HashtableOfLong.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/HashtableOfObject.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/HashtableOfObjectToInt.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/HashtableOfObjectToIntArray.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/HashtableOfPackage.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/HashtableOfType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/Messages.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/ObjectCache.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/ObjectVector.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/SimpleLookupTable.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/SimpleNameVector.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/SimpleSet.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/SimpleSetOfCharArray.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/SuffixConstants.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/util/Util.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ASTHolderCUInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/BasicCompilationUnit.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/BatchOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/BecomeWorkingCopyOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/BinaryField.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/BinaryMember.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/BinaryMethod.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/BinaryType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/BinaryTypeConverter.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/Buffer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/BufferCache.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/BufferFactoryWrapper.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/BufferManager.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CancelableNameEnvironment.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CancelableProblemFactory.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ChangeClasspathOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ClassFile.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ClassFileInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ClassFileWorkingCopy.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ClasspathAccessRule.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ClasspathAttribute.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ClasspathChange.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ClasspathEntry.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ClasspathValidation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CommitWorkingCopyOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CompilationUnit.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CompilationUnitElementInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CompilationUnitProblemFinder.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CompilationUnitStructureRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CopyElementsOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CopyPackageFragmentRootOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CopyResourceElementsOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CreateCompilationUnitOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CreateElementInCUOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CreateFieldOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CreateImportOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CreateMethodOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CreatePackageFragmentOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CreateTypeHierarchyOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CreateTypeMemberOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CreateTypeOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DefaultWorkingCopyOwner.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DeleteElementsOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DeletePackageFragmentRootOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DeleteResourceElementsOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DeltaProcessingState.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DeltaProcessor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DiscardWorkingCopyOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DocumentAdapter.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DocumentContextFragment.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DocumentContextFragmentRoot.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ElementCache.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ExternalJavaProject.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/IJavaElementRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/INamingRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/IPathRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/IVirtualParent.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ImportContainer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ImportDeclaration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ImportDeclarationElementInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/Initializer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/InitializerElementInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/InternalNamingConventions.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaCorePreferenceInitializer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaCorePreferenceModifyListener.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaElement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaElementDelta.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaElementDeltaBuilder.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaElementInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaElementRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaModel.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaModelCache.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaModelInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaModelManager.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaModelOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaModelStatus.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaProject.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaProjectElementInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavadocConstants.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/LRUCacheEnumerator.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/LibraryFragmentRoot.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/LibraryFragmentRootInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/LibraryPackageFragment.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/LibraryPackageFragmentInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/LocalVariable.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/Logger.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/LookupScopeElementInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/Member.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/MemberElementInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/MetadataFile.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ModelUpdater.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/MoveElementsOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/MovePackageFragmentRootOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/MoveResourceElementsOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/MultiOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/NameLookup.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/NamedMember.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/NullBuffer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/Openable.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/OpenableElementInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/OverflowingLRUCache.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/PackageFragment.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/PackageFragmentInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/PackageFragmentRoot.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/PackageFragmentRootInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ProjectReferenceChange.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ReconcileWorkingCopyOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/Region.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/RenameElementsOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/RenameResourceElementsOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ResolvedBinaryField.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ResolvedBinaryMethod.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ResolvedBinaryType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ResolvedSourceField.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ResolvedSourceMethod.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ResolvedSourceType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SearchableEnvironment.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SearchableEnvironmentRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SelectionRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SetClasspathOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SetContainerOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SetVariablesOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SimpleDelta.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SingleTypeRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SortElementsOperation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceConstructorInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceField.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceFieldElementInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceMapper.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceMethod.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceMethodElementInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceMethodInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceRange.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceRefElement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceRefElementInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceTypeElementInfo.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/TypeVector.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/UserLibrary.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/UserLibraryJsGlobalScopeContainer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/UserLibraryJsGlobalScopeContainerInitializer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/UserLibraryManager.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/VerboseElementCache.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/XMLWriter.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/AbortIncrementalBuildException.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/AbstractImageBuilder.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/AdditionalTypeCollection.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/BatchImageBuilder.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/BuildNotifier.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/ClasspathDirectory.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/ClasspathLibrary.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/ClasspathLocation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/ClasspathMultiDirectory.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/ICompilationUnitLocator.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/ImageBuilderInternalException.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/IncrementalImageBuilder.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/JavaBuilder.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/MissingSourceFileException.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/NameEnvironment.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/NameSet.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/ProblemFactory.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/QualifiedNameSet.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/ReferenceCollection.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/SourceFile.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/State.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/StringSet.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/ValidationParticipantResult.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/builder/WorkQueue.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/ASTRewriteFlattener.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/ASTRewriteFormatter.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/ImportRewriteAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/LineCommentEndOffsets.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/LineInformation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/ListRewriteEvent.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/NodeInfoStore.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/NodeRewriteEvent.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/RewriteEvent.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/RewriteEventStore.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/SourceModifier.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/TokenScanner.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/TrackedNodePosition.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/hierarchy/ChangeCollector.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/hierarchy/HierarchyBinaryType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/hierarchy/HierarchyBuilder.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/hierarchy/HierarchyResolver.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/hierarchy/HierarchyType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/hierarchy/RegionBasedHierarchyBuilder.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/hierarchy/RegionBasedTypeHierarchy.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/hierarchy/TypeHierarchy.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/index/DiskIndex.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/index/EntryResult.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/index/Index.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/index/MemoryIndex.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/interpret/BooleanValue.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/interpret/Contants.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/interpret/FunctionValue.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/interpret/InterpretException.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/interpret/InterpretedScript.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/interpret/Interpreter.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/interpret/InterpreterContext.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/interpret/InterpreterEngine.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/interpret/InterpreterResult.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/interpret/NativeFunction.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/interpret/NativeObject.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/interpret/NumberValue.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/interpret/ObjectValue.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/interpret/StringValue.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/interpret/Value.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/interpret/ValueReference.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/interpret/builtin/BuiltInHelper.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/interpret/builtin/BuiltInObject.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/interpret/builtin/BuiltInString.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/AbstractSearchScope.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/BasicSearchEngine.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/HierarchyScope.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/IConstructorRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/IRestrictedAccessBindingRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/IRestrictedAccessTypeRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/IndexQueryRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/IndexSelector.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/JavaSearchDocument.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/JavaSearchParticipant.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/JavaSearchScope.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/JavaSearchTypeNameMatch.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/JavaWorkspaceScope.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/PathCollector.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/PatternSearchJob.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/SubTypeSearchJob.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/TypeNameMatchRequestorWrapper.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/TypeNameRequestorWrapper.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/AbstractIndexer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/AddFolderToIndex.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/AddLibraryFileToIndex.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/AddLibraryFolderToIndex.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/IIndexConstants.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/IndexAllProject.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/IndexBinaryFolder.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/IndexManager.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/IndexRequest.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/IndexingParser.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/InternalSearchDocument.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/ReadWriteMonitor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/RemoveFolderFromIndex.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/RemoveFromIndex.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/SaveIndex.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/SourceIndexer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/SourceIndexerRequestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/AndPattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/ClassFileMatchLocator.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/ClasspathSourceDirectory.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/ConstructorDeclarationPattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/ConstructorLocator.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/ConstructorPattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/DeclarationOfAccessedFieldsPattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/DeclarationOfReferencedMethodsPattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/DeclarationOfReferencedTypesPattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/FieldLocator.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/FieldPattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/InternalSearchPattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/JavaSearchNameEnvironment.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/JavaSearchPattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/LocalVariableLocator.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/LocalVariablePattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/MatchLocator.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/MatchLocatorParser.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/MatchingNodeSet.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/MethodLocator.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/MethodPattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/MultiTypeDeclarationPattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/OrLocator.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/OrPattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/PackageDeclarationLocator.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/PackageDeclarationPattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/PackageReferenceLocator.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/PackageReferencePattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/PatternLocator.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/PossibleMatch.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/PossibleMatchSet.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/QualifiedTypeDeclarationPattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/SecondaryTypeDeclarationPattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/SuperTypeNamesCollector.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/SuperTypeReferenceLocator.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/SuperTypeReferencePattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/TypeDeclarationLocator.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/TypeDeclarationPattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/TypeReferenceLocator.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/TypeReferencePattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/VariableLocator.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/VariablePattern.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/processing/IJob.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/processing/JobManager.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/ASTNodeFinder.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/BindingKeyParser.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/BindingKeyResolver.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/CharArrayBuffer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/CodeSnippetParsingUtil.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/CommentRecorderParser.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/CommentRecorderScanner.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/ConvertUtility.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/DOMFinder.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/DefaultSourcePathProvider.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/HandleFactory.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/HashSetOfArray.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/HashtableOfArrayToObject.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/ICacheEnumeration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/ILRUCacheable.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/KeyKind.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/KeyToSignature.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/LRUCache.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/MementoTokenizer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/Messages.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/PublicScanner.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/RecordedParsingInformation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/ReferenceInfoAdapter.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/ResourceCompilationUnit.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/SimpleDocument.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/SimpleWordSet.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/ToStringSorter.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/Util.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/WeakHashSet.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/WeakHashSetOfCharArray.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/messages.properties create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/AbortFormatting.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/BinaryExpressionFragmentBuilder.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/CascadingMethodInvocationFragmentBuilder.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/CodeFormatterVisitor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/DefaultCodeFormatter.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/DefaultCodeFormatterOptions.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/Location.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/OptimizedReplaceEdit.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/Scribe.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/align/Alignment.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/align/AlignmentException.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/comment/CommentFormatterUtil.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/comment/CommentLine.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/comment/CommentRange.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/comment/CommentRegion.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/comment/HTMLEntity2JavaReader.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/comment/IBorderAttributes.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/comment/ICommentAttributes.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/comment/IHtmlTagDelimiters.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/comment/IJavaDocTagConstants.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/comment/Java2HTMLEntityReader.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/comment/JavaDocLine.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/comment/JavaDocRegion.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/comment/MultiCommentLine.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/comment/MultiCommentRegion.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/comment/SingleCommentLine.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/comment/SubstitutionTextReader.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/options.properties create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/Alias.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/Ancestor.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/Author.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/ClassData.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/DepreciatedOrAvailable.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/DocumentedElement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/Enum.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/Event.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/Exception.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/IOAAMetaDataConstants.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/LibraryAPIs.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/MetadataReader.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/MetadataSourceElementNotifier.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/Method.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/Mix.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/Mixin.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/Namespace.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/Option.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/Parameter.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/Property.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/ReturnsData.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/oaametadata/VersionableElement.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/AbstractVMInstall.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/AbstractVMInstallType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/ExecutionArguments.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/IJavaLaunchConfigurationConstants.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/IRuntimeClasspathEntry.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/IRuntimeClasspathEntry2.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/IRuntimeClasspathEntryResolver.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/IRuntimeClasspathEntryResolver2.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/IRuntimeClasspathProvider.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/IVMInstall.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/IVMInstall2.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/IVMInstall3.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/IVMInstallChangedListener.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/IVMInstallType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/IVMRunner.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/JREContainer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/JREContainerInitializer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/JavaRuntime.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/LaunchingMessages.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/LaunchingMessages.properties create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/LibraryLocation.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/ListenerList.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/PropertyChangeEvent.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/StandardVM.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/StandardVMType.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/VMRunnerConfiguration.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/VMStandin.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/libraries/BasicBrowserLibraryContainer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/libraries/BasicBrowserLibraryJsGlobalScopeContainerInitializer.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/libraries/Messages.java create mode 100644 org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/libraries/messages.properties create mode 100644 org.eclipse.wst.jsdt.feature/.project create mode 100644 org.eclipse.wst.jsdt.feature/.settings/org.eclipse.core.resources.prefs create mode 100644 org.eclipse.wst.jsdt.feature/.settings/org.eclipse.core.runtime.prefs create mode 100644 org.eclipse.wst.jsdt.feature/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.eclipse.wst.jsdt.feature/.settings/org.eclipse.jdt.ui.prefs create mode 100644 org.eclipse.wst.jsdt.feature/.settings/org.eclipse.ltk.core.refactoring.prefs create mode 100644 org.eclipse.wst.jsdt.feature/.settings/org.eclipse.pde.prefs create mode 100644 org.eclipse.wst.jsdt.feature/build.properties create mode 100644 org.eclipse.wst.jsdt.feature/feature.properties create mode 100644 org.eclipse.wst.jsdt.feature/feature.xml create mode 100644 org.eclipse.wst.jsdt.feature/sourceTemplateBundle/about.html create mode 100644 org.eclipse.wst.jsdt.feature/sourceTemplateBundle/about.ini create mode 100644 org.eclipse.wst.jsdt.feature/sourceTemplateBundle/about.mappings create mode 100644 org.eclipse.wst.jsdt.feature/sourceTemplateBundle/about.properties create mode 100644 org.eclipse.wst.jsdt.feature/sourceTemplateBundle/build.properties create mode 100644 org.eclipse.wst.jsdt.feature/sourceTemplateBundle/plugin.properties create mode 100644 org.eclipse.wst.jsdt.feature/sourceTemplateBundle/wtp_prod32.gif create mode 100644 org.eclipse.wst.jsdt.feature/sourceTemplateBundle/wtp_prod32.png create mode 100644 org.eclipse.wst.jsdt.feature/sourceTemplateFeature/build.properties create mode 100644 org.eclipse.wst.jsdt.feature/sourceTemplateFeature/eclipse_update_120.jpg create mode 100644 org.eclipse.wst.jsdt.feature/sourceTemplateFeature/feature.properties create mode 100644 org.eclipse.wst.jsdt.feature/sourceTemplatePlugin/about.html create mode 100644 org.eclipse.wst.jsdt.feature/sourceTemplatePlugin/about.ini create mode 100644 org.eclipse.wst.jsdt.feature/sourceTemplatePlugin/about.mappings create mode 100644 org.eclipse.wst.jsdt.feature/sourceTemplatePlugin/about.properties create mode 100644 org.eclipse.wst.jsdt.feature/sourceTemplatePlugin/build.properties create mode 100644 org.eclipse.wst.jsdt.feature/sourceTemplatePlugin/plugin.properties create mode 100644 org.eclipse.wst.jsdt.feature/sourceTemplatePlugin/wtp_prod32.gif create mode 100644 org.eclipse.wst.jsdt.feature/sourceTemplatePlugin/wtp_prod32.png create mode 100644 org.eclipse.wst.jsdt.ui/.classpath create mode 100644 org.eclipse.wst.jsdt.ui/.options create mode 100644 org.eclipse.wst.jsdt.ui/.project create mode 100644 org.eclipse.wst.jsdt.ui/.settings/org.eclipse.core.resources.prefs create mode 100644 org.eclipse.wst.jsdt.ui/.settings/org.eclipse.core.runtime.prefs create mode 100644 org.eclipse.wst.jsdt.ui/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.eclipse.wst.jsdt.ui/.settings/org.eclipse.jdt.launching.prefs create mode 100644 org.eclipse.wst.jsdt.ui/.settings/org.eclipse.jdt.ui.prefs create mode 100644 org.eclipse.wst.jsdt.ui/.settings/org.eclipse.ltk.core.refactoring.prefs create mode 100644 org.eclipse.wst.jsdt.ui/.settings/org.eclipse.pde.prefs create mode 100644 org.eclipse.wst.jsdt.ui/JavadocHoverStyleSheet.css create mode 100644 org.eclipse.wst.jsdt.ui/JavadocViewStyleSheet.css create mode 100644 org.eclipse.wst.jsdt.ui/META-INF/MANIFEST.MF create mode 100644 org.eclipse.wst.jsdt.ui/about.html create mode 100644 org.eclipse.wst.jsdt.ui/about.ini create mode 100644 org.eclipse.wst.jsdt.ui/about.mappings create mode 100644 org.eclipse.wst.jsdt.ui/about.properties create mode 100644 org.eclipse.wst.jsdt.ui/build.properties create mode 100644 org.eclipse.wst.jsdt.ui/icons/WTP_icon_x32_v2.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/add_as_source_folder.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/add_exc.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/add_linked_source_to_buildpath.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/add_to_buildpath.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/alphab_sort_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/category_menu.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/ch_callees.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/ch_callers.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/ch_cancel.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/class_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/clear_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/collapseall.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/configure_build_path.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/configure_buildpath_filters.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/configure_output_folder.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/cpyqual_menu.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/default_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/definingtype_sort_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/exc_catch.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/exclude_from_buildpath.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/exclusion_filter_attrib.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/fields_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/file_mode.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/filter_ps.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/flatLayout.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/gointo_toplevel_type.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/goto_input.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/hide_externalized.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/hide_ignored.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/hide_internalized.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/hierarchicalLayout.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/hierarchy_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/history_list.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/impl_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/include_on_buildpath.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/inclusion_filter_attrib.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/inher_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/javaassist_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/jtypeassist_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/localtypes_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/metharg_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/newpackfolder_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/output_folder_attrib.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/pack_empty_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/package_mode.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/private_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/prj_mode.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/protected_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/public_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/refresh_nav.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/remove_as_source_folder.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/remove_exc.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/remove_from_buildpath.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/removea_exc.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/search_sortmatch.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/smartmode_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/static_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/sub_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/super_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/synced.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/templateprop_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/th_automatic.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/th_horizontal.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/th_showqualified.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/th_single.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/th_vertical.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/type_mode.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/view_menu.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dlcl16/wordassist_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/comment_edit.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/exportapp_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/exportjar_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/importjar_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/java_app.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/java_attach.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/javadoc.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/jdoc_hover_edit.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/mark_occurrences.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/newannotation_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/newclass_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/newenum_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/newint_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/newjprj_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/newjworkingSet_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/newpack_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/newpackfolder_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/newsbook_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/opentype.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/segment_edit.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/shift_l_edit.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/dtool16/shift_r_edit.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/add_as_source_folder.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/add_exc.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/add_linked_source_to_buildpath.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/add_to_buildpath.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/alphab_sort_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/category_menu.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/ch_callees.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/ch_callers.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/ch_cancel.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/class_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/clear_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/collapseall.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/configure_build_path.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/configure_buildpath_filters.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/configure_output_folder.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/cpyqual_menu.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/default_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/definingtype_sort_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/exc_catch.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/exclude_from_buildpath.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/exclusion_filter_attrib.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/fields_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/file_mode.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/filter_ps.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/flatLayout.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/gointo_toplevel_type.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/goto_input.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/help.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/hide_externalized.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/hide_ignored.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/hide_internalized.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/hierarchicalLayout.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/hierarchy_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/history_list.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/impl_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/include_on_buildpath.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/inclusion_filter_attrib.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/inher_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/javaassist_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/jtypeassist_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/localtypes_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/metharg_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/pack_empty_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/package_mode.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/private_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/prj_mode.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/protected_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/public_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/refresh_nav.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/remove_as_source_folder.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/remove_exc.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/remove_from_buildpath.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/removea_exc.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/search_sortmatch.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/smartmode_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/static_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/sub_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/super_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/synced.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/templateprop_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/th_automatic.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/th_horizontal.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/th_showqualified.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/th_single.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/th_vertical.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/type_mode.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/view_menu.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/elcl16/wordassist_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/comment_edit.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/exportapp_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/exportjar_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/importjar_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/java_app.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/java_attach.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/javadoc.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/jdoc_hover_edit.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/mark_occurrences.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/newannotation_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/newclass_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/newenum_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/newint_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/newjprj_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/newjscript_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/newjworkingSet_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/newpack_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/newpackfolder_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/newsbook_wiz.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/opentype.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/segment_edit.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/shift_l_edit.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/etool16/shift_r_edit.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/eview16/browse_persp.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/eview16/call_hierarchy.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/eview16/class_hi.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/eview16/classfilegeneration_tab.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/eview16/errorwarning_tab.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/eview16/hierch_persp.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/eview16/javadoc.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/eview16/jdkcompliance_tab.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/eview16/jperspective.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/eview16/members.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/eview16/package.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/eview16/packages.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/eview16/projects.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/eview16/source.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/eview16/types.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/access_restriction_attrib.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/add_correction.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/annotation_alt_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/annotation_default_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/annotation_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/annotation_private_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/annotation_protected_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/brkpi_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/change.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/class_default_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/class_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/classf_generate.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/classf_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/classfo_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/compare_field.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/compare_method.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/correction_cast.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/correction_change.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/correction_delete_import.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/correction_linked_rename.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/correction_move.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/correction_rename.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/cp_order_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/cu_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/empty_logical_package_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/empty_pack_fldr_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/empty_pack_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/enum_alt_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/enum_default_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/enum_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/enum_private_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/enum_protected_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/envvar_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/error_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/exclusion_filter_attrib.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/externalize.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/fatalerror_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/field_default_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/field_private_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/field_protected_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/field_public_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/file_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/history_working_set_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/html_tag_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/ignore.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/imp_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/impc_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/implm_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/inclusion_filter_attrib.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/info_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/innerclass_default_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/innerclass_private_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/innerclass_protected_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/innerclass_public_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/innerinterface_default_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/innerinterface_private_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/innerinterface_protected_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/innerinterface_public_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/int_default_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/int_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/internalize.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/intf_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/jar_desc_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/jar_l_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/jar_lsrc_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/jar_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/jar_src_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/java_model_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/javadoc_location_attrib.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/jcu_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/jcu_resource_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/jdoc_tag_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/jexception_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/jexceptiond_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/jrtexception_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/jsbook_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/jsearch_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/jworkingSet_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/library_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/localvariable_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/logical_package_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/methdef_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/methpri_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/methpro_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/methpub_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/native_lib_path_attrib.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/never_translate.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/nls_search_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/no_breakpoint.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/occ_match.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/occ_read.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/occ_write.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/output_folder_attrib.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/over_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/package_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/packagefolder_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/packd_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/quickassist_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/quickfix_error_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/quickfix_warning_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/remove_correction.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/search_decl_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/search_ref_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/searchm_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/settings_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/skip.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/source_attach_attrib.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/template_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/translate.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/type_separator.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/typevariable_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/unknown_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/obj16/warning_obj.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/abstract_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/annotation_tsk.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/callee_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/caller_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/class_abs_tsk.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/class_tsk.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/constr_ovr.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/deprecated.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/enum_tsk.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/error_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/final_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/focus_ovr.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/implm_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/interface_tsk.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/java_ovr.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/maxlevel_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/native_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/over_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/read.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/recursive_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/run_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/static_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/sync_impl.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/sync_over.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/synch_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/transient_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/volatile_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/warning_co.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/ovr16/write.gif create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/addlibrary_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/cleanup_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/coderefact_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/compunitrefact_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/export_javadoc_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/exportapp_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/extractsupertype_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/extstr_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/fieldrefact_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/fixdepr_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/jar_pack_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/java_app_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/java_attach_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/java_workingset_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/methrefact_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/newannotation_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/newclass_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/newenum_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/newint_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/newjprj_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/newjscriptfile_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/newpack_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/newsbook_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/newsrcfldr_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/packrefact_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/pullup_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/refactor_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/replacejar_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/icons/full/wizban/typerefact_wiz.png create mode 100644 org.eclipse.wst.jsdt.ui/plugin.properties create mode 100644 org.eclipse.wst.jsdt.ui/plugin.xml create mode 100644 org.eclipse.wst.jsdt.ui/schema/DocumentationProvider.exsd create mode 100644 org.eclipse.wst.jsdt.ui/schema/JsGlobalScopeContainerPage.exsd create mode 100644 org.eclipse.wst.jsdt.ui/schema/JsGlobalScopeUIInitializer.exsd create mode 100644 org.eclipse.wst.jsdt.ui/schema/classpathAttributeConfiguration.exsd create mode 100644 org.eclipse.wst.jsdt.ui/schema/foldingStructureProviders.exsd create mode 100644 org.eclipse.wst.jsdt.ui/schema/javaCompletionProposalComputer.exsd create mode 100644 org.eclipse.wst.jsdt.ui/schema/javaCompletionProposalSorters.exsd create mode 100644 org.eclipse.wst.jsdt.ui/schema/javaEditorTextHovers.exsd create mode 100644 org.eclipse.wst.jsdt.ui/schema/javaElementFilters.exsd create mode 100644 org.eclipse.wst.jsdt.ui/schema/javadocCompletionProcessor.exsd create mode 100644 org.eclipse.wst.jsdt.ui/schema/queryParticipants.exsd create mode 100644 org.eclipse.wst.jsdt.ui/schema/quickAssistProcessors.exsd create mode 100644 org.eclipse.wst.jsdt.ui/schema/quickFixProcessors.exsd create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/Corext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/CorextMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/CorextMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/SourceRange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/ValidateEditException.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/buildpath/BuildpathDelta.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/buildpath/CPJavaProject.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/buildpath/ClasspathModifier.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/buildpath/IBuildpathModifierListener.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/callhierarchy/CallHierarchy.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/callhierarchy/CallHierarchyMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/callhierarchy/CallHierarchyMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/callhierarchy/CallHierarchyVisitor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/callhierarchy/CallLocation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/callhierarchy/CallSearchResultCollector.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/callhierarchy/CalleeAnalyzerVisitor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/callhierarchy/CalleeMethodWrapper.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/callhierarchy/CallerMethodWrapper.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/callhierarchy/IImplementorFinder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/callhierarchy/Implementors.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/callhierarchy/JavaImplementorFinder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/callhierarchy/MethodCall.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/callhierarchy/MethodReferencesSearchRequestor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/callhierarchy/MethodWrapper.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/AddCustomConstructorOperation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/AddDelegateMethodsOperation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/AddGetterSetterOperation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/AddImportsOperation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/AddJavaDocStubOperation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/AddUnimplementedConstructorsOperation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/AddUnimplementedMethodsOperation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/CodeGenerationMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/CodeGenerationMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/CodeGenerationSettings.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/ContextSensitiveImportRewriteContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/GetterSetterUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/IRequestQuery.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/ImportReferencesCollector.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/OrganizeImportsOperation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/SortMembersOperation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/StubUtility.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/StubUtility2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/ASTFlattener.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/ASTNodeFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/ASTNodes.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/Bindings.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/BodyDeclarationRewrite.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/CodeScopeBuilder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/GenericVisitor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/HierarchicalASTVisitor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/JdtASTMatcher.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/LinkedNodeFinder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/LocalVariableIndex.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/ModifierRewrite.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/NodeFinder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/ReplaceRewrite.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/ScopeAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/Selection.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/SelectionAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/StatementRewrite.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/TokenScanner.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/TypeBindingVisitor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/TypeRules.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/VariableDeclarationRewrite.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/fragments/ASTFragment.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/fragments/ASTFragmentFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/fragments/ASTMatchingFragmentFinder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/fragments/AssociativeInfixExpressionFragment.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/fragments/IASTFragment.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/fragments/IExpressionFragment.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/fragments/SimpleExpressionFragment.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/fragments/SimpleFragment.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/fragments/Util.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/AbstractFix.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/CleanUpConstants.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/CleanUpPostSaveListener.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/CleanUpPreferenceUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/CleanUpRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/CodeStyleFix.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/ControlStatementsFix.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/ConvertForLoopOperation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/ConvertIterableLoopOperation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/ConvertLoopFix.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/ConvertLoopOperation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/ExpressionsFix.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/FixMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/FixMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/IFix.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/IFixRewriteOperation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/ILinkedFixRewriteOperation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/ImportsFix.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/LinkedFix.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/LinkedProposalModel.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/LinkedProposalPositionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/SortMembersFix.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/StringFix.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/UnusedCodeFix.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/VariableDeclarationFix.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/javadoc/JavaDocCommentReader.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/javadoc/JavaDocLocations.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/AbstractJavaElementRenameChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/Checks.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/CollectingSearchRequestor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/CuCollectingSearchRequestor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/ExceptionInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/IRefactoringSearchRequestor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/JDTRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/JDTRefactoringDescriptor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/JDTRefactoringDescriptorComment.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/JavaRefactoringArguments.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/ParameterInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/RefactoringAvailabilityTester.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/RefactoringCoreMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/RefactoringElementFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/RefactoringExecutionStarter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/RefactoringScopeFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/RefactoringSearchEngine.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/RefactoringSearchEngine2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/ReturnTypeInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/SearchResultGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/StubTypeContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/TypeContextChecker.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/TypedSource.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/base/JDTChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/base/JavaStatusContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/base/JavaStringStatusContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/base/RefactoringStatusCodes.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/binary/AbstractCodeCreationOperation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/binary/SourceCreationOperation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/binary/StubCreationOperation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/binary/StubCreator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/AbstractDeleteChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/AddToClasspathChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/CompilationUnitChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/CompilationUnitReorgChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/CopyCompilationUnitChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/CopyPackageChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/CopyPackageFragmentRootChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/CopyResourceChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/CreateCompilationUnitChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/CreatePackageChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/DeleteFileChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/DeleteFolderChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/DeleteFromClasspathChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/DeletePackageFragmentRootChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/DeleteSourceManipulationChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/DynamicValidationRefactoringChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/DynamicValidationStateChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/MoveCompilationUnitChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/MovePackageChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/MovePackageFragmentRootChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/MoveResourceChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/MultiStateCompilationUnitChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/PackageFragmentRootReorgChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/PackageReorgChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/RefactoringDescriptorChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/RenameCompilationUnitChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/RenameJavaProjectChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/RenamePackageChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/RenameResourceChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/RenameSourceFolderChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/ResourceReorgChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/TextChangeCompatibility.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/UndoCompilationUnitChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/UndoDeleteResourceChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/UndoablePackageDeleteChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/Utils.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/changes/WorkspaceTracker.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/AstMatchingNodeFinder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/CallContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/CallInliner.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/CodeRefactoringUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/ConstantChecks.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/ConvertAnonymousToNestedRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/ExceptionAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/ExtractConstantRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/ExtractMethodAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/ExtractTempRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/InlineConstantRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/InlineMethodRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/InlineTempRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/IntroduceFactoryRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/IntroduceIndirectionRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/IntroduceParameterRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/Invocations.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/LocalTypeAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/NameCollector.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/OperatorPrecedence.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/ParameterData.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/PromoteTempToFieldRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/ReplaceInvocationsRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/ScriptableRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/SnippetFinder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/SourceAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/SourceProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/TargetProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/TempAssignmentFinder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/BlockFlowInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/BranchFlowInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/ConditionalFlowInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/DoWhileFlowInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/EnhancedForFlowInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/FlowAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/FlowContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/FlowInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/ForFlowInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/GenericConditionalFlowInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/GenericSequentialFlowInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/IfFlowInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/InOutFlowAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/InputFlowAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/LocalFlowInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/MessageSendFlowInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/ReturnFlowInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/SwitchFlowInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/ThrowFlowInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/TryFlowInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/TypeVariableFlowInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/WhileFlowInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/WithFlowInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/delegates/DelegateCreator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/delegates/DelegateFieldCreator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/delegates/DelegateMethodCreator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/AccessorClassCreator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/AccessorClassModifier.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/AccessorClassReference.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/KeyValuePair.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/NLSElement.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/NLSHint.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/NLSHintHelper.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/NLSLine.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/NLSMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/NLSMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/NLSPropertyFileModifier.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/NLSRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/NLSScanner.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/NLSSourceModifier.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/NLSSubstitution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/NLSUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/PropertyFileDocumentModel.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/SimpleLineReader.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/changes/CreateFileChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/changes/CreateTextFileChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/changes/DeleteFileChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/changes/NLSChangesMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/nls/changes/NLSChangesMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/participants/JavaProcessors.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/participants/RefactoringProcessors.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/participants/ResourceModifications.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/participants/ResourceProcessors.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/refactoring.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/GenericRefactoringHandleTransplanter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/JavaRenameProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/JavaRenameRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/MethodChecks.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/MethodOccurenceCollector.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RefactoringAnalyzeUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RefactoringHandleTransplanter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RefactoringScanner.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenameAnalyzeUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenameCompilationUnitProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenameFieldProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenameJavaProjectProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenameLocalVariableProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenameMethodProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenameModifications.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenameNonVirtualMethodProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenamePackageProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenameResourceProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenameSourceFolderProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenameTypeProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenameVirtualMethodProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenamingNameSuggestor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RippleMethodFinder2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/TempDeclarationFinder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/TempOccurrenceAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/TextMatchUpdater.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/TypeOccurrenceCollector.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/todo.txt create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/ASTNodeDeleteUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/ArrayTypeConverter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/CopyModifications.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/CreateCopyOfCompilationUnitChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/CreateTargetExecutionLog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/DeleteChangeCreator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/DeleteModifications.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/IConfirmQuery.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/ICreateTargetQueries.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/ICreateTargetQuery.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/INewNameQueries.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/INewNameQuery.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/IPackageFragmentRootManipulationQuery.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/IReorgDestinationValidator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/IReorgPolicy.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/IReorgQueries.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/JDTCopyRefactoringDescriptor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/JDTMoveRefactoringDescriptor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/JavaCopyProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/JavaCopyRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/JavaDeleteProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/JavaDeleteRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/JavaElementTransfer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/JavaMoveProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/LoggedCreateTargetChange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/LoggedCreateTargetQueries.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/LoggedNewNameQueries.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/MonitoringCreateTargetQueries.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/MonitoringNewNameQueries.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/MoveCuUpdateCreator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/MoveModifications.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/NullReorgQueries.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/OverwriteHelper.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/ParentChecker.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/ReadOnlyResourceFinder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/RefactoringModifications.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/ReorgPolicyFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/ReorgUtils.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/SourceReferenceUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/ChangeMethodSignatureRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/ChangeTypeRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/ConvertAnonymousRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/CopyRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/DeleteRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/ExtractConstantRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/ExtractMethodRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/ExtractSupertypeRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/ExtractTempRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/InlineConstantRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/InlineMethodRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/InlineTempRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/IntroduceFactoryRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/IntroduceIndirectionRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/IntroduceParameterRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/MoveMemberTypeRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/MoveMethodRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/MoveRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/MoveStaticMembersRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/PromoteTempToFieldRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/PullUpRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/PushDownRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/RenameCompilationUnitRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/RenameFieldRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/RenameJavaProjectRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/RenameLocalVariableRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/RenameMethodRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/RenamePackageRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/RenameResourceRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/RenameSourceFolderRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/RenameTypeRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/SelfEncapsulateRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/UseSupertypeRefactoringContribution.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/sef/AccessAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/sef/SelfEncapsulateFieldRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ASTNodeSearchUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/BodyUpdater.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ChangeSignatureRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ChangeTypeRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/CompilationUnitRewrite.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ConstructorReferenceFinder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ExtractInterfaceConstraintsSolver.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ExtractSupertypeProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ExtractSupertypeRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/HierarchyProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/IDefaultValueAdvisor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/IMemberActionInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ImportRemover.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ImportRewriteUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/JavaMoveRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/MemberCheckUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/MemberVisibilityAdjustor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/MoveInnerToTopRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/MoveInstanceMethodProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/MoveInstanceMethodRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/MoveStaticMemberAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/MoveStaticMembersProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/MovedMemberAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/PullUpRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/PullUpRefactoringProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/PushDownRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/PushDownRefactoringProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ReferenceAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ReferenceFinderUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/TypeVariableMaplet.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/UseSuperTypeProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/UseSuperTypeRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/constraints/ConditionalTypeConstraint.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/constraints/CovariantTypeConstraint.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/constraints/SuperTypeConstraintsCreator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/constraints/SuperTypeConstraintsModel.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/constraints/SuperTypeConstraintsSolver.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/constraints/SuperTypeRefactoringProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/constraints/SuperTypeSet.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/surround/ExceptionAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/surround/ISurroundWithTryCatchQuery.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/surround/LocalDeclarationAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/surround/SurroundWithAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/surround/SurroundWithTryCatchAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/surround/SurroundWithTryCatchRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/tagging/ICommentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/tagging/IDelegateUpdating.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/tagging/INameUpdating.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/tagging/IQualifiedNameUpdating.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/tagging/IReferenceUpdating.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/tagging/IScriptableRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/tagging/ISimilarDeclarationUpdating.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/tagging/ITextUpdating.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/ASTCreator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/CompilationUnitRange.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/CompositeOrTypeConstraint.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/ConstraintCollector.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/ConstraintCreator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/ConstraintOperator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/ConstraintVariable.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/ConstraintVariableFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/DeclaringTypeVariable.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/ExpressionVariable.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/FullConstraintCreator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/IConstraintVariableFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/IContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/ITypeConstraint.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/ITypeConstraintFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/NullContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/ParameterTypeVariable.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/RawBindingVariable.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/ReturnTypeVariable.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/SimpleTypeConstraint.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/TypeConstraintFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/TypeVariable.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/types/AbstractTypeVariable.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/types/ArrayType.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/types/CaptureType.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/types/GenericType.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/types/HierarchyType.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/types/NullType.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/types/PrimitiveType.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/types/RawType.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/types/StandardType.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/types/TType.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/types/TypeEnvironment.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/types/TypeTuple.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/types/UnboundWildcardType.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/types/VoidType.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/types/WildcardType.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/typesets/ArraySuperTypeSet.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/typesets/ArrayTypeSet.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/typesets/EmptyTypeSet.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/typesets/EnumeratedTypeSet.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/typesets/SingletonTypeSet.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/typesets/SubTypesOfSingleton.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/typesets/SubTypesSet.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/typesets/SuperTypesOfSingleton.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/typesets/SuperTypesSet.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/typesets/TypeSet.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/typesets/TypeSetEnvironment.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/typesets/TypeSetIntersection.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/typesets/TypeSetUnion.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints/typesets/TypeUniverseSet.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints2/ArrayElementVariable2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints2/ArrayTypeVariable2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints2/CastVariable2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints2/CollectionElementVariable2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints2/ConstraintVariable2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints2/ISourceConstraintVariable.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints2/ITypeConstraint2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints2/ITypeConstraintVariable.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints2/ITypeSet.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints2/ImmutableTypeVariable2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints2/IndependentTypeVariable2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints2/ParameterTypeVariable2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints2/ParameterizedTypeVariable2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints2/ReturnTypeVariable2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints2/SubTypeConstraint2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints2/TTypes.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints2/TypeEquivalenceSet.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints2/TypeVariable2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/typeconstraints2/VariableVariable2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/AbstractExceptionAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/Changes.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/CodeAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/CommentAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/JavaElementUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/JavadocUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/NoCommentSourceRangeComputer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/QualifiedNameFinder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/QualifiedNameSearchResult.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/RefactoringASTParser.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/RefactoringFileBuffers.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/ResourceUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/SelectionAwareSourceRangeComputer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/StatementAnalyzer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/TextChangeManager.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/TextEditBasedChangeManager.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/TightSourceRangeComputer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/CodeTemplateContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/CodeTemplateContextType.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/CodeTemplates.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/CompilationUnitCompletion.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/CompilationUnitContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/CompilationUnitContextType.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/ElementTypeResolver.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/ExclusivePositionUpdater.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/FieldResolver.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/JavaContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/JavaContextType.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/JavaDocContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/JavaDocContextType.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/JavaFormatter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/JavaTemplateMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/JavaTemplateMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/JavaVariable.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/LocalVarResolver.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/NameResolver.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/SignatureUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/TemplateSet.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/Templates.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/TypeVariableResolver.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/template/java/VarResolver.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/CodeFormatterUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/History.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/IOCloser.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/JavaElementResourceMapping.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/JavaModelUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/JdtFlags.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/LRUMap.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/Messages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/MethodOverrideTester.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/OpenTypeHistory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/QualifiedTypeNameHistory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/Resources.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/SearchUtils.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/Strings.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/SuperTypeHierarchyCache.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/TypeFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/TypeInfoFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/TypeInfoRequestorAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/TypeNameMatchCollector.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/CompatibilityTemplateStore.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/EditorInputAdapterFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/IJavaHelpContextIds.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/IJavaStatusConstants.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/IJavaThemeConstants.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/IJsGlobalScopeContainerInitializerExtension.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/IProductConstants.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/IResourceLocator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/IUIConstants.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/InitializeAfterLoadJob.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaElementAdapterFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaElementContainmentAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaElementProperties.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaPerspectiveFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaPluginImages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaProjectAdapterFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaScriptPlugin.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaTaskListAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaUIException.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaUIMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaUIMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaUIPreferenceInitializer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaUIStatus.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaWorkbenchAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/Logger.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/LogicalPackageAdapterFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/MarkerAdapterFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/PersistableJavaElementFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/ProductProperties.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/ResourceAdapterFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/ResourceLocator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/SetupProjectsWizzard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/SharedImages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/AbstractToggleLinkingAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/ActionMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/ActionMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/ActionUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/AddBlockCommentAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/AddTaskAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/AllCleanUpsAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/BlockCommentAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/CategoryFilterActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/CleanUpAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/CompositeActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/ConfigureContainerAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/CopyQualifiedNameAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/ExtractSuperClassAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/FindBrokenNLSKeysAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/FoldingActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/FoldingMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/FoldingMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/GenerateConstructorUsingFieldsContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/GenerateConstructorUsingFieldsSelectionDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/GenerateConstructorUsingFieldsValidator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/GenerateJavadocAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/IndentAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/JDTQuickMenuAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/LexicalSortingAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/MultiActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/MultiOrganizeImportAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/MultiSortMembersAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/NewWizardsActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/OccurrencesSearchMenuAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/OpenBrowserUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/OpenTypeAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/OpenTypeInHierarchyAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/QuickMenuAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/RemoveBlockCommentAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/SelectAllAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/SelectionConverter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/SurroundWithActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/SurroundWithTemplateMenuAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/WorkbenchRunnableAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/IPackagesViewViewer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/JavaBrowsingContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/JavaBrowsingMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/JavaBrowsingMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/JavaBrowsingPart.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/JavaBrowsingPerspectiveFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/JavaElementTypeComparator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/LogicalPackage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/LogicalPackagesProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/MembersView.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/PackageViewerWrapper.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/PackagesView.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/PackagesViewFlatContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/PackagesViewHierarchicalContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/PackagesViewLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/PackagesViewTableViewer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/PackagesViewTreeViewer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/PatchedOpenInNewWindowAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/ProjectAndSourceFolderContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/ProjectsView.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/ToggleLinkingAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/TopLevelTypeProblemsLabelDecorator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/browsing/TypesView.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/CallHierarchyContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/CallHierarchyFiltersActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/CallHierarchyImageDescriptor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/CallHierarchyLabelDecorator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/CallHierarchyLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/CallHierarchyMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/CallHierarchyMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/CallHierarchyTransferDropAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/CallHierarchyUI.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/CallHierarchyViewPart.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/CallHierarchyViewer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/CancelSearchAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/CopyCallHierarchyAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/DeferredMethodWrapper.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/FiltersDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/FocusOnSelectionAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/HistoryAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/HistoryDropDownAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/HistoryListAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/ICallHierarchyViewPart.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/LocationCopyAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/LocationLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/LocationViewer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/MethodWrapperWorkbenchAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/OpenCallHierarchyAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/OpenDeclarationAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/OpenLocationAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/RefreshAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/SearchScopeAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/SearchScopeActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/SearchScopeHierarchyAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/SearchScopeProjectAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/SearchScopeWorkingSetAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/SearchScopeWorkspaceAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/SearchUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/SelectWorkingSetAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/ToggleCallModeAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/ToggleOrientationAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/TreeRoot.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/callhierarchy/TreeTermination.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/commands/JavaElementReferenceConverter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/commands/OpenElementInEditorHandler.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/commands/ShowElementInPackageViewHandler.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/commands/ShowElementInTypeHierarchyViewHandler.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/AddFromHistoryAction.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/CompareAction.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/CompareDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/CompareMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/CompareMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/CompareWithEditionAction.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/EclipsePreferencesAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaAddElementFromHistory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaAddElementFromHistoryImpl.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaCompareAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaCompareUtilities.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaCompareWithEditionAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaCompareWithEditionActionImpl.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaContentViewerCreator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaElementHistoryPageSource.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaHistoryAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaHistoryActionImpl.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaMergeViewer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaNode.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaParseTreeBuilder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaReplaceWithEditionAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaReplaceWithEditionActionImpl.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaReplaceWithPreviousEditionAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaStructureCreator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaStructureDiffViewer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaStructureDiffViewerCreator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaTextBufferNode.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaTextViewer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaTextViewerCreator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaTokenComparator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/LocalHistoryActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/ReplaceWithEditionAction.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/ResizableDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/TextMergeViewerCreator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/DialogsMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/DialogsMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/FilteredTypesSelectionDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/ListDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/MultiElementListSelectionDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/OpenTypeSelectionDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/OpenTypeSelectionDialog2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/OptionalMessageDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/OverrideMethodDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/PackageSelectionDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/SortMembersMessageDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/SourceActionDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/StatusInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/StatusUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/TableTextCellEditor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/TextFieldNavigationHandler.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/TypeInfoViewer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/TypeSelectionComponent.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/TypeSelectionDialog2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dnd/BasicSelectionTransferDragAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dnd/DelegatingDragAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dnd/DelegatingDropAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dnd/JdtViewerDragAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dnd/JdtViewerDropAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dnd/ResourceTransferDragAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/ClassFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/ClosedProjectFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/ContainedLibraryFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/CustomFiltersDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/EmptyInnerPackageFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/EmptyPackageFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/FieldsFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/FilterDescriptor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/FilterMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/FilterMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/ImportDeclarationFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/JavaFileFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/LibraryFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/LocalTypesFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/NamePatternFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/NoPackageContainingFoldersFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/NonJavaElementFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/NonPublicFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/NonPublicTypeFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/NonSharedProjectFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/StaticsFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/AbstractCleanUp.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/CleanUpRefactoringWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/CleanUpSaveParticipantConfigurationModifyDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/CleanUpSaveParticipantPreferenceConfiguration.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/CodeFormatCleanUp.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/CodeFormatFix.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/CodeStyleCleanUp.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/CommentFormatCleanUp.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/CommentFormatFix.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/ControlStatementsCleanUp.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/ConvertLoopCleanUp.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/ExpressionsCleanUp.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/ICleanUp.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/ImportsCleanUp.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/MultiFixMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/MultiFixMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/SaveParticipantMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/SaveParticipantMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/SortMembersCleanUp.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/StringCleanUp.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/UnnecessaryCodeCleanUp.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/UnusedCodeCleanUp.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/fix/VariableDeclarationCleanUp.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/infoviews/AbstractInfoView.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/infoviews/CopyToClipboardAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/infoviews/GotoInputAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/infoviews/InfoViewMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/infoviews/InfoViewMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/infoviews/JavadocView.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/infoviews/SourceView.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/infoviews/TextSelectionConverter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javadocexport/CheckboxTreeAndListGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javadocexport/CreateJavadocActionDelegate.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javadocexport/JavadocConsoleLineTracker.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javadocexport/JavadocExportMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javadocexport/JavadocExportMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javadocexport/JavadocLinkDialogLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javadocexport/JavadocLinkRef.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javadocexport/JavadocMemberContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javadocexport/JavadocOptionsManager.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javadocexport/JavadocProjectContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javadocexport/JavadocReader.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javadocexport/JavadocSpecificsWizardPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javadocexport/JavadocStandardWizardPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javadocexport/JavadocTreeWizardPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javadocexport/JavadocWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javadocexport/JavadocWizardPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javadocexport/JavadocWriter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javadocexport/RecentSettingsStore.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/ASTProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/AddClassFileMarkerAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/AddImportOnSelectionAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/BasicCompilationUnitEditorActionContributor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/BasicJavaEditorActionContributor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/ClassFileDocumentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/ClassFileEditor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/ClassFileEditorActionContributor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/ClassFileEditorInputFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/ClassFileMarkerAnnotationModel.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/ClassFileMarkerRulerAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/ClipboardOperationAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/CompilationUnitAnnotationModelEvent.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/CompilationUnitEditor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/CompilationUnitEditorActionContributor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/CompoundEditExitStrategy.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/ConstructedJavaEditorMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/DocumentAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/EditorHighlightingSynchronizer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/EditorUtility.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/ExternalClassFileEditorInput.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/GotoMatchingBracketAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/IClassFileEditorInput.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/ICompilationUnitDocumentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/ICompoundEditListener.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/IJavaAnnotation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/IJavaEditorActionConstants.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/ISavePolicy.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/IndentUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/InternalClassFileEditorInput.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JarEntryEditorInput.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaAnnotationImageProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaAnnotationIterator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaDocumentSetupParticipant.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaEditor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaEditorErrorTickUpdater.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaEditorMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaEditorMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaElementHyperlink.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaElementHyperlinkDetector.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaMarkerAnnotation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaMoveLinesAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaOutlinePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaSelectAnnotationRulerAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaSelectMarkerRulerAction2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaSelectRulerAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaSourceViewer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaTextSelection.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/NLSKeyHyperlink.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/NLSKeyHyperlinkDetector.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/OverrideIndicatorImageProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/OverrideIndicatorManager.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/RemoveOccurrenceAnnotations.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/SemanticHighlighting.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/SemanticHighlightingManager.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/SemanticHighlightingPresenter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/SemanticHighlightingReconciler.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/SemanticHighlightings.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/SemanticToken.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/SpecificContentAssistAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/SpecificContentAssistExecutor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/StorageMarkerAnnotationModel.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/ToggleCommentAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/ToggleMarkOccurrencesAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/TogglePresentationAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/ToggleTextHoverAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/WorkingCopyManager.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/saveparticipant/AbstractSaveParticipantPreferenceConfiguration.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/saveparticipant/IPostSaveListener.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/saveparticipant/ISaveParticipantPreferenceConfiguration.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/saveparticipant/SaveParticipantDescriptor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/saveparticipant/SaveParticipantMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/saveparticipant/SaveParticipantMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/saveparticipant/SaveParticipantRegistry.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/selectionactions/GoToNextPreviousMemberAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/selectionactions/SelectionActionMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/selectionactions/SelectionActionMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/selectionactions/SelectionHistory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/selectionactions/StructureSelectEnclosingAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/selectionactions/StructureSelectHistoryAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/selectionactions/StructureSelectNextAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/selectionactions/StructureSelectPreviousAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/selectionactions/StructureSelectionAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/model/JavaModelAdapterFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/model/JavaModelContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/model/JavaModelLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/model/JavaModelMerger.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/model/JavaModelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/model/JavaRefactoringDescriptorResourceMapping.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/model/JavaRefactoringHistoryResourceMapping.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/model/JavaResourceMapping.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/model/JavaSynchronizationCompareAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/model/JavaSynchronizationContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/model/JavaSynchronizationLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/model/ModelMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/model/ModelMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/navigator/CommonLayoutActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/navigator/ContainerFolder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/navigator/IExtensionStateConstants.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/navigator/JavaDropAdapterAssistant.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/navigator/JavaFileLinkHelper.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/navigator/JavaNavigatorActionProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/navigator/JavaNavigatorContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/navigator/JavaNavigatorLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/navigator/JavaNavigatorRefactorActionProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/navigator/JavaNavigatorViewActionProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/navigator/NonEssentialElementsFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/navigator/NonEssentialEmptyInnerPackageFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/navigator/NonEssentialEmptyPackageFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/navigator/OpenAndExpand.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/navigator/PackageExplorerOpenActionProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/CollapseAllAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/CustomHashtable.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/DefaultElementComparer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/FileTransferDragAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/FileTransferDropAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/GotoPackageAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/GotoRequiredProjectAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/GotoResourceAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/GotoTypeAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/HierarchicalDecorationContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/IMultiElementTreeContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/JsGlobalScopeContainer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/LayoutActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/LibraryContainer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/NamespaceGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/PackageExplorerActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/PackageExplorerContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/PackageExplorerLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/PackageExplorerPart.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/PackageExplorerProblemsDecorator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/PackageFragmentRootContainer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/PackagesFrameSource.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/PackagesMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/PackagesMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/ScriptExplorerContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/SelectionTransferDragAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/SelectionTransferDropAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/ToggleLinkingAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/WorkingSetAwareContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/WorkingSetAwareJavaElementSorter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/packageview/WorkingSetDropAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/AbstractConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/AbstractConfigurationBlockPreferenceAndPropertyPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/AbstractConfigurationBlockPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/AppearancePreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/BuildPathsPropertyPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/BulletListBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/CleanUpPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/CodeAssistAdvancedConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/CodeAssistAdvancedPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/CodeAssistConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/CodeAssistFavoritesConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/CodeAssistFavoritesPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/CodeAssistPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/CodeFormatterPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/CodeFormatterPreviewCode.txt create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/CodeStylePreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/CodeTemplateBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/CodeTemplatePreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/CodeTemplateSourceViewerConfiguration.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/ColorSettingPreviewCode.txt create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/ComplianceConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/CompliancePreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/EditTemplateDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/FoldingConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/FoldingPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/IPreferenceAndPropertyConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/IPreferenceConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/ImportOrganizeConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/ImportOrganizeInputDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/ImportOrganizePreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/JavaBasePreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/JavaBuildConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/JavaBuildPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/JavaCategoryPropertyPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/JavaEditorAppearanceConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/JavaEditorColoringConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/JavaEditorColoringPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/JavaEditorHoverConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/JavaEditorHoverPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/JavaEditorPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/JavaEditorPropertyPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/JavaElementInfoPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/JavaPreferencesSettings.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/JavaScriptMainPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/JavaSourcePreviewerUpdater.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/JavaTemplatePreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/JavadocConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/JavadocConfigurationPropertyPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/JavadocProblemsConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/JavadocProblemsPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/MarkOccurrencesConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/MarkOccurrencesPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/MembersOrderPreferenceCache.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/MembersOrderPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/MockupPreferenceStore.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/NameConventionConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/NewJavaProjectPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/OccurrencesPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/OptionsConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/OverlayPreferenceStore.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesAccess.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/ProblemSeveritiesPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/ProfilePreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/ProjectSelectionDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/PropertiesFileEditorColorSettingPreviewCode.txt create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/PropertyAndPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/SaveParticipantConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/SaveParticipantPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/ScrolledPageContent.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/SmartTypingConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/SmartTypingPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/SourceAttachmentPropertyPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/TodoTaskConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/TodoTaskInputDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/TodoTaskPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/TypeFilterInputDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/TypeFilterPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/UserLibraryPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/WorkInProgressPreferencePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/CleanUpConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/CleanUpMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/CleanUpMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/CleanUpModifyDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/CleanUpPreview.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/CleanUpProfileManager.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/CleanUpProfileVersioner.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/CleanUpTabPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/CodeFormatingTabPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/CodeStyleTabPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/UnnecessaryCodeTabPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/AlreadyExistsDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/BlankLinesTabPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/BracesTabPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/CodeFormatterConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/CommentsTabPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/CompilationUnitPreview.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/ControlStatementsTabPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/CreateProfileDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/FormatterMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/FormatterMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/FormatterModifyDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/FormatterProfileManager.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/FormatterProfileStore.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/FormatterTabPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/IProfileVersioner.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/IndentationTabPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/JavaPreview.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/LineWrappingTabPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/ModifyDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/ModifyDialogTabPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/NewLinesTabPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/ProfileConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/ProfileManager.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/ProfileStore.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/ProfileVersioner.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/SnippetPreview.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/WhiteSpaceOptions.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/formatter/WhiteSpaceTabPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/ChangeExceptionHandler.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/ChangeExceptionsControl.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/ChangeParametersControl.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/ChangeSignatureWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/ChangeTypeContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/ChangeTypeWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/ComboSelectionDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/CompilationUnitChangeNode.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/ConvertAnonymousToNestedWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/CreateTextFileChangePreviewViewer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/DelegateUIHelper.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/ExtractConstantWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/ExtractSupertypeMemberPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/ExtractSupertypeMethodPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/ExtractSupertypeWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/ExtractTempWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/IExceptionListChangeListener.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/IParameterListChangeListener.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/IScheduledRefactoring.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/IVisibilityChangeListener.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/InlineConstantWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/InlineTempWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/IntroduceFactoryInputPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/IntroduceFactoryWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/IntroduceIndirectionInputPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/IntroduceIndirectionWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/IntroduceParameterWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/JavaStatusContextViewer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/MessageWizardPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/MoveInnerToTopWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/MoveInstanceMethodWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/MoveMembersWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/ParameterEditDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/PromoteTempWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/PullPushCheckboxTableViewer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/PullUpMemberPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/PullUpMethodPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/PullUpWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/PushDownWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/QualifiedNameComponent.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/RefactoringAdapterFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/RefactoringExecutionHelper.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/RefactoringMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/RefactoringSaveHelper.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/RefactoringSavePreferences.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/TextInputWizardPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/UseSupertypeWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/UserInterfaceManager.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/UserInterfaceStarter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/VisibilityControlUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/actions/ApplyRefactoringScriptAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/actions/CreateRefactoringScriptAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/actions/InlineConstantAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/actions/InlineMethodAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/actions/ListDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/actions/MoveInstanceMethodAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/actions/MoveStaticMembersAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/actions/RefactoringActions.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/actions/RefactoringStarter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/actions/RenameJavaElementAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/actions/RenameResourceAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/actions/ShowRefactoringHistoryAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/binary/BinaryRefactoringHistoryWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/code/ExtractMethodInputPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/code/ExtractMethodWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/code/InlineMethodInputPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/code/InlineMethodWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/code/ReplaceInvocationsInputPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/code/ReplaceInvocationsWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/contentassist/CUPositionCompletionProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/contentassist/CompletionContextRequestor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/contentassist/ControlContentAssistHelper.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/contentassist/FieldNameProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/contentassist/JavaPackageCompletionProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/contentassist/JavaPackageFragmentRootCompletionProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/contentassist/JavaSourcePackageFragmentRootCompletionProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/contentassist/JavaTypeCompletionProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/contentassist/VariableNamesProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/AccessorDescription.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/ExternalizeWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/ExternalizeWizardPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/MultiStateCellEditor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/NLSAccessorConfigurationDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/NLSUIMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/NLSUIMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/PackageBrowseAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/PackageFragmentSelection.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/PackageSelectionDialogButtonField.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/PackageSelectionStringButtonAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/RenameKeysDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/SourceChangeListener.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/SourceContainerDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/SourceFirstPackageSelectionDialogField.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/SourceFolderSelectionDialogButtonField.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/search/CompilationUnitEntry.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/search/FileEntry.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/search/LineReader.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/search/NLSSearchEditorOpener.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/search/NLSSearchMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/search/NLSSearchMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/search/NLSSearchQuery.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/search/NLSSearchResult.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/search/NLSSearchResultLabelProvider2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/search/NLSSearchResultPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/search/NLSSearchResultRequestor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/search/Properties.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/nls/search/SearchBrokenNLSKeysUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/refactoringui.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/CopyToClipboardAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/CreateTargetQueries.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/CutAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/DeleteAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/DeleteUserInterfaceManager.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/DeleteWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/DestinationContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/NewNameQueries.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/PasteAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameCuWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameFieldWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameInformationPopup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameInputWizardPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameJavaProjectWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameLinkedMode.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameLocalVariableWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameMethodUserInterfaceStarter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameMethodWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenamePackageWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameRefactoringWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameResourceWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameSelectionState.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameSourceFolderWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameTypeParameterWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameTypeWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameTypeWizardInputPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameTypeWizardSimilarElementsOptionsDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameTypeWizardSimilarElementsPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameUserInterfaceManager.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameUserInterfaceStarter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/ReorgCopyAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/ReorgCopyStarter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/ReorgCopyWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/ReorgMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/ReorgMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/ReorgMoveAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/ReorgMoveStarter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/ReorgMoveWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/ReorgQueries.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/ReorgUserInputPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/TypedSourceTransfer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/sef/SelfEncapsulateFieldInputPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/sef/SelfEncapsulateFieldWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/BreakContinueTargetFinder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/ExceptionOccurrencesFinder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/ExceptionOccurrencesGroupKey.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/FindOccurrencesEngine.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/GroupAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/IOccurrencesFinder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/ImplementOccurrencesFinder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/JavaElementLine.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/JavaElementMatch.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/JavaMatchFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/JavaSearchContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/JavaSearchEditorOpener.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/JavaSearchPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/JavaSearchPageScoreComputer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/JavaSearchQuery.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/JavaSearchResult.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/JavaSearchResultPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/JavaSearchScopeFactory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/JavaSearchTableContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/LRUWorkingSetsList.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/LevelTreeContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/MethodExitsFinder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/NewSearchResultCollector.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/NewSearchViewActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/OccurrencesFinder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/OccurrencesGroupKey.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/OccurrencesSearchLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/OccurrencesSearchQuery.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/OccurrencesSearchResult.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/OccurrencesSearchResultPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/OpenJavaSearchPageAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/PatternStrings.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/PostfixLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/SearchLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/SearchMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/SearchMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/SearchParticipantDescriptor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/SearchParticipantRecord.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/SearchParticipantsExtensionPoint.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/SearchResultUpdater.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/SearchUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/SortAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/SortingLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/TextSearchLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/TextSearchTableContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/WorkingSetComparator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/WorkingSetsComparator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/AbstractInformationControl.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/AbstractJavaScanner.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/BufferedDocumentScanner.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/ChangeHoverInformationControl.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/CombinedWordRule.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/CompositeReconcilingStrategy.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/ContentAssistPreference.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/DocumentCharacterIterator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/FastJavaPartitionScanner.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/HTMLAnnotationHover.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/ISourceVersionDependent.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/ITypingRunListener.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/JavaBreakIterator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/JavaChangeHover.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/JavaCodeReader.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/JavaColorManager.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/JavaCommentScanner.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/JavaCompositeReconcilingStrategy.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/JavaElementProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/JavaHeuristicScanner.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/JavaIndenter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/JavaOutlineInformationControl.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/JavaPairMatcher.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/JavaPartitionScanner.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/JavaPresentationReconciler.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/JavaReconciler.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/JavaWhitespaceDetector.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/JavaWordDetector.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/JavaWordFinder.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/JavaWordIterator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/LineBreakingReader.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/PreferencesAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/SequenceCharacterIterator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/SimpleJavaSourceViewerConfiguration.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/SingleTokenJavaScanner.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/SmartBackspaceManager.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/Symbols.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/TextMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/TextMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/TypingRun.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/TypingRunDetector.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/comment/CommentFormattingContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/comment/CommentFormattingStrategy.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ASTResolving.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ASTRewriteCorrectionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/AbstractMethodCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/AddArgumentCorrectionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/AddImportCorrectionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/AdvancedQuickAssistProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/AssignToVariableAssistProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/AssistContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/CUCorrectionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ChangeCorrectionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ChangeMethodSignatureProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ConstructorFromSuperclassProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ContributedProcessorDescriptor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/CorrectMainTypeNameProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/CorrectionCommandHandler.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/CorrectionCommandInstaller.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/CorrectionMarkerResolutionGenerator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/CorrectionMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/CorrectionMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/FixCorrectionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ICommandAccess.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/IStatusLineProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/JavaCorrectionAssistant.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/JavaCorrectionProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/JavadocTagsSubProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/LinkedCorrectionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/LinkedNamesAssistProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/MarkerResolutionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/MissingReturnTypeCorrectionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ModifierChangeCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/NameMatcher.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/NewCUCompletionUsingWizardProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/NewDefiningMethodProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/NewMethodCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/NewVariableCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ProblemLocation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/QuickAssistLightBulbUpdater.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/QuickAssistProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/QuickFixProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/QuickTemplateProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/RemoveDeclarationCorrectionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/RenameNodeCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ReorgCorrectionsSubProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ReplaceCorrectionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ReturnTypeSubProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/SimilarElement.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/SimilarElementsRequestor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/SurroundWith.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/TaskMarkerProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/TypeChangeCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/TypeMismatchSubProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/UnimplementedMethodsCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/UnresolvedElementsSubProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/folding/DefaultJavaFoldingPreferenceBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/folding/EmptyJavaFoldingPreferenceBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/folding/FoldingMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/folding/FoldingMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/folding/JavaFoldingStructureProviderDescriptor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/folding/JavaFoldingStructureProviderRegistry.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/html/BrowserInformationControl.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/html/HTML2TextReader.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/html/HTMLMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/html/HTMLMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/html/HTMLPrinter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/html/HTMLTextPresenter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/html/SingleCharReader.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/html/SubstitutionTextReader.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/AbstractJavaCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/AlphabeticSorter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/AnonymousTypeCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/AnonymousTypeProposalInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/CompletionProposalCategory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/CompletionProposalComputerDescriptor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/CompletionProposalComputerRegistry.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/ContentAssistComputerParameter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/ContentAssistHistory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/ContentAssistProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/FieldProposalInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/FilledArgumentNamesMethodProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/GetterSetterCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/HippieProposalComputer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/IJavaReconcilingListener.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/IProblemRequestorExtension.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/IReconcilingParticipant.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/ImportCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/JavaAutoIndentStrategy.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/JavaCodeScanner.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/JavaCompletionProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/JavaCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/JavaCompletionProposalComputer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/JavaContentAssistHandler.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/JavaDoubleClickSelector.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/JavaFormattingStrategy.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/JavaMethodCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/JavaNoTypeCompletionProposalComputer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/JavaParameterListValidator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/JavaReconcilingStrategy.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/JavaStringAutoIndentStrategy.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/JavaStringDoubleClickSelector.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/JavaTextMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/JavaTextMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/JavaTypeCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/JavaTypeCompletionProposalComputer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/JavadocDoubleClickStrategy.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/LazyGenericTypeProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/LazyJavaCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/LazyJavaTypeCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/LocalVariableProposalInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/MemberProposalInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/MethodDeclarationCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/MethodProposalInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/OverrideCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/ParameterGuesser.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/ParameterGuessingProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/ProposalContextInformation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/ProposalInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/ProposalSorterHandle.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/ProposalSorterRegistry.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/RelevanceSorter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/SmartSemicolonAutoEditStrategy.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/TemplateCompletionProposalComputer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/TypeProposalInfo.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/hover/AbstractAnnotationHover.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/hover/AbstractJavaEditorTextHover.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/hover/AnnotationExpandHover.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/hover/AnnotationExpansionControl.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/hover/AnnotationHover.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/hover/BestMatchHover.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/hover/JavaEditorTextHoverDescriptor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/hover/JavaEditorTextHoverProxy.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/hover/JavaExpandHover.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/hover/JavaHoverMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/hover/JavaHoverMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/hover/JavaInformationProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/hover/JavaSourceHover.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/hover/JavaTypeHover.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/hover/JavadocHover.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/hover/NLSStringHover.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/hover/ProblemHover.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/hover/SourceViewerInformationControl.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/javadoc/HTMLTagCompletionProposalComputer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/javadoc/IHtmlTagConstants.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/javadoc/IJavaDocTagConstants.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/javadoc/JavaDoc2HTMLTextReader.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/javadoc/JavaDocAutoIndentStrategy.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/javadoc/JavaDocMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/javadoc/JavaDocMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/javadoc/JavaDocScanner.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/javadoc/JavadocCompletionProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/javadoc/JavadocCompletionProposalComputer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/javadoc/JavadocContentAssistInvocationContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/javadoc/JavadocInlineTagCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/javadoc/JavadocLinkTypeCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/javadoc/LegacyJavadocCompletionProposalComputer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/javadoc/OAADocReader.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/JavaSpellingReconcileStrategy.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/SpellingQuickFixProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/engine/AbstractSpellDictionary.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/engine/DefaultPhoneticDistanceAlgorithm.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/engine/DefaultPhoneticHashProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/engine/DefaultSpellChecker.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/engine/IPhoneticDistanceAlgorithm.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/engine/IPhoneticHashProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/engine/ISpellCheckEngine.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/engine/ISpellCheckIterator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/engine/ISpellChecker.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/engine/ISpellDictionary.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/engine/ISpellEvent.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/engine/ISpellEventListener.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/engine/LocaleSensitiveSpellDictionary.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/engine/PersistentSpellDictionary.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/engine/RankedWordProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/engine/SpellEvent.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/template/contentassist/InclusivePositionUpdater.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/template/contentassist/MultiVariable.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/template/contentassist/MultiVariableGuess.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/template/contentassist/PositionBasedCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/template/contentassist/SurroundWithTemplateProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/template/contentassist/TemplateContentAssistMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/template/contentassist/TemplateContentAssistMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/template/contentassist/TemplateEngine.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/template/contentassist/TemplateInformationControlCreator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/template/contentassist/TemplateProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/template/contentassist/VariablePosition.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/template/preferences/TemplateContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/template/preferences/TemplatePreferencesMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/template/preferences/TemplatePreferencesMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/template/preferences/TemplateVariableProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/template/preferences/TemplateVariableProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/AbstractHierarchyViewerSorter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/EnableMemberFilterAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/FocusOnSelectionAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/FocusOnTypeAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/HierarchyInformationControl.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/HierarchyLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/HierarchyViewerSorter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/HistoryAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/HistoryDropDownAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/HistoryListAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/ITypeHierarchyLifeCycleListener.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/MethodsContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/MethodsLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/MethodsViewer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/ShowInheritedMembersAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/ShowQualifiedTypeNamesAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/SortByDefiningTypeAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/SubTypeHierarchyViewer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/SuperTypeHierarchyViewer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/ToggleLinkingAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/ToggleOrientationAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/ToggleViewAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/TraditionalHierarchyViewer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/TypeHierarchyContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/TypeHierarchyLifeCycle.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/TypeHierarchyMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/TypeHierarchyMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/TypeHierarchyTransferDropAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/TypeHierarchyViewer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/BusyIndicatorRunnableContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/ConvertAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/CoreUtility.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/ElementValidator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/ExceptionHandler.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/JSDScopeUiUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/JavaUIHelp.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/JavadocHelpContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/OpenTypeHierarchyUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/PatternConstructor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/PixelConverter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/RowLayouter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/SWTUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/SelectionUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/StringMatcher.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/TableLayoutComposite.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/TypeNameMatchLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/ViewerPane.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/AppearanceAwareLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/BindingLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/ColoredJavaElementLabels.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/ColoredString.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/ColoredViewersManager.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/DecoratingJavaLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/FilterUpdater.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/HistoryDropDownAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/HistoryListAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/IProblemChangedListener.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/IRichLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/ISelectionListenerWithAST.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/IViewPartInputProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/ImageDescriptorRegistry.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/ImageDisposer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/ImageImageDescriptor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/JavaElementImageProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/JavaUILabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/JavaViewerFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/LabelProviderDisposer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/LibraryFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/MemberFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/MemberFilterAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/OwnerDrawSupport.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/ProblemMarkerManager.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/ProblemTableViewer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/ProblemTreeViewer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/ProjectTemplateStore.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/ResourceToItemsMapper.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/SelectionListenerWithASTManager.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/SelectionProviderMediator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/SourcePositionComparator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/StatusBarUpdater.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/StorageLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/TreeHierarchyLayoutProblemsDecorator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/viewsupport/ViewHistory.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/ClassPathDetector.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/IStatusChangeListener.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/JavaProjectWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/JavaProjectWizardFirstPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/JavaProjectWizardSecondPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/NewClassCreationWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/NewElementWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/NewJSFileWizardPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/NewJSWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/NewSourceFolderWizardPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/NewWizardMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/NewWizardMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/OpenJavaScriptFileWizardToolbarAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/OpenJavaScriptProjectWizardToolbarAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/TypedElementSelectionValidator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/TypedViewerFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/AccessRuleEntryDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/AccessRulesDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/AccessRulesLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/AddSourceFolderWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/AddSourceFolderWizardPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/ArchiveFileFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/BuildPathBasePage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/BuildPathSupport.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/BuildPathWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/CPListElement.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/CPListElementAttribute.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/CPListElementSorter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/CPListLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/CPUserLibraryElement.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/ClasspathAttributeConfigurationDescriptors.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/ClasspathOrderingWorkbookPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/CreateMultipleSourceFoldersDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/EditFilterWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/ExclusionInclusionDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/ExclusionInclusionEntryDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/FolderSelectionDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/JARFileSelectionDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/JavadocAttributeConfiguration.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/JavadocLocationDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/JsGlobalScopeContainerDefaultPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/JsGlobalScopeContainerDescriptor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/JsGlobalScopeContainerSelectionPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/JsGlobalScopeContainerWizard.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/MultipleFolderSelectionDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/NewContainerDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/NewSourceFolderDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/ProjectsWorkbookPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/SetFilterWizardPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/SourceAttachmentDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/SourceContainerWorkbookPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/UserLibraryMarkerResolutionGenerator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/UserLibraryWizardPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/AddFolderToBuildpathAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/BuildpathModifierAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/ClasspathModifierDropDownAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/ClasspathModifierQueries.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/CreateLinkedSourceFolderAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/CreateLinkedSourceFolderAction2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/CreateSourceFolderAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/CreateSourceFolderAction2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/DialogPackageExplorer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/DialogPackageExplorerActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/EditFilterAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/ExcludeFromBuildpathAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/HelpAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/HintTextGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/IncludeToBuildpathAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/LinkFolderDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/NewSourceContainerWorkbookPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/RemoveFromBuildpathAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/RemoveLinkedFolderDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/ResetAllAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/CheckedListDialogField.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/ComboDialogField.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/DialogField.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/IDialogFieldListener.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/IListAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/IStringButtonAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/ITreeListAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/LayoutUtil.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/ListDialogField.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/ObjectStringStatusButtonDialogField.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/SelectionButtonDialogField.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/SelectionButtonDialogFieldGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/Separator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/StringButtonDialogField.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/StringButtonStatusDialogField.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/StringDialogField.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/TreeListDialogField.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/AbstractWorkingSetWizardPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/ClearWorkingSetAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/ConfigureWorkingSetAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/ConfigureWorkingSetAssignementAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/EditWorkingSetAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/EditorTracker.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/IWorkingSetActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/JavaWorkingSetElementAdapter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/JavaWorkingSetPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/JavaWorkingSetPageContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/JavaWorkingSetUpdater.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/Mementos.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/OpenPropertiesWorkingSetAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/OthersWorkingSetUpdater.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/RemoveWorkingSetElementAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/SelectWorkingSetAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/SimpleWorkingSetSelectionDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/ViewAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/ViewActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/WorkingSetConfigurationBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/WorkingSetConfigurationDialog.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/WorkingSetFilter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/WorkingSetFilterActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/WorkingSetMenuContributionItem.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/WorkingSetMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/WorkingSetMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/WorkingSetModel.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/workingsets/WorkingSetShowActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/libraries/BasicBrowserLibraryContainerUIExtension.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/libraries/internal_browser.gif create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/CodeGeneration.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/CodeStyleConfiguration.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/IContextMenuConstants.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/IDocumentationReader.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/IJavaScriptElementSearchConstants.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/IPackagesViewPart.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/ISharedImages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/ITypeHierarchyViewPart.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/IWorkingCopyManager.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/IWorkingCopyManagerExtension.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/IWorkingCopyProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JSdocContentAccess.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JavaElementSorter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JavaScriptElementComparator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JavaScriptElementImageDescriptor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JavaScriptElementLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JavaScriptElementLabels.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JavaScriptLibrariesAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JavaScriptSourceFoldersAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JavaScriptSuperTypeAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JavaScriptUI.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/Messages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/OverrideIndicatorLabelDecorator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/PreferenceConstants.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/ProblemsLabelDecorator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/ProjectLibraryRoot.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/StandardJavaScriptElementContentProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/AbstractOpenWizardAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/AddDelegateMethodsAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/AddGetterSetterAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/AddJavaDocStubAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/AddToClasspathAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/AddUnimplementedConstructorsAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/BuildActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/CCPActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/ChangeTypeAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/ConvertAnonymousToNestedAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/ConvertLocalToFieldAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/ConvertNestedToTopAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/ConvertingSelectionProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/CustomFiltersActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/DeclarationsSearchGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/ExternalizeStringsAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/ExtractConstantAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/ExtractMethodAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/ExtractTempAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindDeclarationsAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindDeclarationsInHierarchyAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindDeclarationsInProjectAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindDeclarationsInWorkingSetAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindExceptionOccurrencesAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindImplementOccurrencesAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindImplementorsAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindImplementorsInProjectAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindImplementorsInWorkingSetAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindOccurrencesInFileAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindReadReferencesAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindReadReferencesInHierarchyAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindReadReferencesInProjectAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindReadReferencesInWorkingSetAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindReferencesAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindReferencesInHierarchyAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindReferencesInProjectAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindReferencesInWorkingSetAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindWriteReferencesAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindWriteReferencesInHierarchyAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindWriteReferencesInProjectAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindWriteReferencesInWorkingSetAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FormatAllAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/GenerateActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/GenerateNewConstructorUsingFieldsAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/IJavaEditorActionDefinitionIds.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/ImplementorsSearchGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/ImportActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/InlineAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/InlineTempAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/IntroduceFactoryAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/IntroduceIndirectionAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/IntroduceParameterAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/JavaSearchActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/JdtActionConstants.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/MemberFilterActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/ModifyParametersAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/MoveAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/NavigateActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OccurrencesSearchGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenEditorActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenExternalJavadocAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenJavaPerspectiveAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenNewClassWizardAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenNewJavaProjectWizardAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenProjectAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenSuperImplementationAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenTypeHierarchyAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenViewActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OrganizeImportsAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OverrideMethodsAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/ProjectActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/PullUpAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/PushDownAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/ReadReferencesSearchGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/RefactorActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/ReferencesSearchGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/RefreshAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/RemoveFromClasspathAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/RenameAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/ReplaceInvocationsAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/SelectionDispatchAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/SelfEncapsulateFieldAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/ShowActionGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/ShowInNavigatorViewAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/ShowInPackageViewAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/SortMembersAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/SurroundWithTryCatchAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/UseSupertypeAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/WorkingSetFindAction.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/WriteReferencesSearchGroup.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/dialogs/ITypeInfoFilterExtension.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/dialogs/ITypeInfoImageProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/dialogs/ITypeInfoRequestor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/dialogs/ITypeSelectionComponent.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/dialogs/TypeSelectionExtension.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/messages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/project/JsNature.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/refactoring/IRefactoringProcessorIds.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/refactoring/RenameSupport.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/search/ElementQuerySpecification.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/search/IMatchPresentation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/search/IQueryParticipant.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/search/ISearchRequestor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/search/PatternQuerySpecification.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/search/QuerySpecification.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/IColorManager.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/IColorManagerExtension.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/IJavaScriptColorConstants.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/IJavaScriptPartitions.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/JavaScriptSourceViewerConfiguration.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/JavaScriptTextTools.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/folding/DefaultJavaFoldingStructureProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/folding/IJavaFoldingPreferenceBlock.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/folding/IJavaFoldingStructureProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/folding/IJavaFoldingStructureProviderExtension.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/java/AbstractProposalSorter.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/java/CompletionProposalCollector.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/java/CompletionProposalComparator.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/java/CompletionProposalLabelProvider.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/java/ContentAssistInvocationContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/java/IInvocationContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/java/IJavaCompletionProposal.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/java/IJavaCompletionProposalComputer.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/java/IJavadocCompletionProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/java/IProblemLocation.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/java/IQuickAssistProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/java/IQuickFixProcessor.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/java/JavaContentAssistInvocationContext.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/java/JavaTextMessages.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/java/JavaTextMessages.properties create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/java/hover/IJavaEditorTextHover.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/wizards/BaseLibraryWizardPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/wizards/BuildPathDialogAccess.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/wizards/ClasspathAttributeConfiguration.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/wizards/IJsGlobalScopeContainerPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/wizards/IJsGlobalScopeContainerPageExtension.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/wizards/IJsGlobalScopeContainerPageExtension2.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/wizards/JavaCapabilityConfigurationPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/wizards/NewClassWizardPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/wizards/NewContainerWizardPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/wizards/NewElementWizardPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/wizards/NewJavaProjectWizardPage.java create mode 100644 org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/wizards/NewTypeWizardPage.java create mode 100644 org.eclipse.wst.jsdt.ui/templates/default-codetemplates.xml create mode 100644 org.eclipse.wst.jsdt.ui/templates/default-templates.properties create mode 100644 org.eclipse.wst.jsdt.ui/templates/default-templates.xml create mode 100644 org.tizen.base.feature/rootfiles/resources/icons/tizen-ide.ico delete mode 100644 org.tizen.base.feature/rootfiles/resources/icons/tizen-sdk-ide.ico create mode 100755 org.tizen.base.feature/rootfiles_for_mac/startup.sh delete mode 100644 org.tizen.base.feature/rootfiles_for_windows/IDE.exe create mode 100644 org.tizen.base.feature/rootfiles_for_windows_x86/IDE.exe create mode 100644 org.tizen.base.feature/rootfiles_for_windows_x86_64/IDE.exe create mode 100644 org.tizen.base.platform/TizenIDE_base_macos.product delete mode 100644 org.tizen.base.platform/icons/launching/48_TIZEN_SDK_icon.xpm mode change 100755 => 100644 package/build.linux diff --git a/org.eclipse.cdt.mylyn.ui/.classpath b/org.eclipse.cdt.mylyn.ui/.classpath new file mode 100644 index 0000000..e721d0c --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.eclipse.cdt.mylyn.ui/.project b/org.eclipse.cdt.mylyn.ui/.project new file mode 100644 index 0000000..d6c138e --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/.project @@ -0,0 +1,28 @@ + + + org.eclipse.cdt.mylyn.ui + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.eclipse.cdt.mylyn.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.cdt.mylyn.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..af0f20f --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/org.eclipse.cdt.mylyn.ui/META-INF/MANIFEST.MF b/org.eclipse.cdt.mylyn.ui/META-INF/MANIFEST.MF new file mode 100644 index 0000000..835a5c1 --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/META-INF/MANIFEST.MF @@ -0,0 +1,167 @@ +Manifest-Version: 1.0 +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Built-By: hudsonbuild +Bundle-SymbolicName: org.eclipse.cdt.mylyn.ui;singleton:=true +Bundle-Activator: org.eclipse.mylyn.internal.cdt.ui.CDTUIBridgePlugin +Require-Bundle: org.eclipse.ui,org.eclipse.core.resources,org.eclipse. + core.runtime,org.eclipse.cdt.core;bundle-version="5.0.0",org.eclipse. + cdt.ui;bundle-version="5.0.0",org.eclipse.ui.views,org.eclipse.ui.ide + ,org.eclipse.mylyn.monitor.core;bundle-version="3.0.0",org.eclipse.my + lyn.commons.core;bundle-version="3.0.0",org.eclipse.mylyn.context.cor + e;bundle-version="3.0.0",org.eclipse.mylyn.context.ui;bundle-version= + "3.0.0",org.eclipse.mylyn.commons.ui;bundle-version="3.0.0",org.eclip + se.mylyn.monitor.ui;bundle-version="3.0.0",org.eclipse.jface.text,org + .eclipse.ui.editors;bundle-version="3.4.0" +Source-Control-Identifier: +Bundle-Version: 3.7.0.v20120319-0200_patch +Export-Package: org.eclipse.mylyn.internal.cdt.ui;x-internal:=true,org + .eclipse.mylyn.internal.cdt.ui.actions;x-internal:=true,org.eclipse.m + ylyn.internal.cdt.ui.contentassist;x-internal:=true,org.eclipse.mylyn + .internal.cdt.ui.editor;x-internal:=true +Build-Jdk: 1.6.0_21 +Bundle-Vendor: %Bundle-Vendor +Bundle-ActivationPolicy: lazy +Bundle-Name: %Bundle-Name +Archiver-Version: Plexus Archiver +Created-By: Apache Maven +Import-Package: com.ibm.icu.text +Bundle-ManifestVersion: 2 + +Name: org/eclipse/mylyn/internal/cdt/ui/CDTUIBridgePlugin$1.class +SHA1-Digest: c9+KNJd4hTospUt5nUmOaMxm358= + +Name: org/eclipse/mylyn/internal/cdt/ui/CDTUiBridge.class +SHA1-Digest: QgaLKzLBhnTTCgnsHKOPA9YRjXs= + +Name: org/eclipse/mylyn/internal/cdt/ui/actions/Messages.class +SHA1-Digest: mj4lYcXDfaK5YXzvuwOmlMwzVeA= + +Name: org/eclipse/mylyn/internal/cdt/ui/editor/ActiveFoldingEditorTrac + ker.class +SHA1-Digest: eiqgDDelxWD7gjqKvcpD77tISbQ= + +Name: org/eclipse/mylyn/internal/cdt/ui/contentassist/FocusedDOMComple + tionProposalComputer.class +SHA1-Digest: GX/mQyDwa+BKskAi+HvTdPI8CCk= + +Name: org/eclipse/mylyn/internal/cdt/ui/actions/messages.properties +SHA1-Digest: XMX2FvvALBnYVwkbdGOPReJYqGU= + +Name: icons/elcl16/focus-disabled.gif +SHA1-Digest: ZtE8BVkfK54SL+dSVXoGMOhAcOU= + +Name: org/eclipse/mylyn/internal/cdt/ui/CDTStructureBridge.class +SHA1-Digest: OIdCVkUeDeCAxEnWATQ4LkZbZPA= + +Name: plugin.properties +SHA1-Digest: PermpbM7ZaAC8FxGMu0CQQpLlrA= + +Name: org/eclipse/mylyn/internal/cdt/ui/contentassist/DOMCompletionPro + posalComputer.class +SHA1-Digest: 1UvimLueI/zfGBkP3fn49fnN8ZU= + +Name: org/eclipse/mylyn/internal/cdt/ui/CDTDeclarationsFilter.class +SHA1-Digest: +ujyfiDkWnfP9LCPN061/zGvCso= + +Name: icons/elcl16/proposals-other.gif +SHA1-Digest: lmuOOs1iqyAyQPLchn5trgOaGdM= + +Name: icons/elcl16/interest-increase.gif +SHA1-Digest: 5hGtFJVGeF5Pi18RlGp0ACNh/o4= + +Name: icons/elcl16/interest-folding.gif +SHA1-Digest: 51FXg0hC9+UdyEkPXpsJ8TxcNGY= + +Name: org/eclipse/mylyn/internal/cdt/ui/CDTContextLabelProvider.class +SHA1-Digest: 0Q2ZOnM8Jl78mV95zPnomuAgERI= + +Name: org/eclipse/mylyn/internal/cdt/ui/messages.properties +SHA1-Digest: lkYVurTM3qw4MCujBo+d6lqRqgg= + +Name: org/eclipse/mylyn/internal/cdt/ui/actions/ToggleActiveFoldingAct + ion.class +SHA1-Digest: apBu4s54/5Yk0fJjfqWhmtffndw= + +Name: plugin.xml +SHA1-Digest: Uzs4WiVxEto7OWoSp2XMHmc0veU= + +Name: org/eclipse/mylyn/internal/cdt/ui/contentassist/FocusedCProposal + Processor$FocusedProposalSeparator.class +SHA1-Digest: mBLEZ7h314rVece2rv8YQfJelXk= + +Name: org/eclipse/mylyn/internal/cdt/ui/editor/Messages.class +SHA1-Digest: qjYBsK1AikTGOtB8S6RiDE4MLZs= + +Name: org/eclipse/mylyn/internal/cdt/ui/CDTEditorMonitor.class +SHA1-Digest: rF4C96an0YVFLQSQ2bF8e1JhxqU= + +Name: META-INF/eclipse.inf +SHA1-Digest: 09gN05tobgS/MdtqyTNQhOhB73M= + +Name: org/eclipse/mylyn/internal/cdt/ui/contentassist/CDTContentAssist + Utils.class +SHA1-Digest: UTKQHsOjrYyns8JBqdnHQQ2mMXg= + +Name: icons/elcl16/focus.gif +SHA1-Digest: 51FXg0hC9+UdyEkPXpsJ8TxcNGY= + +Name: org/eclipse/mylyn/internal/cdt/ui/InterestUpdateDeltaListener.cl + ass +SHA1-Digest: 5bqCQB5LTFJC3IwJU0gC5EJdPyE= + +Name: org/eclipse/mylyn/internal/cdt/ui/LandmarkMarkerManager.class +SHA1-Digest: BMyeWAoF0LxGGCvdDHYTDVbh2aY= + +Name: about.html +SHA1-Digest: qRxCrhx2bqfpek8e2pDytN3lYdo= + +Name: org/eclipse/mylyn/internal/cdt/ui/editor/messages.properties +SHA1-Digest: 7/qrSKCYecZxMX2oFqMX1I8EgpM= + +Name: org/eclipse/mylyn/internal/cdt/ui/Messages.class +SHA1-Digest: 0o5nLH28GpjoGSOZeY/j97puMdc= + +Name: org/eclipse/mylyn/internal/cdt/ui/editor/ActiveFoldingListener.c + lass +SHA1-Digest: /O++XCWgSBwjvhxWTssMoi+eoIU= + +Name: icons/elcl16/interest-decrease.gif +SHA1-Digest: dXZozx3ae0SnCfzqoOkbTSqhoH8= + +Name: org/eclipse/mylyn/internal/cdt/ui/CDTUIBridgePlugin.class +SHA1-Digest: j9cfJmNawHgjMN5vNY+XJ1Sr3UY= + +Name: org/eclipse/mylyn/internal/cdt/ui/contentassist/CCompletionPropo + sal.class +SHA1-Digest: SKQYN3ynZBPe8WW1KJI4mnDt8y4= + +Name: org/eclipse/mylyn/internal/cdt/ui/InterestUpdateDeltaListener$1. + class +SHA1-Digest: URESX9gY2hwDdroVupjcZBVKHW8= + +Name: org/eclipse/mylyn/internal/cdt/ui/InterestUpdateDeltaListener$2. + class +SHA1-Digest: LTvUc5+5flyO1kT3/qQCwqjjDDk= + +Name: org/eclipse/mylyn/internal/cdt/ui/contentassist/FocusedCProposal + Processor.class +SHA1-Digest: 1/7TeDR7bb18I/ViAtSPEZWgU9k= + +Name: org/eclipse/mylyn/internal/cdt/ui/LandmarkMarkerManager$1.class +SHA1-Digest: KTIL6aH+jkZqkJd+lAkfZa2ZZdM= + +Name: org/eclipse/mylyn/internal/cdt/ui/LandmarkMarkerManager$2.class +SHA1-Digest: wAE6fztbdWpAdZ+wd6tVR41eN+s= + +Name: org/eclipse/mylyn/internal/cdt/ui/actions/FocusCViewAction.class +SHA1-Digest: ehYXrBwqEtwWi27OYq2m5qxGJKY= + +Name: org/eclipse/mylyn/internal/cdt/ui/editor/ActiveFoldingListener$1 + .class +SHA1-Digest: fgpXPoQsw9VT4ZryCGs6J6xdJxg= + +Name: org/eclipse/mylyn/internal/cdt/ui/editor/ActiveFoldingListener$2 + .class +SHA1-Digest: sucdG1hC/6qrjimhd+Mmfha9SQM= + diff --git a/org.eclipse.cdt.mylyn.ui/META-INF/eclipse.inf b/org.eclipse.cdt.mylyn.ui/META-INF/eclipse.inf new file mode 100644 index 0000000..92ffed2 --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/META-INF/eclipse.inf @@ -0,0 +1,2 @@ +#Processed using Jarprocessor +pack200.conditioned = true diff --git a/org.eclipse.cdt.mylyn.ui/about.html b/org.eclipse.cdt.mylyn.ui/about.html new file mode 100644 index 0000000..d7c5118 --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/about.html @@ -0,0 +1,24 @@ + + +About + + +

About This Content

+ +

June 22, 2007

+

License

+ +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

+ + \ No newline at end of file diff --git a/org.eclipse.cdt.mylyn.ui/build.properties b/org.eclipse.cdt.mylyn.ui/build.properties new file mode 100644 index 0000000..5fc5af2 --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/build.properties @@ -0,0 +1,7 @@ +source.. = src/ +bin.includes = META-INF/,\ + .,\ + icons/,\ + plugin.properties,\ + about.html,\ + plugin.xml diff --git a/org.eclipse.cdt.mylyn.ui/icons/elcl16/focus-disabled.gif b/org.eclipse.cdt.mylyn.ui/icons/elcl16/focus-disabled.gif new file mode 100644 index 0000000000000000000000000000000000000000..24bbeaebf2aa2e13b73360f830fa79e05a89ede4 GIT binary patch literal 354 zcmZ?wbhEHb6krfwxT?#rV#SJs2M^AlKmXLJQ+Mv%*}He|@#Dvj9656G5 z?C8;>hYlTDuwcQ12M?AkS#taK?Zbx;pE+~p+_`gm_UyTJ>(=`9>)*V2^ZNDc-Me=` ze*E~=t5=^te}3}h$%YLZZrr$W?b@}wckh1q@L}J+eLHsSc>46|vuDq~e*L(;IN|NlP&SwQh83nK%AE`tt8H^@&6Z1o4G6?o`K^}8Q>V4$GT+QQ7@ z6ft!kb933(oh!szTe~V8W-^P0Iv$PVSLQj)&@xj)snI6+#e@tqC3QtE6*(OpRu>s< zP6keGH6f8SNf&Jfj+qSFe9VkG$8#X+A_;B62b#LFkefsq2hYuefJa};L-n|toR($^a`ND+@*REZA z{`~oxHEUL`TzTozrTO#cpFMl_?%lgDUcC7K|33q9K=CIFBLjmGgAPbJ$WIJxO%5{) zJanY`-CYj`1}L<09Zy@lV8XoC)@e;$oJO5J4KEC4u> literal 0 HcmV?d00001 diff --git a/org.eclipse.cdt.mylyn.ui/icons/elcl16/interest-decrease.gif b/org.eclipse.cdt.mylyn.ui/icons/elcl16/interest-decrease.gif new file mode 100644 index 0000000000000000000000000000000000000000..645a58f6e855b6e3a67adc2ab2dbfdaaebc71b0b GIT binary patch literal 194 zcmZ?wbhEHb6krfwI3mUH`{lg7En+{<#{d4XWo?nrvTT8Wf8SfU#IDQ}+|?-d`(A5! zO3lYx%|BmE+0`hzrdViWh46|zfkQJDK3*=~Rx7%@QFKL~;I||iIU!c~Pk~uG9mRtXluGR%US5`+d9Z)f2~0ClEK5C8xG literal 0 HcmV?d00001 diff --git a/org.eclipse.cdt.mylyn.ui/icons/elcl16/interest-folding.gif b/org.eclipse.cdt.mylyn.ui/icons/elcl16/interest-folding.gif new file mode 100644 index 0000000000000000000000000000000000000000..bf8439c5259d53c86fe0a4c60365717cd247b2ef GIT binary patch literal 357 zcmZ?wbhEHb6krfwxN5|3Xy2i%xH;#~pWm`&OK07h{rmSXU%tGzWou=@()H`tU%7H+ z_wL8#X+A_;B62b#LFkefsq2hYuefJa};L-n|toR($^a`ND+@*REZA z{`~oxHEUL`TzTozrTO#cpFMl_?%lgDUcC7K|33q9K=CIFBLjmGgAPbJ$WIJxO%5{) zJanY`-CYj`1}L<09Zy@lV8XoC)@e;$oJO5J4KEC4u> literal 0 HcmV?d00001 diff --git a/org.eclipse.cdt.mylyn.ui/icons/elcl16/interest-increase.gif b/org.eclipse.cdt.mylyn.ui/icons/elcl16/interest-increase.gif new file mode 100644 index 0000000000000000000000000000000000000000..98a2586e6a5c48b14e90b45cd10dd8275457743a GIT binary patch literal 334 zcmZ?wbhEHb6krfwxT?qS`{lfqE3g0lu;u63_`NM+r%pZl_xJtUBB5p30xRu>$MTeWT5 z-Cd2MU%&qL_V)h&|33riK=CIFBLjmTgAPb5$WIJx*$&eSJW96q9bdHRXx6qVuFHhI zauQW0s)ydFGO@Xp+nre0(mj8Y;HH;z+S{kRxTJOC{<2US<$Wh*+Clc(<5vq-W%Ui6nqe3PgnZ`uu9E zY6@&OkdnU1$=^L}rempxy1UmWUYZ$FklNenFo|2h!QG#s$E~i?)70i-WTDQ_<*cpH z%go~xa6EQ*sL|5rxw_ZF!`!sB(|mrkmY2e^v(d=O;f#&Dm6ySlmcpH$#eRUal9Rwp zc&C$F9~-rwzfezI7b zT+Y_uva{8;x74ev(7C(TtggU+a#mC@gXr}e``KqkUx471SfwY;L!+U+O z=jZYH`uy42>)G1rYHX;yz1R2n`@O!~)z<0%|Nq+C?akHTwYS!;uhM~ovHSb{(bVR6 zd8Zy%kvWE5xw_V~wAOupv(L}t!^GUk$>6}j*{7+?batlL+332v*kom+u(8mhqsYd` z-#mz7%go@Ak-gq;cgrq0|Ns900000000000000000000000000A^8LW004LZEC2ui z01yBW000NgfOmp}c!dNM6aR192&007KwA`Mb5aYl>3osDW z&}o2X$P+V5(jeG~U + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTContextLabelProvider.java b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTContextLabelProvider.java new file mode 100644 index 0000000..edd3e73 --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTContextLabelProvider.java @@ -0,0 +1,107 @@ +/******************************************************************************* + * Copyright (c) 2004, 2009 Mylyn project committers and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +/* + * Created on Aug 6, 2004 + * Modified for CDT usage Feb 28, 2008 + */ +package org.eclipse.mylyn.internal.cdt.ui; + +import org.eclipse.cdt.core.model.ICElement; +import org.eclipse.cdt.internal.ui.viewsupport.AppearanceAwareLabelProvider; +import org.eclipse.cdt.internal.ui.viewsupport.CElementImageProvider; +import org.eclipse.cdt.internal.ui.viewsupport.ProblemsLabelDecorator; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.mylyn.commons.ui.CommonImages; +import org.eclipse.mylyn.context.core.IInteractionElement; +import org.eclipse.mylyn.context.core.IInteractionRelation; +import org.eclipse.mylyn.internal.context.core.InteractionContextManager; +import org.eclipse.swt.graphics.Image; + +/** + * @author Mik Kersten + * @author Jeff Johnston + * @author Shawn Minto + */ +public class CDTContextLabelProvider extends AppearanceAwareLabelProvider { + + public CDTContextLabelProvider() { + super(); + } + + @Override + public String getText(Object object) { + if (object instanceof IInteractionElement) { + IInteractionElement node = (IInteractionElement) object; + if (CDTStructureBridge.CONTENT_TYPE.equals(node.getContentType())) { + ICElement element = CDTStructureBridge.getElementForHandle(node.getHandleIdentifier()); + if (element == null) { + return Messages.CDTContextLabelProvider_Missing_Element; + } else { + return getTextForElement(element); + } + } + } else if (object instanceof IInteractionRelation) { + return getNameForRelationship(((IInteractionRelation) object).getRelationshipHandle()); + } else if (object instanceof ICElement) { + return getTextForElement((ICElement) object); + } + return super.getText(object); + } + + private String getTextForElement(ICElement element) { + if (element.exists()) { + return super.getText(element); + } else { + return Messages.CDTContextLabelProvider_Missing_Element; + } + } + + @Override + public Image getImage(Object object) { + if (object instanceof IInteractionElement) { + IInteractionElement node = (IInteractionElement) object; + if (node.getContentType().equals(CDTStructureBridge.CONTENT_TYPE)) { + ICElement element = CDTStructureBridge.getElementForHandle(node.getHandleIdentifier()); + if (element != null) { + return super.getImage(element); + } + return null; + } + } else if (object instanceof IInteractionRelation) { + ImageDescriptor descriptor = getIconForRelationship(((IInteractionRelation) object).getRelationshipHandle()); + if (descriptor != null) { + return CommonImages.getImage(descriptor); + } else { + return null; + } + } + return super.getImage(object); + } + + private ImageDescriptor getIconForRelationship(String relationshipHandle) { + // We have no relation providers for the CDT + return null; + } + + @SuppressWarnings("restriction") + private String getNameForRelationship(String relationshipHandle) { + if (relationshipHandle.equals(InteractionContextManager.CONTAINMENT_PROPAGATION_ID)) { + return Messages.CDTContextLabelProvider_Containment; + } else { + return null; + } + } + + public static AppearanceAwareLabelProvider createCDTUiLabelProvider() { + AppearanceAwareLabelProvider cdtUiLabelProvider = new AppearanceAwareLabelProvider( + AppearanceAwareLabelProvider.DEFAULT_TEXTFLAGS, AppearanceAwareLabelProvider.DEFAULT_IMAGEFLAGS + | CElementImageProvider.SMALL_ICONS); + cdtUiLabelProvider.addLabelDecorator(new ProblemsLabelDecorator(null)); + return cdtUiLabelProvider; + } +} diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTDeclarationsFilter.java b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTDeclarationsFilter.java new file mode 100644 index 0000000..b9d901a --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTDeclarationsFilter.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2004, 2009 Mylyn project committers and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ + +package org.eclipse.mylyn.internal.cdt.ui; + +import org.eclipse.cdt.core.model.IFunction; +import org.eclipse.cdt.core.model.IMethod; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerFilter; + +/** + * @author Mik Kersten + * @author Jeff Johnston + */ +public class CDTDeclarationsFilter extends ViewerFilter { + + @Override + public boolean select(Viewer viewer, Object parent, Object element) { + return !((element instanceof IMethod || element instanceof IFunction)); + } + +} diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTEditorMonitor.java b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTEditorMonitor.java new file mode 100644 index 0000000..f4a51ce --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTEditorMonitor.java @@ -0,0 +1,114 @@ +/******************************************************************************* + * Copyright (c) 2004, 2009 Mylyn project committers and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ + +package org.eclipse.mylyn.internal.cdt.ui; + +import java.util.Iterator; + +import org.eclipse.cdt.core.model.CModelException; +import org.eclipse.cdt.core.model.IBinary; +import org.eclipse.cdt.core.model.ICElement; +import org.eclipse.cdt.internal.ui.actions.SelectionConverter; +import org.eclipse.cdt.internal.ui.editor.CEditor; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.mylyn.monitor.ui.AbstractUserInteractionMonitor; +import org.eclipse.ui.IWorkbenchPart; + +/** + * @author Mik Kersten + * @author Jeff Johnston + */ +public class CDTEditorMonitor extends AbstractUserInteractionMonitor { + + protected ICElement lastSelectedElement = null; + + protected ICElement lastResolvedElement = null; + + protected CEditor currentEditor; + + protected StructuredSelection currentSelection = null; + + public CDTEditorMonitor() { + super(); + } + + /** + * Only public for testing + */ + @Override + public void handleWorkbenchPartSelection(IWorkbenchPart part, ISelection selection, boolean contributeToContext) { + try { + ICElement selectedElement = null; + if (selection instanceof StructuredSelection) { + StructuredSelection structuredSelection = (StructuredSelection) selection; + + if (structuredSelection.equals(currentSelection)) { + return; + } + currentSelection = structuredSelection; + + // Object selectedObject = + // structuredSelection.getFirstElement(); + for (Iterator iterator = structuredSelection.iterator(); iterator.hasNext();) { + Object selectedObject = iterator.next(); + if (selectedObject instanceof ICElement) { + ICElement checkedElement = checkIfAcceptedAndPromoteIfNecessary((ICElement) selectedObject); + if (checkedElement == null) { + return; + } else { + selectedElement = checkedElement; + } + } + if (selectedElement != null) { + super.handleElementSelection(part, selectedElement, contributeToContext); + } + } + } else { + if (part instanceof CEditor) { + currentEditor = (CEditor) part; + selectedElement = SelectionConverter.getElementAtOffset(currentEditor); + if (selectedElement == null) { + return; // nothing selected + } + + if (selectedElement != null) { + if (selectedElement.equals(lastSelectedElement)) { + super.handleElementEdit(part, selectedElement, contributeToContext); + } else if (!selectedElement.equals(lastSelectedElement)) { + super.handleElementSelection(part, selectedElement, contributeToContext); + } + } + + ICElement checkedElement = checkIfAcceptedAndPromoteIfNecessary(selectedElement); + if (checkedElement == null) { + return; + } else { + selectedElement = checkedElement; + } + } + } + if (selectedElement != null) { + lastSelectedElement = selectedElement; + } + } catch (CModelException e) { + // ignore, fine to fail to resolve an element if the model is not + // up-to-date + } + } + + /** + * @return null for elements that aren't modeled + */ + protected ICElement checkIfAcceptedAndPromoteIfNecessary(ICElement element) { + if (!(element instanceof IBinary)) { + return element; + } + return null; + } +} diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTStructureBridge.java b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTStructureBridge.java new file mode 100644 index 0000000..6d87400 --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTStructureBridge.java @@ -0,0 +1,344 @@ +/******************************************************************************* + * Copyright (c) 2004, 2009 Mylyn project committers and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.eclipse.mylyn.internal.cdt.ui; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.eclipse.cdt.core.model.CModelException; +import org.eclipse.cdt.core.model.CoreModel; +import org.eclipse.cdt.core.model.IBinary; +import org.eclipse.cdt.core.model.ICElement; +import org.eclipse.cdt.core.model.ICProject; +import org.eclipse.cdt.core.model.IFunction; +import org.eclipse.cdt.core.model.IInclude; +import org.eclipse.cdt.core.model.IMethod; +import org.eclipse.cdt.core.model.IParent; +import org.eclipse.cdt.core.model.ISourceReference; +import org.eclipse.cdt.core.model.ITranslationUnit; +import org.eclipse.cdt.ui.CElementGrouping; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.mylyn.context.core.AbstractContextStructureBridge; +import org.eclipse.mylyn.context.core.ContextCore; +import org.eclipse.mylyn.context.core.IInteractionElement; +import org.eclipse.ui.IWorkingSet; +import org.eclipse.ui.views.markers.internal.ConcreteMarker; + +/** + * @author Mik Kersten + * @author Jeff Johnston + */ +public class CDTStructureBridge extends AbstractContextStructureBridge { + + public final static String CONTENT_TYPE = "c/c++"; //$NON-NLS-1$ + + public final static int C_SOURCEROOT = 1000; + + public CDTStructureBridge() { + } + + @Override + public String getContentType() { + return CONTENT_TYPE; + } + + @Override + public Object getAdaptedParent(Object object) { + if (object instanceof IFile) { + IFile file = (IFile) object; + return CoreModel.getDefault().create(file.getParent()); + } else { + return super.getAdaptedParent(object); + } + } + + @Override + public String getParentHandle(String handle) { + ICElement cElement = (ICElement) getObjectForHandle(handle); + if (cElement != null && cElement.getParent() != null) { + return getHandleForElement(cElement.getParent()); + } else { + return null; + } + } + + @Override + public List getChildHandles(String handle) { + Object object = getObjectForHandle(handle); + if (object instanceof ICElement) { + ICElement element = (ICElement) object; + if (element instanceof IParent) { + IParent parent = (IParent) element; + ICElement[] children; + try { + children = parent.getChildren(); + List childHandles = new ArrayList(); + for (ICElement element2 : children) { + String childHandle = getHandleIdentifier(element2); + if (childHandle != null) { + childHandles.add(childHandle); + } + } + AbstractContextStructureBridge parentBridge = ContextCore.getStructureBridge(parentContentType); + if (parentBridge != null && ContextCore.CONTENT_TYPE_RESOURCE.equals(parentBridge.getContentType())) { + // TODO: Make sure line below is correct + if (element.getElementType() < ICElement.C_NAMESPACE) { + List resourceChildren = parentBridge.getChildHandles(handle); + if (!resourceChildren.isEmpty()) { + childHandles.addAll(resourceChildren); + } + } + } + + return childHandles; + } catch (CModelException e) { + // ignore these, usually indicate no-existent element + } + } + } + return Collections.emptyList(); + } + + public static ICElement getElementForHandle(String handle) { + return CoreModel.create(handle); + } + + @Override + public Object getObjectForHandle(String handle) { + return getElementForHandle(handle); + } + + // In the CDT, an ICElement does not have a handle interface like a + // JavaElement. So, to find an element again, we save its CProject name, + // plus its path, plus its element name. The CProject name allows us + // to find the CProject. The path allows us to find the ITranslationUnit. + // The element name (optional) allows us to find an element within the + // TranslationUnit. + public static String getHandleForElement(ICElement element) { + String handle = element.getHandleIdentifier(); + if (handle != null && !(element instanceof ICProject)) { + ICProject cProject = element.getCProject(); + if (cProject != null) { + String projectHandle = getHandleForElement(cProject); + if (handle.equals(projectHandle)) { + // see bug 328300 + return null; + } + } + } + return handle; + } + + /** + * Uses resource-compatible path for projects + */ + @Override + public String getHandleIdentifier(Object object) { + if (object instanceof ICElement) { + return getHandleForElement((ICElement) object); + } else { + if (object instanceof IAdaptable) { + Object adapter = ((IAdaptable) object).getAdapter(ICElement.class); + if (adapter instanceof ICElement) { + return getHandleForElement((ICElement) adapter); + } + } + } + return null; + } + + @Override + public String getLabel(Object object) { + if (object instanceof ICElement) { + return ((ICElement) object).getElementName(); + } else { + return ""; //$NON-NLS-1$ + } + } + + @Override + public boolean canBeLandmark(String handle) { + ICElement element = (ICElement) getObjectForHandle(handle); + if ((element instanceof IMethod || element instanceof IFunction) && element.exists()) { + return true; + } else { + return false; + } + } + + /** + * TODO: figure out if the non ICElement stuff is needed + */ + @Override + public boolean acceptsObject(Object object) { + if (object instanceof IResource) { + object = ((IResource) object).getAdapter(ICElement.class); + } + + boolean accepts = (object instanceof ICElement && !(object instanceof IBinary)) + || object instanceof IWorkingSet || object instanceof CElementGrouping; + + return accepts; + } + + @Override + public boolean canFilter(Object object) { + if (object instanceof IWorkingSet) { + try { + IWorkingSet workingSet = (IWorkingSet) object; + IAdaptable[] elements = workingSet.getElements(); + for (IAdaptable adaptable : elements) { + IInteractionElement element = ContextCore.getContextManager().getElement( + getHandleIdentifier(adaptable)); + if (element.getInterest().isInteresting()) { + return false; + } + } + } catch (Exception e) { + return false; + } + } else if (object instanceof CElementGrouping) { + try { + CElementGrouping grouping = (CElementGrouping) object; + Object[] elements = grouping.getChildren(grouping); + if (elements != null) { + for (Object adaptable : elements) { + IInteractionElement element = ContextCore.getContextManager().getElement( + getHandleIdentifier(adaptable)); + if (element != null && element.getInterest().isInteresting()) { + return false; + } + } + } + } catch (Exception e) { + return false; + } + } + return true; + } + + @Override + public boolean isDocument(String handle) { + ICElement element = (ICElement) getObjectForHandle(handle); + return element instanceof ITranslationUnit; + } + + @Override + public String getHandleForOffsetInObject(Object object, int offset) { + IMarker marker; + int charStart = 0; + if (object instanceof ConcreteMarker) { + marker = ((ConcreteMarker) object).getMarker(); + } + if (object instanceof IMarker) { + marker = (IMarker) object; + } else { + return null; + } + + Object attribute = marker.getAttribute(IMarker.CHAR_START, 0); + if (attribute instanceof Integer) { + charStart = ((Integer) attribute).intValue(); + } + + try { + ITranslationUnit translationUnit = null; + IResource resource = marker.getResource(); + if (resource instanceof IFile) { + IFile file = (IFile) resource; + if (CoreModel.isValidTranslationUnitName(null, file.getName())) { + ICElement element = CoreModel.getDefault().create(file); + translationUnit = CoreModel.getDefault().createTranslationUnitFrom(element.getCProject(), + element.getPath()); + } else { + return null; + } + } + if (translationUnit != null) { + ICElement cElement = translationUnit.getElementAtOffset(charStart); + if (cElement != null) { + if (cElement instanceof IInclude) { + cElement = cElement.getParent().getParent(); + } + return cElement.getElementName(); + } else { + return null; + } + } else { + return null; + } + } catch (CModelException e) { + return null; + } + } + + @Override + public String getContentType(String elementHandle) { + return getContentType(); + } + + /** + * Some copying from: + * + * @see org.eclipse.jdt.ui.ProblemsLabelDecorator + */ + public boolean containsProblem(IInteractionElement node) { + try { + ICElement element = (ICElement) getObjectForHandle(node.getHandleIdentifier()); + switch (element.getElementType()) { + case ICElement.C_PROJECT: + case ICElement.C_CCONTAINER: + case ICElement.C_VCONTAINER: + return getErrorTicksFromMarkers(element.getResource(), IResource.DEPTH_INFINITE, null); + case ICElement.C_UNIT: + return getErrorTicksFromMarkers(element.getResource(), IResource.DEPTH_ONE, null); + case ICElement.C_USING: + case ICElement.C_NAMESPACE: + case ICElement.C_INCLUDE: + case ICElement.C_TYPEDEF: + case ICElement.C_MACRO: + case ICElement.C_FUNCTION: + case ICElement.C_METHOD: + case ICElement.C_FIELD: + case ICElement.C_VARIABLE_LOCAL: + case ICElement.C_CLASS: + ITranslationUnit cu = (ITranslationUnit) element.getAncestor(ICElement.C_UNIT); + if (cu != null) { + return getErrorTicksFromMarkers(element.getResource(), IResource.DEPTH_ONE, null); + } + } + } catch (CoreException e) { + // ignore + } + return false; + } + + private boolean getErrorTicksFromMarkers(IResource res, int depth, ISourceReference sourceElement) + throws CoreException { + if (res == null || !res.isAccessible()) { + return false; + } + IMarker[] markers = res.findMarkers(IMarker.PROBLEM, true, depth); + if (markers != null) { + for (IMarker curr : markers) { + if (sourceElement == null) { + int priority = curr.getAttribute(IMarker.SEVERITY, -1); + if (priority == IMarker.SEVERITY_ERROR) { + return true; + } + } + } + } + return false; + } +} diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTUIBridgePlugin.java b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTUIBridgePlugin.java new file mode 100644 index 0000000..4f985fe --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTUIBridgePlugin.java @@ -0,0 +1,150 @@ +/******************************************************************************* + * Copyright (c) 2004, 2009 Mylyn project committers and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Red Hat Inc. - modification from Java to CDT + *******************************************************************************/ +package org.eclipse.mylyn.internal.cdt.ui; + +import org.eclipse.cdt.core.model.CoreModel; +import org.eclipse.cdt.internal.ui.editor.CEditor; +import org.eclipse.cdt.ui.CUIPlugin; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.mylyn.context.core.ContextCore; +import org.eclipse.mylyn.context.ui.IContextUiStartup; +import org.eclipse.mylyn.internal.cdt.ui.contentassist.CDTContentAssistUtils; +import org.eclipse.mylyn.internal.cdt.ui.editor.ActiveFoldingEditorTracker; +import org.eclipse.mylyn.internal.cdt.ui.editor.ActiveFoldingListener; +import org.eclipse.mylyn.monitor.ui.MonitorUi; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IEditorReference; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.eclipse.ui.progress.UIJob; +import org.osgi.framework.BundleContext; + +/** + * @author Mik Kersten + * @author Jeff Johnston + */ +public class CDTUIBridgePlugin extends AbstractUIPlugin implements IContextUiStartup { + + // TODO CHANGE plugin id? + public static final String ID_PLUGIN = "org.eclipse.cdt.mylyn.ui"; //$NON-NLS-1$ + + public static final String AUTO_FOLDING_ENABLED = "org.eclipse.mylyn.context.ui.editor.folding.enabled"; //$NON-NLS-1$ + + private static final String MYLYN_RUN_COUNT = "org.eclipse.mylyn.cdt.ui.run.count.3_3_0"; //$NON-NLS-1$ + + private static CDTUIBridgePlugin INSTANCE; + + private final LandmarkMarkerManager landmarkMarkerManager = new LandmarkMarkerManager(); + + private CDTEditorMonitor cEditingMonitor; + + private final InterestUpdateDeltaListener cElementChangeListener = new InterestUpdateDeltaListener(); + + private ActiveFoldingEditorTracker activeFoldingEditorTracker; + + public CDTUIBridgePlugin() { + super(); + } + + /** + * Startup order is critical. + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + INSTANCE = this; + initializeContentAssist(); + } + + public void lazyStartup() { + + // TODO do in a UI JOB? and only on first run + installFoldingEditorTracker(PlatformUI.getWorkbench()); + + ContextCore.getContextManager().addListener(landmarkMarkerManager); + cEditingMonitor = new CDTEditorMonitor(); + MonitorUi.getSelectionMonitors().add(cEditingMonitor); + CoreModel.getDefault().addElementChangedListener(cElementChangeListener); + + } + + private void lazyStop() { + ContextCore.getContextManager().removeListener(landmarkMarkerManager); + MonitorUi.getSelectionMonitors().remove(cEditingMonitor); + CoreModel.getDefault().removeElementChangedListener(cElementChangeListener); + uninstallFoldingEditorTracker(PlatformUI.getWorkbench()); + } + + @Override + public void stop(BundleContext context) throws Exception { + lazyStop(); + super.stop(context); + INSTANCE = null; + } + + private void initializeContentAssist() { + + int count = getPreferenceStore().getInt(MYLYN_RUN_COUNT); + if (count < 1) { + getPreferenceStore().setValue(MYLYN_RUN_COUNT, count + 1); + + new UIJob(Messages.CDTUIBridgePlugin_Initializing_Content_Assist) { + @Override + public IStatus runInUIThread(IProgressMonitor monitor) { + CDTContentAssistUtils.installContentAssist(CUIPlugin.getDefault().getPreferenceStore(), true); + return Status.OK_STATUS; + } + }.schedule(); + } + + CDTContentAssistUtils.updateDefaultPreference(CUIPlugin.getDefault().getPreferenceStore()); + } + + private void uninstallFoldingEditorTracker(IWorkbench workbench) { + if (activeFoldingEditorTracker != null) { + activeFoldingEditorTracker.dispose(workbench); + activeFoldingEditorTracker = null; + } + } + + private void installFoldingEditorTracker(IWorkbench workbench) { + activeFoldingEditorTracker = new ActiveFoldingEditorTracker(); + activeFoldingEditorTracker.install(workbench); + + // update editors that are already opened + for (IWorkbenchWindow w : PlatformUI.getWorkbench().getWorkbenchWindows()) { + IWorkbenchPage page = w.getActivePage(); + if (page != null) { + IEditorReference[] references = page.getEditorReferences(); + for (IEditorReference reference : references) { + IEditorPart part = reference.getEditor(false); + if (part != null && part instanceof CEditor) { + CEditor editor = (CEditor) part; + activeFoldingEditorTracker.registerEditor(editor); + ActiveFoldingListener.resetProjection(editor); + } + } + } + } + } + + /** + * Returns the shared instance. + */ + public static CDTUIBridgePlugin getDefault() { + return INSTANCE; + } +} diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTUiBridge.java b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTUiBridge.java new file mode 100644 index 0000000..4774bfa --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/CDTUiBridge.java @@ -0,0 +1,164 @@ +/******************************************************************************* + * Copyright (c) 2004, 2009 Mylyn project committers and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Red Hat Inc. - Initial implementation based on JavaUiBridge + *******************************************************************************/ + +package org.eclipse.mylyn.internal.cdt.ui; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.cdt.core.model.CModelException; +import org.eclipse.cdt.core.model.ICElement; +import org.eclipse.cdt.internal.ui.actions.SelectionConverter; +import org.eclipse.cdt.internal.ui.editor.AbstractCModelOutlinePage; +import org.eclipse.cdt.internal.ui.editor.CContentOutlinePage; +import org.eclipse.cdt.internal.ui.editor.CEditor; +import org.eclipse.cdt.internal.ui.util.EditorUtility; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.jface.text.TextSelection; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.mylyn.commons.core.StatusHandler; +import org.eclipse.mylyn.context.core.ContextCore; +import org.eclipse.mylyn.context.core.IInteractionElement; +import org.eclipse.mylyn.context.ui.AbstractContextUiBridge; +import org.eclipse.osgi.util.NLS; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IEditorReference; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.views.contentoutline.IContentOutlinePage; + +/** + * @author Mik Kersten + * @author Jeff Johnston + * @author Shawn Minto + */ +public class CDTUiBridge extends AbstractContextUiBridge { + + private Field cOutlineField = null; + + public CDTUiBridge() { + try { + cOutlineField = AbstractCModelOutlinePage.class.getDeclaredField("fTreeViewer"); //$NON-NLS-1$ + cOutlineField.setAccessible(true); + } catch (Exception e) { + StatusHandler.log(new Status(IStatus.ERROR, CDTUIBridgePlugin.ID_PLUGIN, + "Unexpected error while focusing outline viewer", e)); //$NON-NLS-1$ + } + } + + @Override + public void open(IInteractionElement node) { + try { + ICElement cElement = CDTStructureBridge.getElementForHandle(node.getHandleIdentifier()); + if (cElement == null || !cElement.exists()) { + return; + } + EditorUtility.openInEditor(cElement); + } catch (CModelException t) { + StatusHandler.log(new Status(IStatus.ERROR, CDTUIBridgePlugin.ID_PLUGIN, NLS.bind( + "Failed to open editor for: {0}", node.getHandleIdentifier()), t)); //$NON-NLS-1$ + } catch (PartInitException t) { + StatusHandler.log(new Status(IStatus.ERROR, CDTUIBridgePlugin.ID_PLUGIN, NLS.bind( + "Failed to open editor for: {0}", node.getHandleIdentifier()), t)); //$NON-NLS-1$ + } + } + + @Override + public void close(IInteractionElement node) { + IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + if (page != null) { + List toClose = new ArrayList(4); + for (IEditorReference reference : page.getEditorReferences()) { + try { + ICElement input = (ICElement) reference.getEditorInput().getAdapter(ICElement.class); + if (input != null + && node.getHandleIdentifier().equals(CDTStructureBridge.getHandleForElement(input))) { + toClose.add(reference); + } + } catch (PartInitException e) { + // ignore + } + } + if (toClose.size() > 0) { + page.closeEditors(toClose.toArray(new IEditorReference[toClose.size()]), true); + } + } + + } + + @Override + public boolean acceptsEditor(IEditorPart editorPart) { + return editorPart instanceof CEditor; + } + + @Override + public IInteractionElement getElement(IEditorInput input) { + Object adapter = input.getAdapter(ICElement.class); + if (adapter instanceof ICElement) { + ICElement cElement = (ICElement) adapter; + String handle = ContextCore.getStructureBridge(cElement).getHandleIdentifier(cElement); + return ContextCore.getContextManager().getElement(handle); + } else { + return null; + } + } + + @Override + public List getContentOutlineViewers(IEditorPart editorPart) { + if (editorPart == null || cOutlineField == null) { + return null; + } + List viewers = new ArrayList(); + Object out = editorPart.getAdapter(IContentOutlinePage.class); + if (out instanceof CContentOutlinePage) { + CContentOutlinePage page = (CContentOutlinePage) out; + if (page.getControl() != null) { + try { + viewers.add((TreeViewer) cOutlineField.get(page)); + } catch (Exception e) { + StatusHandler.log(new Status(IStatus.ERROR, CDTUIBridgePlugin.ID_PLUGIN, + "Could not get Outline viewer.", e)); //$NON-NLS-1$ + } + } + } + return viewers; + } + + @Override + public Object getObjectForTextSelection(TextSelection selection, IEditorPart editor) { + if (editor instanceof CEditor) { + TextSelection textSelection = selection; + try { + if (selection != null) { + return SelectionConverter.getElementAtOffset(((CEditor) editor).getInputCElement(), textSelection); + } else { + Object element = ((CEditor) editor).getInputCElement(); + if (element instanceof ICElement) { + return element; + } + } + } catch (CModelException e) { + // ignore + } + } + return null; + } + + @Override + public String getContentType() { + return CDTStructureBridge.CONTENT_TYPE; + } + +} diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/InterestUpdateDeltaListener.java b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/InterestUpdateDeltaListener.java new file mode 100644 index 0000000..dbe5583 --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/InterestUpdateDeltaListener.java @@ -0,0 +1,121 @@ +/******************************************************************************* + * Copyright (c) 2004, 2009 Mylyn project committers and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ + +package org.eclipse.mylyn.internal.cdt.ui; + +import org.eclipse.cdt.core.model.ElementChangedEvent; +import org.eclipse.cdt.core.model.ICElement; +import org.eclipse.cdt.core.model.ICElementDelta; +import org.eclipse.cdt.core.model.IElementChangedListener; +import org.eclipse.cdt.core.model.ITranslationUnit; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.mylyn.commons.core.StatusHandler; +import org.eclipse.mylyn.context.core.ContextCore; +import org.eclipse.mylyn.context.core.IInteractionElement; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.PlatformUI; + +/** + * @author Mik Kersten + * @author Jeff Johnston + */ +public class InterestUpdateDeltaListener implements IElementChangedListener { + + private static boolean asyncExecMode = true; + + public void elementChanged(ElementChangedEvent event) { + ICElementDelta delta = event.getDelta(); + handleDelta(delta.getAffectedChildren()); + } + + /** + * Only handles first addition/removal + */ + private void handleDelta(ICElementDelta[] delta) { + try { + ICElement added = null; + ICElement removed = null; + for (ICElementDelta child : delta) { + if (child.getElement() instanceof ITranslationUnit) { + // FIXME: not sure I modified this correctly from the java version + if (((ITranslationUnit) child.getElement()).getParent() != null) { + // see bug 195361, do not reduce interest of temporary working copy + return; + } + } + + if (child.getKind() == ICElementDelta.ADDED) { + if (added == null) { + added = child.getElement(); + } + } else if (child.getKind() == ICElementDelta.REMOVED) { + if (removed == null) { + removed = child.getElement(); + } + } + handleDelta(child.getAffectedChildren()); + } + + if (added != null && removed != null) { + IInteractionElement element = ContextCore.getContextManager().getElement( + CDTStructureBridge.getHandleForElement(removed)); + if (element != null) { + resetHandle(element, CDTStructureBridge.getHandleForElement(added)); + } + } else if (removed != null) { + + IInteractionElement element = ContextCore.getContextManager().getElement( + CDTStructureBridge.getHandleForElement(removed)); + if (element != null) { + delete(element); + } + } + } catch (Throwable t) { + StatusHandler.log(new Status(IStatus.ERROR, CDTUIBridgePlugin.ID_PLUGIN, + "Unexpected error while updating interest", t)); //$NON-NLS-1$ + } + } + + private void resetHandle(final IInteractionElement element, final String newHandle) { + if (!asyncExecMode) { + ContextCore.getContextManager().updateHandle(element, newHandle); + } else { + IWorkbench workbench = PlatformUI.getWorkbench(); + if (workbench != null) { + workbench.getDisplay().asyncExec(new Runnable() { + public void run() { + ContextCore.getContextManager().updateHandle(element, newHandle); + } + }); + } + } + } + + private void delete(final IInteractionElement element) { + if (!asyncExecMode) { + ContextCore.getContextManager().deleteElement(element); + } else { + IWorkbench workbench = PlatformUI.getWorkbench(); + if (workbench != null) { + workbench.getDisplay().asyncExec(new Runnable() { + public void run() { + ContextCore.getContextManager().deleteElement(element); + } + }); + } + } + } + + /** + * For testing + */ + public static void setAsyncExecMode(boolean asyncExecMode) { + InterestUpdateDeltaListener.asyncExecMode = asyncExecMode; + } +} diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/LandmarkMarkerManager.java b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/LandmarkMarkerManager.java new file mode 100644 index 0000000..db185cd --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/LandmarkMarkerManager.java @@ -0,0 +1,182 @@ +/******************************************************************************* + * Copyright (c) 2004, 2010 Mylyn project committers and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +/* + * Created on Feb 16, 2005 + */ +package org.eclipse.mylyn.internal.cdt.ui; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.cdt.core.model.CModelException; +import org.eclipse.cdt.core.model.ICElement; +import org.eclipse.cdt.core.model.IFunction; +import org.eclipse.cdt.core.model.IMethod; +import org.eclipse.cdt.core.model.ISourceRange; +import org.eclipse.cdt.core.model.ISourceReference; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IWorkspaceRunnable; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.mylyn.commons.core.StatusHandler; +import org.eclipse.mylyn.context.core.AbstractContextListener; +import org.eclipse.mylyn.context.core.ContextChangeEvent; +import org.eclipse.mylyn.context.core.ContextCore; +import org.eclipse.mylyn.context.core.IInteractionElement; + +/** + * @author Mik Kersten + * @author Jeff Johnston + */ +public class LandmarkMarkerManager extends AbstractContextListener { + + private static final String ID_MARKER_LANDMARK = "org.eclipse.mylyn.context.ui.markers.landmark"; //$NON-NLS-1$ + + private final Map markerMap = new HashMap(); + + public LandmarkMarkerManager() { + super(); + } + + @Override + public void contextChanged(ContextChangeEvent event) { + switch (event.getEventKind()) { + case PRE_ACTIVATED: + break; + case ACTIVATED: + modelUpdated(); + break; + case DEACTIVATED: + modelUpdated(); + break; + case CLEARED: + modelUpdated(); + break; + case INTEREST_CHANGED: + break; + case LANDMARKS_ADDED: + for (IInteractionElement element : event.getElements()) { + addedLandmark(element); + } + break; + case LANDMARKS_REMOVED: + for (IInteractionElement element : event.getElements()) { + removedLandmark(element); + } + break; + case ELEMENTS_DELETED: + break; + } + } + + private void modelUpdated() { + for (IInteractionElement node : markerMap.keySet()) { + removedLandmark(node); + } + markerMap.clear(); + for (IInteractionElement node : ContextCore.getContextManager().getActiveLandmarks()) { + addedLandmark(node); + } + } + + private void addedLandmark(final IInteractionElement node) { + if (node == null || node.getContentType() == null) { + return; + } + if (node.getContentType().equals(CDTStructureBridge.CONTENT_TYPE)) { + final ICElement element = CDTStructureBridge.getElementForHandle(node.getHandleIdentifier()); + if (element == null || !element.exists()) { + return; + } + if (element instanceof IMethod || element instanceof IFunction) { + try { + final ISourceRange range = ((ISourceReference) element).getSourceRange(); + final IResource resource = element.getUnderlyingResource(); + if (resource instanceof IFile) { + IWorkspaceRunnable runnable = new IWorkspaceRunnable() { + public void run(IProgressMonitor monitor) throws CoreException { + IMarker marker = resource.createMarker(ID_MARKER_LANDMARK); + if (marker != null && range != null) { + marker.setAttribute(IMarker.CHAR_START, range.getStartPos()); + marker.setAttribute(IMarker.CHAR_END, range.getStartPos() + range.getLength()); + marker.setAttribute(IMarker.MESSAGE, Messages.LandmarkMarkerManager_Mylyn_Landmark); + marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO); + markerMap.put(node, marker.getId()); + } + } + }; + resource.getWorkspace().run(runnable, null); + } + } catch (CModelException e) { + StatusHandler.log(new Status(IStatus.ERROR, CDTUIBridgePlugin.ID_PLUGIN, + "Unexpected error while updating landmark markers", e)); //$NON-NLS-1$ + } catch (CoreException e) { + StatusHandler.log(new Status(IStatus.ERROR, CDTUIBridgePlugin.ID_PLUGIN, + "Unexpected error while updating landmark markers", e)); //$NON-NLS-1$ + } + } + } + } + + private void removedLandmark(final IInteractionElement node) { + if (node == null) { + return; + } + if (node.getContentType().equals(CDTStructureBridge.CONTENT_TYPE)) { + ICElement element = CDTStructureBridge.getElementForHandle(node.getHandleIdentifier()); + if (element == null || !element.exists()) { + return; + } + if (element.getAncestor(ICElement.C_UNIT) != null // stuff + // from + // .class + // files + && element instanceof ISourceReference) { + try { + final IResource resource = element.getUnderlyingResource(); + IWorkspaceRunnable runnable = new IWorkspaceRunnable() { + public void run(IProgressMonitor monitor) throws CoreException { + if (resource != null) { + try { + if (markerMap.containsKey(node)) { + long id = markerMap.get(node); + IMarker marker = resource.getMarker(id); + if (marker != null) { + marker.delete(); + } + } + } catch (NullPointerException e) { + StatusHandler.log(new Status(IStatus.ERROR, CDTUIBridgePlugin.ID_PLUGIN, + "Could not update markers.", e)); //$NON-NLS-1$ + } + } + } + }; + resource.getWorkspace().run(runnable, null); + } catch (CModelException e) { + // ignore the Java Model errors + } catch (CoreException e) { + StatusHandler.log(new Status(IStatus.ERROR, CDTUIBridgePlugin.ID_PLUGIN, + "could not update landmark markers", e)); //$NON-NLS-1$ + } + } + } + } + + public void relationsChanged(IInteractionElement node) { + // don't care when the relationships changed + } + + public void elementDeleted(IInteractionElement node) { + // don't care when a node is deleted + } +} diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/Messages.java b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/Messages.java new file mode 100644 index 0000000..ef9a246 --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/Messages.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2009 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.internal.cdt.ui; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.cdt.ui.messages"; //$NON-NLS-1$ + + public static String CDTContextLabelProvider_Containment; + + public static String CDTContextLabelProvider_Missing_Element; + + public static String CDTUIBridgePlugin_Initializing_Content_Assist; + + public static String LandmarkMarkerManager_Mylyn_Landmark; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/actions/FocusCViewAction.java b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/actions/FocusCViewAction.java new file mode 100644 index 0000000..c6e4402 --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/actions/FocusCViewAction.java @@ -0,0 +1,145 @@ +/******************************************************************************* + * Copyright (c) 2004, 2009 Mylyn project committers and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Red Hat Inc. - Modification for CDT usage + *******************************************************************************/ + +package org.eclipse.mylyn.internal.cdt.ui.actions; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.eclipse.cdt.core.model.ICElement; +import org.eclipse.cdt.core.model.IMethod; +import org.eclipse.cdt.internal.ui.actions.SelectionConverter; +import org.eclipse.cdt.internal.ui.cview.CView; +import org.eclipse.cdt.internal.ui.cview.ToggleLinkingAction; +import org.eclipse.cdt.internal.ui.editor.CEditor; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.jface.action.ActionContributionItem; +import org.eclipse.jface.action.IContributionItem; +import org.eclipse.jface.text.ITextSelection; +import org.eclipse.jface.text.TextSelection; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.StructuredViewer; +import org.eclipse.jface.viewers.ViewerFilter; +import org.eclipse.mylyn.context.ui.AbstractAutoFocusViewAction; +import org.eclipse.mylyn.context.ui.InterestFilter; +import org.eclipse.mylyn.internal.cdt.ui.CDTDeclarationsFilter; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IViewPart; + +/** + * @author Mik Kersten + * @author Jeff Johnston + */ +public class FocusCViewAction extends AbstractAutoFocusViewAction { + + public FocusCViewAction() { + super(new InterestFilter(), true, true, true); + } + + @Override + protected ISelection resolveSelection(IEditorPart part, ITextSelection changedSelection, StructuredViewer viewer) + throws CoreException { + Object elementToSelect = null; + if (changedSelection instanceof TextSelection && part instanceof CEditor) { + ICElement cdtElement = SelectionConverter.getElementAtOffset(((CEditor) part).getInputCElement(), + changedSelection); + elementToSelect = cdtElement; + } + + if (elementToSelect != null) { + StructuredSelection currentSelection = (StructuredSelection) viewer.getSelection(); + if (currentSelection.size() <= 1) { + for (ViewerFilter filter : Arrays.asList(viewer.getFilters())) { + if (filter instanceof CDTDeclarationsFilter && elementToSelect instanceof IMethod) { + elementToSelect = ((IMethod) elementToSelect).getTranslationUnit(); + } + } + } + return new StructuredSelection(elementToSelect); + } else { + return null; + } + } + + // TODO: should have better way of doing this + @Override + protected void setManualFilteringAndLinkingEnabled(boolean enabled) { + IViewPart part = super.getPartForAction(); + if (part instanceof CView) { + for (IContributionItem item : ((CView) part).getViewSite().getActionBars().getToolBarManager().getItems()) { + if (item instanceof ActionContributionItem) { + ActionContributionItem actionItem = (ActionContributionItem) item; + if (actionItem.getAction() instanceof ToggleLinkingAction) { + actionItem.getAction().setEnabled(enabled); + } + } + } + for (IContributionItem item : ((CView) part).getViewSite().getActionBars().getMenuManager().getItems()) { + if (item instanceof ActionContributionItem) { + ActionContributionItem actionItem = (ActionContributionItem) item; + // TODO: file bug asking for extensibility + if (actionItem.getAction().getClass().getSimpleName().equals("ShowFilterDialogAction")) { //$NON-NLS-1$ + actionItem.getAction().setEnabled(enabled); + } + } + // NOTE: turning off dynamically contributed filter items is not currently feasible +// else if (item instanceof ContributionItem) { +// ContributionItem contributionItem = (ContributionItem) item; +// +// if (contributionItem.getClass().getSimpleName().equals("FilterActionMenuContributionItem")) { +// try { +// Class clazz = contributionItem.getClass(); +// Field field = clazz.getDeclaredField("fActionGroup"); +// field.setAccessible(true); +// Object object = field.get(contributionItem); +// if (object instanceof CustomFiltersActionGroup) { +// CustomFiltersActionGroup group = (CustomFiltersActionGroup) object; +// group.setFilters(new String[] { }); +// } +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } +// } + } + } + } + + @Override + protected void setDefaultLinkingEnabled(boolean on) { + IViewPart part = super.getPartForAction(); + if (part instanceof CView) { + ((CView) part).setLinkingEnabled(on); + } + } + + @Override + protected boolean isDefaultLinkingEnabled() { + IViewPart part = super.getPartForAction(); + if (part instanceof CView) { + return ((CView) part).isLinkingEnabled(); + } + return false; + } + + @Override + public List getViewers() { + List viewers = new ArrayList(); + // TODO: get from super + IViewPart part = super.getPartForAction(); + if (part instanceof CView) { + viewers.add(((CView) part).getViewer()); + } + return viewers; + } +} diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/actions/Messages.java b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/actions/Messages.java new file mode 100644 index 0000000..149a2b7 --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/actions/Messages.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2009 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.internal.cdt.ui.actions; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.cdt.ui.actions.messages"; //$NON-NLS-1$ + + public static String ToggleActiveFoldingAction_Active_Folding; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/actions/ToggleActiveFoldingAction.java b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/actions/ToggleActiveFoldingAction.java new file mode 100644 index 0000000..bc95d46 --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/actions/ToggleActiveFoldingAction.java @@ -0,0 +1,83 @@ +/******************************************************************************* + * Copyright (c) 2009 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ +package org.eclipse.mylyn.internal.cdt.ui.actions; + +import org.eclipse.cdt.ui.CUIPlugin; +import org.eclipse.cdt.ui.PreferenceConstants; +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.mylyn.internal.cdt.ui.CDTUIBridgePlugin; +import org.eclipse.swt.widgets.Event; +import org.eclipse.ui.IActionDelegate2; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.IWorkbenchWindowActionDelegate; + +/** + * @author Mik Kersten + * @author Shawn Minto + */ +public class ToggleActiveFoldingAction extends Action implements IWorkbenchWindowActionDelegate, IActionDelegate2 { + + private static ToggleActiveFoldingAction INSTANCE; + + private IAction parentAction = null; + + public ToggleActiveFoldingAction() { + INSTANCE = this; + setText(Messages.ToggleActiveFoldingAction_Active_Folding); + } + + public static void toggleFolding(boolean on) { + if (INSTANCE.parentAction != null) { + INSTANCE.valueChanged(INSTANCE.parentAction, on); + } + } + + public void run(IAction action) { + valueChanged(action, action.isChecked()); + } + + private void valueChanged(IAction action, final boolean on) { + if (on) { + CUIPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.EDITOR_FOLDING_ENABLED, true); + } + action.setChecked(on); + CDTUIBridgePlugin.getDefault().getPreferenceStore().setValue(CDTUIBridgePlugin.AUTO_FOLDING_ENABLED, on); + } + + public void setActiveEditor(IAction action, IEditorPart targetEditor) { + // don't care when the active editor changes + } + + public void selectionChanged(IAction action, ISelection selection) { + // don't care when the selection changes + } + + public void init(IAction action) { + this.parentAction = action; + valueChanged(action, + CDTUIBridgePlugin.getDefault().getPreferenceStore().getBoolean(CDTUIBridgePlugin.AUTO_FOLDING_ENABLED)); + } + + public void dispose() { + // don't need to do anything + + } + + public void runWithEvent(IAction action, Event event) { + run(action); + } + + public void init(IWorkbenchWindow window) { + } +} diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/actions/messages.properties b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/actions/messages.properties new file mode 100644 index 0000000..c0eb11d --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/actions/messages.properties @@ -0,0 +1,11 @@ +############################################################################### +# Copyright (c) 2010 Tasktop Technologies and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Tasktop Technologies - initial API and implementation +############################################################################### +ToggleActiveFoldingAction_Active_Folding=Active Folding diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/contentassist/CCompletionProposal.java b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/contentassist/CCompletionProposal.java new file mode 100644 index 0000000..ee90786 --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/contentassist/CCompletionProposal.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2004, 2009 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.internal.cdt.ui.contentassist; + +import org.eclipse.cdt.core.model.ICElement; +import org.eclipse.jface.text.ITextViewer; +import org.eclipse.swt.graphics.Image; + +/** + * @author Shawn Minto + */ +public class CCompletionProposal extends org.eclipse.cdt.internal.ui.text.contentassist.CCompletionProposal { + + private final ICElement cElement; + + // only needed until we can actually get the ICElement + private final String bindingName; + + public CCompletionProposal(String replacementString, int replacementOffset, int replacementLength, Image image, + String displayString, String idString, int relevance, ITextViewer viewer, ICElement element, + String bindingName) { + super(replacementString, replacementOffset, replacementLength, image, displayString, idString, relevance, + viewer); + this.cElement = element; + this.bindingName = bindingName; + } + + public ICElement getCElement() { + return cElement; + } + + public String getBindingName() { + return bindingName; + } + +} diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/contentassist/CDTContentAssistUtils.java b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/contentassist/CDTContentAssistUtils.java new file mode 100644 index 0000000..70893d3 --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/contentassist/CDTContentAssistUtils.java @@ -0,0 +1,79 @@ +/******************************************************************************* + * Copyright (c) 2009 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.internal.cdt.ui.contentassist; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.StringTokenizer; + +import org.eclipse.cdt.internal.ui.text.contentassist.CompletionProposalCategory; +import org.eclipse.cdt.internal.ui.text.contentassist.CompletionProposalComputerRegistry; +import org.eclipse.cdt.ui.PreferenceConstants; +import org.eclipse.jface.preference.IPreferenceStore; + +/** + * @author Shawn Minto + */ +public class CDTContentAssistUtils { + + private static final String SEPARATOR_CODEASSIST = "\0"; //$NON-NLS-1$ + + public static final String ASSIST_MYLYN_TYPE = "org.eclipse.mylyn.cdt.ui.parserProposalCategory"; //$NON-NLS-1$ + + public static final String ASSIST_CDT_TYPE = "org.eclipse.cdt.ui.parserProposalCategory"; //$NON-NLS-1$ + + public static void installContentAssist(IPreferenceStore cdtPrefs, boolean mylynContentAssist) { + Set disabledIds = getDisableContentAssistIds(cdtPrefs); + if (!mylynContentAssist) { + disabledIds.remove(ASSIST_CDT_TYPE); + disabledIds.add(ASSIST_MYLYN_TYPE); + } else { + disabledIds.add(ASSIST_CDT_TYPE); + disabledIds.remove(ASSIST_MYLYN_TYPE); + } + String newValue = ""; //$NON-NLS-1$ + for (String id : disabledIds) { + newValue += id + SEPARATOR_CODEASSIST; + } + cdtPrefs.setValue(PreferenceConstants.CODEASSIST_EXCLUDED_CATEGORIES, newValue); + + CompletionProposalComputerRegistry registry = CompletionProposalComputerRegistry.getDefault(); + List categories = registry.getProposalCategories(); + + for (CompletionProposalCategory cat : categories) { + if (disabledIds.contains(cat.getId())) { + cat.setIncluded(false); + } else { + cat.setIncluded(true); + } + } + } + + public static Set getDisableContentAssistIds(IPreferenceStore cdtPrefs) { + String oldValue = cdtPrefs.getString(PreferenceConstants.CODEASSIST_EXCLUDED_CATEGORIES); + StringTokenizer tokenizer = new StringTokenizer(oldValue, SEPARATOR_CODEASSIST); + Set disabledIds = new HashSet(); + while (tokenizer.hasMoreTokens()) { + disabledIds.add((String) tokenizer.nextElement()); + } + return disabledIds; + } + + public static void updateDefaultPreference(IPreferenceStore cdtPrefs) { + // the Task-Focused category should be disabled if the user reverts to the default + String defaultValue = cdtPrefs.getDefaultString(PreferenceConstants.CODEASSIST_EXCLUDED_CATEGORIES); + cdtPrefs.setDefault(PreferenceConstants.CODEASSIST_EXCLUDED_CATEGORIES, defaultValue + ASSIST_MYLYN_TYPE + + SEPARATOR_CODEASSIST); + } + +} diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/contentassist/DOMCompletionProposalComputer.java b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/contentassist/DOMCompletionProposalComputer.java new file mode 100644 index 0000000..4bf16e7 --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/contentassist/DOMCompletionProposalComputer.java @@ -0,0 +1,1224 @@ +/******************************************************************************* + * Copyright (c) 2004, 2009 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ +package org.eclipse.mylyn.internal.cdt.ui.contentassist; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.core.IPositionConverter; +import org.eclipse.cdt.core.dom.IName; +import org.eclipse.cdt.core.dom.ast.ASTTypeUtil; +import org.eclipse.cdt.core.dom.ast.DOMException; +import org.eclipse.cdt.core.dom.ast.IASTCompletionContext; +import org.eclipse.cdt.core.dom.ast.IASTCompletionNode; +import org.eclipse.cdt.core.dom.ast.IASTDeclarator; +import org.eclipse.cdt.core.dom.ast.IASTFileLocation; +import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition; +import org.eclipse.cdt.core.dom.ast.IASTFunctionStyleMacroParameter; +import org.eclipse.cdt.core.dom.ast.IASTIdExpression; +import org.eclipse.cdt.core.dom.ast.IASTName; +import org.eclipse.cdt.core.dom.ast.IASTNamedTypeSpecifier; +import org.eclipse.cdt.core.dom.ast.IASTNode; +import org.eclipse.cdt.core.dom.ast.IASTPreprocessorFunctionStyleMacroDefinition; +import org.eclipse.cdt.core.dom.ast.IASTPreprocessorMacroDefinition; +import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; +import org.eclipse.cdt.core.dom.ast.IBinding; +import org.eclipse.cdt.core.dom.ast.ICompositeType; +import org.eclipse.cdt.core.dom.ast.IEnumeration; +import org.eclipse.cdt.core.dom.ast.IEnumerator; +import org.eclipse.cdt.core.dom.ast.IField; +import org.eclipse.cdt.core.dom.ast.IFunction; +import org.eclipse.cdt.core.dom.ast.IFunctionType; +import org.eclipse.cdt.core.dom.ast.IMacroBinding; +import org.eclipse.cdt.core.dom.ast.IParameter; +import org.eclipse.cdt.core.dom.ast.IProblemBinding; +import org.eclipse.cdt.core.dom.ast.IScope; +import org.eclipse.cdt.core.dom.ast.IType; +import org.eclipse.cdt.core.dom.ast.ITypedef; +import org.eclipse.cdt.core.dom.ast.IVariable; +import org.eclipse.cdt.core.dom.ast.c.ICFunctionScope; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTUsingDeclaration; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTUsingDirective; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPField; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionScope; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPMember; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; +import org.eclipse.cdt.core.dom.ast.gnu.c.ICASTKnRFunctionDeclarator; +import org.eclipse.cdt.core.index.IIndex; +import org.eclipse.cdt.core.index.IIndexName; +import org.eclipse.cdt.core.model.CModelException; +import org.eclipse.cdt.core.model.CoreModel; +import org.eclipse.cdt.core.model.CoreModelUtil; +import org.eclipse.cdt.core.model.ICElement; +import org.eclipse.cdt.core.model.ITranslationUnit; +import org.eclipse.cdt.core.model.IWorkingCopy; +import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; +import org.eclipse.cdt.core.parser.util.CharArrayUtils; +import org.eclipse.cdt.internal.core.dom.parser.c.ICInternalBinding; +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPImplicitFunction; +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPImplicitMethod; +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPImplicitTypedef; +import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding; +import org.eclipse.cdt.internal.ui.text.CHeuristicScanner; +import org.eclipse.cdt.internal.ui.text.contentassist.CContentAssistInvocationContext; +import org.eclipse.cdt.internal.ui.text.contentassist.CProposalContextInformation; +import org.eclipse.cdt.internal.ui.text.contentassist.ParsingBasedProposalComputer; +import org.eclipse.cdt.internal.ui.text.contentassist.RelevanceConstants; +import org.eclipse.cdt.internal.ui.util.EditorUtility; +import org.eclipse.cdt.internal.ui.viewsupport.CElementImageProvider; +import org.eclipse.cdt.ui.CUIPlugin; +import org.eclipse.cdt.ui.IWorkingCopyManager; +import org.eclipse.cdt.ui.text.ICPartitions; +import org.eclipse.core.filebuffers.FileBuffers; +import org.eclipse.core.filebuffers.ITextFileBuffer; +import org.eclipse.core.filebuffers.ITextFileBufferManager; +import org.eclipse.core.filebuffers.LocationKind; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Status; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.text.BadLocationException; +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.IRegion; +import org.eclipse.jface.text.ITypedRegion; +import org.eclipse.jface.text.Region; +import org.eclipse.jface.text.TextUtilities; +import org.eclipse.jface.text.contentassist.ICompletionProposal; +import org.eclipse.mylyn.commons.core.StatusHandler; +import org.eclipse.mylyn.commons.ui.CommonImages; +import org.eclipse.mylyn.internal.cdt.ui.CDTUIBridgePlugin; +import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; + +/** + * Searches the DOM (both the AST and the index) for completion proposals. + * + * @author Bryan Wilkinson + */ +public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer { + private final IProgressMonitor fMonitor; + private ITranslationUnit fTU; + + /** + * Default constructor is required (executable extension). + */ + public DOMCompletionProposalComputer() { + fMonitor = new NullProgressMonitor(); + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + IWorkingCopy copy = null; + if (window != null) { + IWorkbenchPage page = window.getActivePage(); + if (page != null) { + IEditorPart editor = page.getActiveEditor(); + if (editor != null) { + IEditorInput input = editor.getEditorInput(); + IWorkingCopyManager manager = CUIPlugin.getDefault().getWorkingCopyManager(); + copy = manager.getWorkingCopy(input); + fTU = copy; + } + } + } + } + + @Override + protected List computeCompletionProposals(CContentAssistInvocationContext context, + IASTCompletionNode completionNode, String prefix) throws CoreException { + + List proposals = new ArrayList(); + + int indices[] = new int[200]; + for (int i = 0; i < indices.length; i++) { + indices[i] = -1; + } + + if (inPreprocessorDirective(context)) { + if (!inPreprocessorKeyword(context)) { + // add only macros + if (prefix.length() == 0) { + try { + prefix = context.computeIdentifierPrefix().toString(); + } catch (BadLocationException exc) { + CUIPlugin.log(exc); + } + } + addMacroProposals(context, prefix, proposals); + } + } else { + IASTTranslationUnit ast = completionNode.getTranslationUnit(); + String source = null; + + boolean handleMacros = false; + IASTName[] names = completionNode.getNames(); + + for (int i = 0; i < names.length; ++i) { + if (names[i].getTranslationUnit() == null) { + // The node isn't properly hooked up, must have backtracked out of this node + continue; + } + + IASTCompletionContext astContext = names[i].getCompletionContext(); + if (astContext == null) { + continue; + } else if (astContext instanceof IASTIdExpression || astContext instanceof IASTNamedTypeSpecifier) { + // handle macros only if there is a prefix + handleMacros = prefix.length() > 0; + } + + IBinding[] bindings = astContext.findBindings(names[i], !context.isContextInformationStyle()); + if (bindings != null) { + int index = 0; + int index2 = 0; + for (int j = 0; j < bindings.length; ++j) { + handleBinding(bindings[j], context, prefix, astContext, proposals); + + source = computeSourceForBinding(ast, bindings[j]); + if (source != null) { + if (!source.contains("@class") && !source.contains("@interface")) { //$NON-NLS-1$ //$NON-NLS-2$ + if (source.contains("@internal")) { //$NON-NLS-1$ + indices[index2++] = index; + } else if (source.contains("@privlevel") && source.contains("CORE")) { //$NON-NLS-1$ //$NON-NLS-2$ + indices[index2++] = index; + } + } + index++; + } + } + } + } + + if (handleMacros) { + addMacroProposals(context, prefix, proposals); + } + } + + for (int i = indices.length - 1; i > -1; i--) { + if (indices[i] != -1) { + proposals.remove(indices[i]); + } + } + + return proposals; + } + + /** + * Find a definition or declaration for the given binding and returns the source for it. + * Definitions are preferred over declarations. In case of multiple definitions or declarations, + * and the first name which yields source is taken. + * + * @param ast the AST of the translation unit + * @param binding the binding + * @return a source string or null, if no source could be computed + * @throws CoreException if the source file could not be loaded or if there was a + * problem with the index + */ + private String computeSourceForBinding(IASTTranslationUnit ast, IBinding binding) throws CoreException { + IName[] names = findDefsOrDecls(ast, binding); + + // in case the binding is a non-explicit specialization we need + // to consider the original binding (bug 281396) + if (names.length == 0 && binding instanceof ICPPSpecialization) { + binding= ((ICPPSpecialization) binding).getSpecializedBinding(); + if (!(binding instanceof IProblemBinding)) { + names= findDefsOrDecls(ast, binding); + } + } + if (names.length > 0) { + for (IName name : names) { + String source= computeSourceForName(name, binding); + if (source != null) { + return source; + } + } + } + return null; + } + /** + * Search for definitions or declarations for the given binding. + * @param ast the AST of the translation unit + * @param binding the binding + * @return an array of definitions or declarations, never null + * @throws CoreException + */ + private IName[] findDefsOrDecls(IASTTranslationUnit ast, IBinding binding) throws CoreException { + IName[] names= findDefinitions(ast, binding); + if (names.length == 0) { + names= findDeclarations(ast, binding); + } + return names; + } + /** + * Search for definitions for the given binding. + * + * @param ast the AST of the translation unit + * @param binding the binding + * @return an array of definitions, never null + * @throws CoreException + */ + private IName[] findDefinitions(IASTTranslationUnit ast, IBinding binding) throws CoreException { + IName[] declNames= ast.getDefinitionsInAST(binding); + if (declNames.length == 0 && ast.getIndex() != null) { + // search definitions in index + declNames = ast.getIndex().findNames(binding, IIndex.FIND_DEFINITIONS | IIndex.SEARCH_ACROSS_LANGUAGE_BOUNDARIES); + } + return declNames; + } + /** + * Search for declarations for the given binding. + * + * @param ast the AST of the translation unit + * @param binding the binding + * @return an array of declarations, never null + * @throws CoreException + */ + private IName[] findDeclarations(IASTTranslationUnit ast, IBinding binding) throws CoreException { + IName[] declNames= ast.getDeclarationsInAST(binding); + if (declNames.length == 0 && ast.getIndex() != null) { + // search declarations in index + declNames= ast.getIndex().findNames(binding, IIndex.FIND_DECLARATIONS | IIndex.SEARCH_ACROSS_LANGUAGE_BOUNDARIES); + } + return declNames; + } + /** + * Get the source for the given name from the underlying file. + * + * @param name the name to get the source for + * @param binding the binding of the name + * @return the source string or null, if the source could not be computed + * @throws CoreException if the file could not be loaded + */ + private String computeSourceForName(IName name, IBinding binding) throws CoreException { + IASTFileLocation fileLocation= name.getFileLocation(); + if (fileLocation == null) { + return null; + } + int nodeOffset= fileLocation.getNodeOffset(); + int nodeLength= fileLocation.getNodeLength(); + + String fileName= fileLocation.getFileName(); + //if (DEBUG) System.out.println("[CSourceHover] Computing source for " + name + " in " + fileName); //$NON-NLS-1$//$NON-NLS-2$ + IPath location= Path.fromOSString(fileName); + LocationKind locationKind= LocationKind.LOCATION; + if (name instanceof IASTName && !name.isReference()) { + IASTName astName= (IASTName)name; + if (astName.getTranslationUnit().getFilePath().equals(fileName) && fTU.getResource() != null) { + // reuse editor buffer for names local to the translation unit + location= fTU.getResource().getFullPath(); + locationKind= LocationKind.IFILE; + } + } else { + // try to resolve path to a resource for proper encoding (bug 221029) + IFile file= EditorUtility.getWorkspaceFileAtLocation(location, fTU); + if (file != null) { + location= file.getFullPath(); + locationKind= LocationKind.IFILE; + if (name instanceof IIndexName) { + // need to adjust index offsets to current offsets + // in case file has been modified since last index time + IIndexName indexName= (IIndexName) name; + long timestamp= indexName.getFile().getTimestamp(); + IPositionConverter converter= CCorePlugin.getPositionTrackerManager().findPositionConverter(file, timestamp); + if (converter != null) { + IRegion currentLocation= converter.historicToActual(new Region(nodeOffset, nodeLength)); + nodeOffset= currentLocation.getOffset(); + nodeLength= currentLocation.getLength(); + } + } + } + } + ITextFileBufferManager mgr= FileBuffers.getTextFileBufferManager(); + mgr.connect(location, locationKind, fMonitor); + ITextFileBuffer buffer= mgr.getTextFileBuffer(location, locationKind); + try { + IRegion nameRegion= new Region(nodeOffset, nodeLength); + final int nameOffset= nameRegion.getOffset(); + final int sourceStart; + final int sourceEnd; + IDocument doc= buffer.getDocument(); + if (nameOffset >= doc.getLength() || nodeLength <= 0) { + return null; + } + if (binding instanceof IMacroBinding) { + ITypedRegion partition= TextUtilities.getPartition(doc, ICPartitions.C_PARTITIONING, nameOffset, false); + if (ICPartitions.C_PREPROCESSOR.equals(partition.getType())) { + int directiveStart= partition.getOffset(); + int commentStart= searchCommentBackward(doc, directiveStart, -1); + if (commentStart >= 0) { + sourceStart= commentStart; + } else { + sourceStart= directiveStart; + } + sourceEnd= directiveStart + partition.getLength(); + } else { + return null; + } + } else { + // expand source range to include preceding comment, if any + boolean isKnR= isKnRSource(name); + sourceStart= computeSourceStart(doc, nameOffset, binding, isKnR); + if (sourceStart == CHeuristicScanner.NOT_FOUND) { + return null; + } + sourceEnd= computeSourceEnd(doc, nameOffset + nameRegion.getLength(), binding, name.isDefinition(), isKnR); + } + String source= buffer.getDocument().get(sourceStart, sourceEnd - sourceStart); + return source; + + } catch (BadLocationException exc) { + // ignore - should not happen anyway + //if (DEBUG) exc.printStackTrace(); + } finally { + mgr.disconnect(location, LocationKind.LOCATION, fMonitor); + } + return null; + } + /** + * Searches the start of the comment preceding the given source offset. + * Continuous line comments are considered as one comment until a block + * comment is reached or a non-comment partition. + * + * @param doc the document + * @param start the start of the backward search + * @param bound search boundary (exclusive) + * @return the comment start offset or -1, if no suitable comment was found + * @throws BadLocationException + */ + private static int searchCommentBackward(IDocument doc, int start, int bound) throws BadLocationException { + int firstLine= doc.getLineOfOffset(start); + if (firstLine == 0) { + return 0; + } + ITypedRegion partition= TextUtilities.getPartition(doc, ICPartitions.C_PARTITIONING, start, true); + int currentOffset= Math.max(doc.getLineOffset(firstLine - 1), partition.getOffset() - 1); + int commentOffset= -1; + while (currentOffset > bound) { + partition= TextUtilities.getPartition(doc, ICPartitions.C_PARTITIONING, currentOffset, true); + currentOffset= partition.getOffset() - 1; + if (ICPartitions.C_MULTI_LINE_COMMENT.equals(partition.getType()) + || ICPartitions.C_MULTI_LINE_DOC_COMMENT.equals(partition.getType())) { + final int partitionOffset= partition.getOffset(); + final int startLine= doc.getLineOfOffset(partitionOffset); + final int lineOffset= doc.getLineOffset(startLine); + if (partitionOffset == lineOffset || + doc.get(lineOffset, partitionOffset - lineOffset).trim().length() == 0) { + return lineOffset; + } + return commentOffset; + } else if (ICPartitions.C_SINGLE_LINE_COMMENT.equals(partition.getType()) + || ICPartitions.C_SINGLE_LINE_DOC_COMMENT.equals(partition.getType())) { + final int partitionOffset= partition.getOffset(); + final int startLine= doc.getLineOfOffset(partitionOffset); + final int lineOffset= doc.getLineOffset(startLine); + if (partitionOffset == lineOffset || + doc.get(lineOffset, partitionOffset - lineOffset).trim().length() == 0) { + commentOffset= lineOffset; + continue; + } + return commentOffset; + } else if (IDocument.DEFAULT_CONTENT_TYPE.equals(partition.getType())) { + if (doc.get(partition.getOffset(), partition.getLength()).trim().length() == 0) { + continue; + } + if (commentOffset >= 0) { + break; + } + } else { + break; + } + } + return commentOffset; + } + /** + * Determine if the name is part of a KnR function definition. + * @param name + * @return true if the name is part of a KnR function + */ + private boolean isKnRSource(IName name) { + if (name instanceof IASTName) { + IASTNode node= (IASTNode)name; + while (node.getParent() != null) { + if (node instanceof ICASTKnRFunctionDeclarator) { + return node.getParent() instanceof IASTFunctionDefinition; + } + node= node.getParent(); + } + } + return false; + } + private int computeSourceStart(IDocument doc, int nameOffset, IBinding binding, boolean isKnR) throws BadLocationException { + int sourceStart= nameOffset; + CHeuristicScanner scanner= new CHeuristicScanner(doc); + if (binding instanceof IParameter) { + if (isKnR) { + sourceStart= scanner.scanBackward(nameOffset, CHeuristicScanner.UNBOUND, new char[] { ')', ';' }); + } else { + sourceStart= scanner.scanBackward(nameOffset, CHeuristicScanner.UNBOUND, new char[] { '>', '(', ',' }); + if (sourceStart > 0 && doc.getChar(sourceStart) == '>') { + sourceStart= scanner.findOpeningPeer(sourceStart - 1, '<', '>'); + if (sourceStart > 0) { + sourceStart= scanner.scanBackward(sourceStart, CHeuristicScanner.UNBOUND, new char[] { '(', ',' }); + } + } + } + if (sourceStart == CHeuristicScanner.NOT_FOUND) { + return sourceStart; + } + sourceStart= scanner.findNonWhitespaceForward(sourceStart + 1, nameOffset); + if (sourceStart == CHeuristicScanner.NOT_FOUND) { + sourceStart = nameOffset; + } + } else if (binding instanceof ICPPTemplateParameter) { + sourceStart= scanner.scanBackward(nameOffset, CHeuristicScanner.UNBOUND, new char[] { '>', '<', ',' }); + if (sourceStart > 0 && doc.getChar(sourceStart) == '>') { + sourceStart= scanner.findOpeningPeer(sourceStart - 1, '<', '>'); + if (sourceStart > 0) { + sourceStart= scanner.scanBackward(sourceStart, CHeuristicScanner.UNBOUND, new char[] { '<', ',' }); + } + } + if (sourceStart == CHeuristicScanner.NOT_FOUND) { + return sourceStart; + } + sourceStart= scanner.findNonWhitespaceForward(sourceStart + 1, nameOffset); + if (sourceStart == CHeuristicScanner.NOT_FOUND) { + sourceStart = nameOffset; + } + } else if (binding instanceof IEnumerator) { + sourceStart= scanner.scanBackward(nameOffset, CHeuristicScanner.UNBOUND, new char[] { '{', ',' }); + if (sourceStart == CHeuristicScanner.NOT_FOUND) { + return sourceStart; + } + sourceStart= scanner.findNonWhitespaceForward(sourceStart + 1, nameOffset); + if (sourceStart == CHeuristicScanner.NOT_FOUND) { + sourceStart = nameOffset; + } + } else { + final boolean expectClosingBrace; + IType type= null; + try { + if (binding instanceof ITypedef) { + type= ((ITypedef)binding).getType(); + } else if (binding instanceof IVariable) { + type= ((IVariable)binding).getType(); + } + } catch (Exception exc) { + } + expectClosingBrace= type instanceof ICompositeType || type instanceof IEnumeration; + final int nameLine= doc.getLineOfOffset(nameOffset); + sourceStart= nameOffset; + int commentBound; + if (isKnR) { + commentBound= scanner.scanBackward(sourceStart, CHeuristicScanner.UNBOUND, new char[] { ')', ';' }); + } else { + commentBound= scanner.scanBackward(sourceStart, CHeuristicScanner.UNBOUND, new char[] { '{', '}', ';' }); + } + while (expectClosingBrace && commentBound > 0 && doc.getChar(commentBound) == '}') { + int openingBrace= scanner.findOpeningPeer(commentBound - 1, '{', '}'); + if (openingBrace != CHeuristicScanner.NOT_FOUND) { + sourceStart= openingBrace - 1; + } + if (isKnR) { + commentBound= scanner.scanBackward(sourceStart, CHeuristicScanner.UNBOUND, new char[] { ')', ';' }); + } else { + commentBound= scanner.scanBackward(sourceStart, CHeuristicScanner.UNBOUND, new char[] { '{', '}', ';' }); + } + } + if (commentBound == CHeuristicScanner.NOT_FOUND) { + commentBound= -1; // unbound + } + sourceStart= Math.min(sourceStart, doc.getLineOffset(nameLine)); + int commentStart= searchCommentBackward(doc, sourceStart, commentBound); + if (commentStart >= 0) { + sourceStart= commentStart; + } else { + int nextNonWS= scanner.findNonWhitespaceForward(commentBound+1, sourceStart); + if (nextNonWS != CHeuristicScanner.NOT_FOUND) { + int nextNonWSLine= doc.getLineOfOffset(nextNonWS); + int lineOffset= doc.getLineOffset(nextNonWSLine); + if (doc.get(lineOffset, nextNonWS - lineOffset).trim().length() == 0) { + sourceStart= doc.getLineOffset(nextNonWSLine); + } + } + } + } + return sourceStart; + } + private int computeSourceEnd(IDocument doc, int start, IBinding binding, boolean isDefinition, boolean isKnR) throws BadLocationException { + int sourceEnd= start; + CHeuristicScanner scanner= new CHeuristicScanner(doc); + // expand forward to the end of the definition/declaration + boolean searchBrace= false; + boolean searchSemi= false; + boolean searchComma= false; + if (binding instanceof ICompositeType || binding instanceof IEnumeration) { + searchBrace= true; + } else if (binding instanceof ICPPTemplateDefinition) { + searchBrace= true; + } else if (binding instanceof IFunction && isDefinition) { + searchBrace= true; + } else if (binding instanceof IParameter) { + if (isKnR) { + searchSemi= true; + } else { + searchComma= true; + } + } else if (binding instanceof IEnumerator || binding instanceof ICPPTemplateParameter) { + searchComma= true; + } else if (binding instanceof IVariable || binding instanceof ITypedef) { + searchSemi= true; + } else if (!isDefinition) { + searchSemi= true; + } + if (searchBrace) { + int brace= scanner.scanForward(start, CHeuristicScanner.UNBOUND, '{'); + if (brace != CHeuristicScanner.NOT_FOUND) { + sourceEnd= scanner.findClosingPeer(brace + 1, '{', '}'); + if (sourceEnd == CHeuristicScanner.NOT_FOUND) { + sourceEnd= doc.getLength(); + } + } + // expand region to include whole line + IRegion lineRegion= doc.getLineInformationOfOffset(sourceEnd); + sourceEnd= lineRegion.getOffset() + lineRegion.getLength(); + } else if (searchSemi) { + int semi= scanner.scanForward(start, CHeuristicScanner.UNBOUND, ';'); + if (semi != CHeuristicScanner.NOT_FOUND) { + sourceEnd= semi+1; + } + // expand region to include whole line + IRegion lineRegion= doc.getLineInformationOfOffset(sourceEnd); + sourceEnd= lineRegion.getOffset() + lineRegion.getLength(); + } else if (searchComma) { + int bound; + if (binding instanceof IParameter) { + bound= scanner.findClosingPeer(start, '(', ')'); + } else if (binding instanceof ICPPTemplateParameter) { + bound= scanner.findClosingPeer(start, '<', '>'); + } else if (binding instanceof IEnumerator) { + bound= scanner.findClosingPeer(start, '{', '}'); + } else { + bound = CHeuristicScanner.NOT_FOUND; + } + if (bound == CHeuristicScanner.NOT_FOUND) { + bound= Math.min(doc.getLength(), start + 100); + } + int comma= scanner.scanForward(start, bound, ','); + if (comma == CHeuristicScanner.NOT_FOUND) { + // last argument + sourceEnd= bound; + } else { + sourceEnd= comma; + // expand region to include whole line if rest is comment + IRegion lineRegion= doc.getLineInformationOfOffset(sourceEnd); + int lineEnd= lineRegion.getOffset() + lineRegion.getLength(); + int nextNonWS= scanner.findNonWhitespaceForwardInAnyPartition(sourceEnd + 1, lineEnd); + if (nextNonWS != CHeuristicScanner.NOT_FOUND) { + String contentType= TextUtilities.getContentType(doc, ICPartitions.C_PARTITIONING, nextNonWS, false); + if (ICPartitions.C_MULTI_LINE_COMMENT.equals(contentType) || ICPartitions.C_SINGLE_LINE_COMMENT.equals(contentType)) { + sourceEnd= lineEnd; + } + } + } + } + return sourceEnd; + } + /** + * Test whether the invocation offset is inside or before the preprocessor directive keyword. + * + * @param context + * the invocation context + * @return true if the invocation offset is inside or before the directive keyword + */ + private boolean inPreprocessorKeyword(CContentAssistInvocationContext context) { + IDocument doc = context.getDocument(); + int offset = context.getInvocationOffset(); + + try { + final ITypedRegion partition = TextUtilities.getPartition(doc, ICPartitions.C_PARTITIONING, offset, true); + if (ICPartitions.C_PREPROCESSOR.equals(partition.getType())) { + String ppPrefix = doc.get(partition.getOffset(), offset - partition.getOffset()); + if (ppPrefix.matches("\\s*#\\s*\\w*")) { //$NON-NLS-1$ + // we are inside the directive keyword + return true; + } + } + + } catch (BadLocationException exc) { + } + return false; + } + + /** + * Check if the invocation offset is inside a preprocessor directive. + * + * @param context + * the content asist invocation context + * @return true if invocation offset is inside a preprocessor directive + */ + private boolean inPreprocessorDirective(CContentAssistInvocationContext context) { + IDocument doc = context.getDocument(); + int offset = context.getInvocationOffset(); + + try { + final ITypedRegion partition = TextUtilities.getPartition(doc, ICPartitions.C_PARTITIONING, offset, true); + if (ICPartitions.C_PREPROCESSOR.equals(partition.getType())) { + return true; + } + + } catch (BadLocationException exc) { + } + return false; + } + + private void addMacroProposals(CContentAssistInvocationContext context, String prefix, + List proposals) { + char[] prefixChars = prefix.toCharArray(); + final boolean matchPrefix = !context.isContextInformationStyle(); + IASTCompletionNode completionNode = context.getCompletionNode(); + IASTPreprocessorMacroDefinition[] macros = completionNode.getTranslationUnit().getMacroDefinitions(); + if (macros != null) { + for (int i = 0; i < macros.length; ++i) { + final char[] macroName = macros[i].getName().toCharArray(); + if (CharArrayUtils.equals(macroName, 0, matchPrefix ? prefixChars.length : macroName.length, + prefixChars, true)) { + handleMacro(macros[i], context, prefix, proposals); + } + } + } + macros = completionNode.getTranslationUnit().getBuiltinMacroDefinitions(); + if (macros != null) { + for (int i = 0; i < macros.length; ++i) { + final char[] macroName = macros[i].getName().toCharArray(); + if (CharArrayUtils.equals(macroName, 0, matchPrefix ? prefixChars.length : macroName.length, + prefixChars, true)) { + handleMacro(macros[i], context, prefix, proposals); + } + } + } + } + + private void handleMacro(IASTPreprocessorMacroDefinition macro, CContentAssistInvocationContext context, + String prefix, List proposals) { + +//CElementHandleFactory.create; + final String macroName = macro.getName().toString(); + final int baseRelevance = computeBaseRelevance(prefix, macroName); + + Image image = getImage(CElementImageProvider.getMacroImageDescriptor()); + + if (macro instanceof IASTPreprocessorFunctionStyleMacroDefinition) { + IASTPreprocessorFunctionStyleMacroDefinition functionMacro = (IASTPreprocessorFunctionStyleMacroDefinition) macro; + + StringBuilder repStringBuff = new StringBuilder(); + repStringBuff.append(macroName); + repStringBuff.append('('); + + StringBuilder args = new StringBuilder(); + + IASTFunctionStyleMacroParameter[] params = functionMacro.getParameters(); + if (params != null) { + for (int i = 0; i < params.length; ++i) { + if (i > 0) { + args.append(", "); //$NON-NLS-1$ + } + args.append(params[i].getParameter()); + } + } + String argString = args.toString(); + + StringBuilder descStringBuff = new StringBuilder(repStringBuff.toString()); + descStringBuff.append(argString); + descStringBuff.append(')'); + + repStringBuff.append(')'); + String repString = repStringBuff.toString(); + String descString = descStringBuff.toString(); + + CCompletionProposal proposal = createProposal(repString, descString, prefix.length(), image, baseRelevance + + RelevanceConstants.MACRO_TYPE_RELEVANCE, context, getCElement(macro), macro.getName().toString()); + if (!context.isContextInformationStyle()) { + proposal.setCursorPosition(repString.length() - 1); + } + + if (argString.length() > 0) { + CProposalContextInformation info = new CProposalContextInformation(image, descString, argString); + info.setContextInformationPosition(context.getContextInformationOffset()); + proposal.setContextInformation(info); + } + + proposals.add(proposal); + } else { + proposals.add(createProposal(macroName, macroName, prefix.length(), image, baseRelevance + + RelevanceConstants.MACRO_TYPE_RELEVANCE, context, getCElement(macro), macro.getName().toString())); + } + } + + @SuppressWarnings("restriction") + protected void handleBinding(IBinding binding, CContentAssistInvocationContext cContext, String prefix, + IASTCompletionContext astContext, List proposals) { + + if ((binding instanceof CPPImplicitFunction || binding instanceof CPPImplicitTypedef) + && !(binding instanceof CPPImplicitMethod)) { + return; + } + + if (!isAnonymousBinding(binding)) { + final String name = binding.getName(); + final int baseRelevance = computeBaseRelevance(prefix, name); + if (binding instanceof ICPPClassType) { + handleClass((ICPPClassType) binding, astContext, cContext, baseRelevance, proposals); + } else if (binding instanceof IFunction) { + handleFunction((IFunction) binding, cContext, baseRelevance, proposals); + } else if (!cContext.isContextInformationStyle()) { + if (binding instanceof IVariable) { + handleVariable((IVariable) binding, cContext, baseRelevance, proposals); + } else if (binding instanceof ITypedef) { + proposals.add(createProposal(name, name, getImage(binding), baseRelevance + + RelevanceConstants.TYPEDEF_TYPE_RELEVANCE, cContext, getCElement(binding), + binding.getName())); + } else if (binding instanceof ICPPNamespace) { + handleNamespace((ICPPNamespace) binding, astContext, cContext, baseRelevance, proposals); + } else if (binding instanceof IEnumeration) { + proposals.add(createProposal(name, name, getImage(binding), baseRelevance + + RelevanceConstants.ENUMERATION_TYPE_RELEVANCE, cContext, getCElement(binding), + binding.getName())); + } else if (binding instanceof IEnumerator) { + proposals.add(createProposal(name, name, getImage(binding), baseRelevance + + RelevanceConstants.ENUMERATOR_TYPE_RELEVANCE, cContext, getCElement(binding), + binding.getName())); + } else { + proposals.add(createProposal(name, name, getImage(binding), baseRelevance + + RelevanceConstants.DEFAULT_TYPE_RELEVANCE, cContext, getCElement(binding), + binding.getName())); + } + } + } + } + + private boolean isAnonymousBinding(IBinding binding) { + char[] name = binding.getNameCharArray(); + return name.length == 0 || name[0] == '{'; + } + + private void handleClass(ICPPClassType classType, IASTCompletionContext astContext, + CContentAssistInvocationContext context, int baseRelevance, List proposals) { + if (context.isContextInformationStyle()) { + try { + ICPPConstructor[] constructors = classType.getConstructors(); + for (ICPPConstructor constructor : constructors) { + handleFunction(constructor, context, baseRelevance, proposals); + } + } catch (Exception e) { + handle(e); + } + } else { + int relevance = 0; + try { + switch (classType.getKey()) { + case ICPPClassType.k_class: + relevance = RelevanceConstants.CLASS_TYPE_RELEVANCE; + break; + case ICompositeType.k_struct: + relevance = RelevanceConstants.STRUCT_TYPE_RELEVANCE; + break; + case ICompositeType.k_union: + relevance = RelevanceConstants.UNION_TYPE_RELEVANCE; + break; + } + } catch (Exception e) { + handle(e); + } + if (astContext instanceof IASTName && !(astContext instanceof ICPPASTQualifiedName)) { + IASTName name = (IASTName) astContext; + if (name.getParent() instanceof IASTDeclarator) { + proposals.add(createProposal( + classType.getName() + "::", classType.getName(), getImage(classType), baseRelevance + relevance, context, getCElement(classType), classType.getName())); //$NON-NLS-1$ + } + } + proposals.add(createProposal(classType.getName(), classType.getName(), getImage(classType), baseRelevance + + RelevanceConstants.CLASS_TYPE_RELEVANCE, context, getCElement(classType), classType.getName())); + } + } + + private void handle(Exception e) { + if (e instanceof RuntimeException) { + throw (RuntimeException) e; + } + } + + private void handleFunction(IFunction function, CContentAssistInvocationContext context, int baseRelevance, + List proposals) { + Image image = getImage(function); + + StringBuilder repStringBuff = new StringBuilder(); + repStringBuff.append(function.getName()); + repStringBuff.append('('); + + StringBuilder dispargs = new StringBuilder(); // for the displayString + StringBuilder idargs = new StringBuilder(); // for the idString + String returnTypeStr = null; + try { + IParameter[] params = function.getParameters(); + if (params != null) { + for (int i = 0; i < params.length; ++i) { + IType paramType = params[i].getType(); + if (i > 0) { + dispargs.append(','); + idargs.append(','); + } + + dispargs.append(ASTTypeUtil.getType(paramType, false)); + idargs.append(ASTTypeUtil.getType(paramType, false)); + String paramName = params[i].getName(); + if (paramName != null && paramName.length() > 0) { + dispargs.append(' '); + dispargs.append(paramName); + } + } + + if (function.takesVarArgs()) { + if (params.length > 0) { + dispargs.append(','); + idargs.append(','); + } + dispargs.append("..."); //$NON-NLS-1$ + idargs.append("..."); //$NON-NLS-1$ + } else if (params.length == 0) { // force the void in + dispargs.append("void"); //$NON-NLS-1$ + idargs.append("void"); //$NON-NLS-1$ + } + } + IFunctionType functionType = function.getType(); + if (functionType != null) { + IType returnType = functionType.getReturnType(); + if (returnType != null) { + returnTypeStr = ASTTypeUtil.getType(returnType, false); + } + } + } catch (Exception e) { + } + + String dispargString = dispargs.toString(); + String idargString = idargs.toString(); + + StringBuilder dispStringBuff = new StringBuilder(repStringBuff.toString()); + dispStringBuff.append(dispargString); + dispStringBuff.append(')'); + if (returnTypeStr != null && returnTypeStr.length() > 0) { + dispStringBuff.append(" : "); //$NON-NLS-1$ + dispStringBuff.append(returnTypeStr); + } + String dispString = dispStringBuff.toString(); + + StringBuilder idStringBuff = new StringBuilder(repStringBuff.toString()); + idStringBuff.append(idargString); + idStringBuff.append(')'); + String idString = idStringBuff.toString(); + + repStringBuff.append(')'); + String repString = repStringBuff.toString(); + + final int relevance = function instanceof ICPPMethod + ? RelevanceConstants.METHOD_TYPE_RELEVANCE + : RelevanceConstants.FUNCTION_TYPE_RELEVANCE; + CCompletionProposal proposal = createProposal(repString, dispString, idString, context.getCompletionNode() + .getLength(), image, baseRelevance + relevance, context, getCElement(function), function.getName()); + if (!context.isContextInformationStyle()) { + proposal.setCursorPosition(repString.length() - 1); + } + + if (dispargString.length() > 0) { + CProposalContextInformation info = new CProposalContextInformation(image, dispString, dispargString); + info.setContextInformationPosition(context.getContextInformationOffset()); + proposal.setContextInformation(info); + } + + proposals.add(proposal); + } + + private void handleVariable(IVariable variable, CContentAssistInvocationContext context, int baseRelevance, + List proposals) { + StringBuilder repStringBuff = new StringBuilder(); + repStringBuff.append(variable.getName()); + + String returnTypeStr = ""; //$NON-NLS-1$ + try { + IType varType = variable.getType(); + if (varType != null) { + returnTypeStr = ASTTypeUtil.getType(varType, false); + } + } catch (Exception e) { + } + + StringBuilder dispStringBuff = new StringBuilder(repStringBuff.toString()); + if (returnTypeStr != null) { + dispStringBuff.append(" : "); //$NON-NLS-1$ + dispStringBuff.append(returnTypeStr); + } + String dispString = dispStringBuff.toString(); + + StringBuilder idStringBuff = new StringBuilder(repStringBuff.toString()); + String idString = idStringBuff.toString(); + + String repString = repStringBuff.toString(); + + Image image = getImage(variable); + final int relevance = isLocalVariable(variable) + ? RelevanceConstants.LOCAL_VARIABLE_TYPE_RELEVANCE + : isField(variable) + ? RelevanceConstants.FIELD_TYPE_RELEVANCE + : RelevanceConstants.VARIABLE_TYPE_RELEVANCE; + CCompletionProposal proposal = createProposal(repString, dispString, idString, context.getCompletionNode() + .getLength(), image, baseRelevance + relevance, context, getCElement(variable), variable.getName()); + proposals.add(proposal); + } + + private static boolean isField(IVariable variable) { + return variable instanceof IField; + } + + private static boolean isLocalVariable(IVariable variable) { + try { + return isLocalScope(variable.getScope()); + } catch (DOMException exc) { + return false; + } + } + + private static boolean isLocalScope(IScope scope) { + while (scope != null) { + if (scope instanceof ICPPFunctionScope || scope instanceof ICPPBlockScope + || scope instanceof ICFunctionScope) { + return true; + } + try { + scope = scope.getParent(); + } catch (DOMException e) { + scope = null; + } + } + return false; + } + + private void handleNamespace(ICPPNamespace namespace, IASTCompletionContext astContext, + CContentAssistInvocationContext cContext, int baseRelevance, List proposals) { + + if (astContext instanceof ICPPASTQualifiedName) { + IASTCompletionContext parent = ((ICPPASTQualifiedName) astContext).getCompletionContext(); + handleNamespace(namespace, parent, cContext, baseRelevance, proposals); + return; + } + + StringBuilder repStringBuff = new StringBuilder(); + repStringBuff.append(namespace.getName()); + + if (!(astContext instanceof ICPPASTUsingDeclaration) && !(astContext instanceof ICPPASTUsingDirective)) { + repStringBuff.append("::"); //$NON-NLS-1$ + } + + String repString = repStringBuff.toString(); + proposals.add(createProposal(repString, namespace.getName(), getImage(namespace), baseRelevance + + RelevanceConstants.NAMESPACE_TYPE_RELEVANCE, cContext, getCElement(namespace), namespace.getName())); + } + + private ICElement getCElement(ICPPNamespace namespace) { + // ignore + return null; + } + + private ICElement getCElement(IVariable variable) { + return null; + } + + private ICElement getCElement(IFunction function) { + + return null; + } + + private ICElement getCElement(ICPPClassType classType) { + return null; + } + + private ICElement getCElement(IASTPreprocessorMacroDefinition macro) { + if (macro != null && macro.getFileLocation() != null) { + try { + return getCElement(macro.getFileLocation().getFileName(), macro.getFileLocation().getNodeOffset()); + } catch (Exception e) { + StatusHandler.log(new Status(IStatus.ERROR, CDTUIBridgePlugin.ID_PLUGIN, + "Unable to get CElement for Macro", e)); //$NON-NLS-1$ + } + } + return null; + } + + @SuppressWarnings("restriction") + private ICElement getCElement(IBinding binding) { + IASTNode definition = null; + if (binding instanceof ICInternalBinding) { + IASTNode[] declarations = ((ICInternalBinding) binding).getDeclarations(); + if (declarations != null && declarations.length > 0) { + definition = declarations[0]; + } + } else if (binding instanceof ICPPInternalBinding) { + IASTNode[] declarations = ((ICPPInternalBinding) binding).getDeclarations(); + if (declarations != null && declarations.length > 0) { + definition = declarations[0]; + } + } + if (definition != null && definition.getFileLocation() != null) { + try { + return getCElement(definition.getFileLocation().getFileName(), definition.getFileLocation() + .getNodeOffset()); + } catch (CModelException e) { + StatusHandler.log(new Status(IStatus.ERROR, CDTUIBridgePlugin.ID_PLUGIN, + "Unable to get CElement for Binding", e)); //$NON-NLS-1$ + } + } + return null; + } + + private ICElement getCElement(String filename, int offset) throws CModelException { + + IFile res = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(filename)); + + ITranslationUnit cu = null; + if (res instanceof IFile) { + IFile file = res; + if (CoreModel.isValidTranslationUnitName(null, file.getName())) { + cu = CoreModelUtil.findTranslationUnit(file); + } else { + return null; + } + } + if (cu != null) { + ICElement ce = cu.getElementAtOffset(offset); + return ce; + } else { + return null; + } + } + + private CCompletionProposal createProposal(String repString, String dispString, Image image, int relevance, + CContentAssistInvocationContext context, ICElement element, String bindingName) { + return createProposal(repString, dispString, null, context.getCompletionNode().getLength(), image, relevance, + context, element, bindingName); + } + + private CCompletionProposal createProposal(String repString, String dispString, int prefixLength, Image image, + int relevance, CContentAssistInvocationContext context, ICElement element, String bindingName) { + return createProposal(repString, dispString, null, prefixLength, image, relevance, context, element, + bindingName); + } + + private CCompletionProposal createProposal(String repString, String dispString, String idString, int prefixLength, + Image image, int relevance, CContentAssistInvocationContext context, ICElement element, String bindingName) { + int parseOffset = context.getParseOffset(); + int invocationOffset = context.getInvocationOffset(); + boolean doReplacement = !context.isContextInformationStyle(); + + int repLength = doReplacement ? prefixLength : 0; + int repOffset = doReplacement ? parseOffset - repLength : invocationOffset; + repString = doReplacement ? repString : ""; //$NON-NLS-1$ + + return new CCompletionProposal(repString, repOffset, repLength, image, dispString, idString, relevance, + context.getViewer(), element, bindingName); + } + + private Image getImage(ImageDescriptor desc) { + return desc != null ? CommonImages.getImage(desc) : null; + } + + private Image getImage(IBinding binding) { + ImageDescriptor imageDescriptor = null; + + try { + if (binding instanceof ITypedef) { + imageDescriptor = CElementImageProvider.getTypedefImageDescriptor(); + } else if (binding instanceof ICompositeType) { + if (((ICompositeType) binding).getKey() == ICPPClassType.k_class + || binding instanceof ICPPClassTemplate) { + imageDescriptor = CElementImageProvider.getClassImageDescriptor(); + } else if (((ICompositeType) binding).getKey() == ICompositeType.k_struct) { + imageDescriptor = CElementImageProvider.getStructImageDescriptor(); + } else if (((ICompositeType) binding).getKey() == ICompositeType.k_union) { + imageDescriptor = CElementImageProvider.getUnionImageDescriptor(); + } + } else if (binding instanceof ICPPMethod) { + switch (((ICPPMethod) binding).getVisibility()) { + case ICPPMember.v_private: + imageDescriptor = CElementImageProvider.getMethodImageDescriptor(ASTAccessVisibility.PRIVATE); + break; + case ICPPMember.v_protected: + imageDescriptor = CElementImageProvider.getMethodImageDescriptor(ASTAccessVisibility.PROTECTED); + break; + default: + imageDescriptor = CElementImageProvider.getMethodImageDescriptor(ASTAccessVisibility.PUBLIC); + break; + } + } else if (binding instanceof IFunction) { + imageDescriptor = CElementImageProvider.getFunctionImageDescriptor(); + } else if (binding instanceof ICPPField) { + switch (((ICPPField) binding).getVisibility()) { + case ICPPMember.v_private: + imageDescriptor = CElementImageProvider.getFieldImageDescriptor(ASTAccessVisibility.PRIVATE); + break; + case ICPPMember.v_protected: + imageDescriptor = CElementImageProvider.getFieldImageDescriptor(ASTAccessVisibility.PROTECTED); + break; + default: + imageDescriptor = CElementImageProvider.getFieldImageDescriptor(ASTAccessVisibility.PUBLIC); + break; + } + } else if (binding instanceof IField) { + imageDescriptor = CElementImageProvider.getFieldImageDescriptor(ASTAccessVisibility.PUBLIC); + } else if (binding instanceof IVariable) { + imageDescriptor = CElementImageProvider.getVariableImageDescriptor(); + } else if (binding instanceof IEnumeration) { + imageDescriptor = CElementImageProvider.getEnumerationImageDescriptor(); + } else if (binding instanceof IEnumerator) { + imageDescriptor = CElementImageProvider.getEnumeratorImageDescriptor(); + } else if (binding instanceof ICPPNamespace) { + imageDescriptor = CElementImageProvider.getNamespaceImageDescriptor(); + } else if (binding instanceof ICPPFunctionTemplate) { + imageDescriptor = CElementImageProvider.getFunctionImageDescriptor(); + } else if (binding instanceof ICPPUsingDeclaration) { + IBinding[] delegates = ((ICPPUsingDeclaration) binding).getDelegates(); + if (delegates.length > 0) { + return getImage(delegates[0]); + } + } + } catch (Exception e) { + handle(e); + } + + return imageDescriptor != null ? CommonImages.getImage(imageDescriptor) : null; + } +} diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/contentassist/FocusedCProposalProcessor.java b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/contentassist/FocusedCProposalProcessor.java new file mode 100644 index 0000000..a4ee7f7 --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/contentassist/FocusedCProposalProcessor.java @@ -0,0 +1,211 @@ +/******************************************************************************* + * Copyright (c) 2004, 2009 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ +package org.eclipse.mylyn.internal.cdt.ui.contentassist; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.cdt.ui.text.ICCompletionProposal; +import org.eclipse.cdt.ui.text.contentassist.ICompletionProposalComputer; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.ITextViewer; +import org.eclipse.mylyn.commons.core.StatusHandler; +import org.eclipse.mylyn.commons.ui.CommonImages; +import org.eclipse.mylyn.context.core.ContextCore; +import org.eclipse.mylyn.context.core.IInteractionElement; +import org.eclipse.mylyn.internal.cdt.ui.CDTUIBridgePlugin; + +/** + * @author Shawn Minto + */ +public class FocusedCProposalProcessor { + + /** + * Range above which elements are part of the context. + */ + private static final int THRESHOLD_INTEREST = 10000; + + /** + * Range for implicitly interesting element, such as method parameters. + */ + private static final int THRESHOLD_IMPLICIT_INTEREST = THRESHOLD_INTEREST * 2; + + /** + * Threshold for determining which JDT proposals should be implicitly interesting. + */ + private static final int RELEVANCE_IMPLICIT_INTEREST_C = 600; + + /** + * Threshold for implicit interest of IJavaElement proposals. + */ + private static final int RELEVANCE_IMPLICIT_INTEREST_MISC = 110; + + private static final String IDENTIFIER_THIS = "this"; //$NON-NLS-1$ + + public static final String LABEL_SEPARATOR = " -------------------------------------------- "; //$NON-NLS-1$ + + public static final FocusedProposalSeparator PROPOSAL_SEPARATOR = new FocusedProposalSeparator(); + + private final List monitoredProposalComputers = new ArrayList(); + + private final List alreadyComputedProposals = new ArrayList(); + + private final List alreadyContainSeparator = new ArrayList(); + + private final List containsSingleInterestingProposal = new ArrayList(); + + private static FocusedCProposalProcessor INSTANCE = new FocusedCProposalProcessor(); + + private FocusedCProposalProcessor() { + } + + public static FocusedCProposalProcessor getDefault() { + return INSTANCE; + } + + public void addMonitoredComputer(ICompletionProposalComputer proposalComputer) { + monitoredProposalComputers.add(proposalComputer); + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + public List projectInterestModel(ICompletionProposalComputer proposalComputer, List proposals) { + try { + if (!ContextCore.getContextManager().isContextActive()) { + return proposals; + } else { + boolean hasInterestingProposals = false; + for (Object object : proposals) { + if (object instanceof CCompletionProposal) { + boolean foundInteresting = boostRelevanceWithInterest((CCompletionProposal) object); + if (!hasInterestingProposals && foundInteresting) { + hasInterestingProposals = true; + } + } + } + + // NOTE: this annoying state needs to be maintainted to ensure + // the + // separator is added only once, and not added for single + // proposals + if (containsSingleInterestingProposal.size() > 0 && proposals.size() > 0) { + proposals.add(FocusedCProposalProcessor.PROPOSAL_SEPARATOR); + } else if (hasInterestingProposals/* && alreadyContainSeparator.isEmpty()*/) { // FIXME WHY IS THIS DIFFERENT THAN JAVA? + if (proposals.size() == 1) { + containsSingleInterestingProposal.add(proposalComputer); + } else { + proposals.add(FocusedCProposalProcessor.PROPOSAL_SEPARATOR); + alreadyContainSeparator.add(proposalComputer); + } + } + + alreadyComputedProposals.add(proposalComputer); + if (alreadyComputedProposals.size() == monitoredProposalComputers.size()) { + alreadyComputedProposals.clear(); + alreadyContainSeparator.clear(); + containsSingleInterestingProposal.clear(); + } + + return proposals; + } + } catch (Throwable t) { + StatusHandler.log(new Status(IStatus.ERROR, CDTUIBridgePlugin.ID_PLUGIN, + "Failed to project interest onto propsals", t)); //$NON-NLS-1$ + return proposals; + } + } + + private boolean boostRelevanceWithInterest(CCompletionProposal proposal) { + + boolean hasInteresting = false; + String name = proposal.getBindingName(); + + if (name != null) { + IInteractionElement interactionElement = guessInteractionElement(name); + if (interactionElement != null) { + float interest = interactionElement.getInterest().getValue(); + if (interest > ContextCore.getCommonContextScaling().getInteresting()) { + // TODO: losing precision here, only going to one decimal place + proposal.setRelevance(THRESHOLD_INTEREST + (int) (interest * 10)); + hasInteresting = true; + } else if (proposal.getRelevance() > RELEVANCE_IMPLICIT_INTEREST_C) { + proposal.setRelevance(THRESHOLD_IMPLICIT_INTEREST + proposal.getRelevance()); + } + } else if (proposal.getRelevance() > RELEVANCE_IMPLICIT_INTEREST_C) { + proposal.setRelevance(THRESHOLD_IMPLICIT_INTEREST + proposal.getRelevance()); + } + } else if (isImplicitlyInteresting(proposal)) { + proposal.setRelevance(THRESHOLD_IMPLICIT_INTEREST + proposal.getRelevance()); + hasInteresting = true; + } + return hasInteresting; + +// FIXME ADD BACK THE RIGHT WAY TO DO THIS! +// boolean hasInteresting = false; +// ICElement cElement = proposal.getCElement(); +// +// if (cElement != null) { +// IInteractionElement interactionElement = ContextCore.getContextManager().getElement( +// cElement.getHandleIdentifier()); +// float interest = interactionElement.getInterest().getValue(); +// if (interest > ContextCore.getCommonContextScaling().getInteresting()) { +// // TODO: losing precision here, only going to one decimal place +// proposal.setRelevance(THRESHOLD_INTEREST + (int) (interest * 10)); +// hasInteresting = true; +// } else if (proposal.getRelevance() > RELEVANCE_IMPLICIT_INTEREST_C) { +// proposal.setRelevance(THRESHOLD_IMPLICIT_INTEREST + proposal.getRelevance()); +// } +// } else if (isImplicitlyInteresting(proposal)) { +// proposal.setRelevance(THRESHOLD_IMPLICIT_INTEREST + proposal.getRelevance()); +// hasInteresting = true; +// } +// return hasInteresting; + } + + private IInteractionElement guessInteractionElement(String name) { + for (IInteractionElement element : ContextCore.getContextManager().getActiveContext().getInteresting()) { + String handle = element.getHandleIdentifier(); + // remove any line information so we can compare the end instead of using a contains + if (handle.contains("#")) { //$NON-NLS-1$ + handle = handle.substring(0, handle.indexOf("#"));//$NON-NLS-1$ + } + if (handle.endsWith(name)) { + return element; + } + } + return null; + } + + public boolean isImplicitlyInteresting(ICCompletionProposal proposal) { + return proposal.getRelevance() > RELEVANCE_IMPLICIT_INTEREST_MISC + && !IDENTIFIER_THIS.equals(proposal.getDisplayString()); + } + + static class FocusedProposalSeparator extends CCompletionProposal { + public FocusedProposalSeparator() { + super("", 0, 0, CommonImages.getImage(CommonImages.SEPARATOR_LIST), LABEL_SEPARATOR, //$NON-NLS-1$ + "", FocusedCProposalProcessor.THRESHOLD_INTEREST, null, null, null); //$NON-NLS-1$ + } + + @Override + public void apply(IDocument document) { + } + + @Override + public void apply(IDocument document, char trigger, int offset) { + } + + @Override + public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) { + } + } +} diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/contentassist/FocusedDOMCompletionProposalComputer.java b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/contentassist/FocusedDOMCompletionProposalComputer.java new file mode 100644 index 0000000..b37154d --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/contentassist/FocusedDOMCompletionProposalComputer.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2004, 2009 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.internal.cdt.ui.contentassist; + +import java.util.Collections; +import java.util.List; +import java.util.Set; + +import org.eclipse.cdt.ui.CUIPlugin; +import org.eclipse.cdt.ui.text.contentassist.ContentAssistInvocationContext; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.text.contentassist.ICompletionProposal; + +/** + * @author Shawn Minto + */ +public class FocusedDOMCompletionProposalComputer extends DOMCompletionProposalComputer { + + public FocusedDOMCompletionProposalComputer() { + super(); + FocusedCProposalProcessor.getDefault().addMonitoredComputer(this); + } + + @SuppressWarnings("unchecked") + @Override + public List computeCompletionProposals(ContentAssistInvocationContext context, + IProgressMonitor monitor) { + if (shouldReturnResults()) { + List proposals = super.computeCompletionProposals(context, monitor); + return FocusedCProposalProcessor.getDefault().projectInterestModel(this, proposals); + } else { + return Collections.emptyList(); + } + } + + private boolean shouldReturnResults() { + Set disabledIds = CDTContentAssistUtils.getDisableContentAssistIds(CUIPlugin.getDefault() + .getPreferenceStore()); + if (!disabledIds.contains(CDTContentAssistUtils.ASSIST_CDT_TYPE)) { + // do not return duplicates if the default parser completions is enabled + return false; + } + return true; + } + +} diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/editor/ActiveFoldingEditorTracker.java b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/editor/ActiveFoldingEditorTracker.java new file mode 100644 index 0000000..19a321f --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/editor/ActiveFoldingEditorTracker.java @@ -0,0 +1,66 @@ +/******************************************************************************* + * Copyright (c) 2004, 2009 Mylyn project committers and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.eclipse.mylyn.internal.cdt.ui.editor; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.cdt.internal.ui.editor.CEditor; +import org.eclipse.mylyn.monitor.ui.AbstractEditorTracker; +import org.eclipse.ui.IEditorPart; + +/** + * @author Mik Kersten + * @author Jeff Johnston + */ +public class ActiveFoldingEditorTracker extends AbstractEditorTracker { + + protected Map editorListenerMap = new HashMap(); + + @Override + public void editorOpened(IEditorPart part) { + if (part instanceof CEditor) + registerEditor((CEditor) part); + } + + @Override + public void editorClosed(IEditorPart part) { + if (part instanceof CEditor) + unregisterEditor((CEditor) part); + } + + public void registerEditor(final CEditor editor) { + if (editorListenerMap.containsKey(editor)) { + return; + } else { + ActiveFoldingListener listener = new ActiveFoldingListener(editor); + editorListenerMap.put(editor, listener); + } + } + + public void unregisterEditor(CEditor editor) { + ActiveFoldingListener listener = editorListenerMap.get(editor); + if (listener != null) { + listener.dispose(); + } + editorListenerMap.remove(editor); + } + + /** + * For testing. + */ + public Map getEditorListenerMap() { + return editorListenerMap; + } + + @Override + protected void editorBroughtToTop(IEditorPart part) { + // ignore + } + +} diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/editor/ActiveFoldingListener.java b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/editor/ActiveFoldingListener.java new file mode 100644 index 0000000..de5e5c7 --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/editor/ActiveFoldingListener.java @@ -0,0 +1,278 @@ +/******************************************************************************* + * Copyright (c) 2004, 2010 Mylyn project committers and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ + +package org.eclipse.mylyn.internal.cdt.ui.editor; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.cdt.core.model.CModelException; +import org.eclipse.cdt.core.model.ICElement; +import org.eclipse.cdt.core.model.IParent; +import org.eclipse.cdt.core.model.ISourceReference; +import org.eclipse.cdt.core.model.ITranslationUnit; +import org.eclipse.cdt.internal.ui.editor.CEditor; +import org.eclipse.cdt.internal.ui.editor.CSourceViewer; +import org.eclipse.cdt.ui.text.folding.ICFoldingStructureProvider; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.text.Region; +import org.eclipse.jface.text.source.projection.ProjectionViewer; +import org.eclipse.jface.util.IPropertyChangeListener; +import org.eclipse.jface.util.PropertyChangeEvent; +import org.eclipse.mylyn.commons.core.StatusHandler; +import org.eclipse.mylyn.context.core.AbstractContextListener; +import org.eclipse.mylyn.context.core.ContextChangeEvent; +import org.eclipse.mylyn.context.core.ContextCore; +import org.eclipse.mylyn.context.core.IInteractionElement; +import org.eclipse.mylyn.internal.cdt.ui.CDTStructureBridge; +import org.eclipse.mylyn.internal.cdt.ui.CDTUIBridgePlugin; +import org.eclipse.swt.graphics.Point; +import org.eclipse.ui.progress.UIJob; + +/** + * @author Mik Kersten + * @author Jeff Johnston + * @author Shawn Minto + */ +public class ActiveFoldingListener extends AbstractContextListener { + + private final CEditor editor; + + private ICFoldingStructureProvider updater; + + private static CDTStructureBridge bridge = (CDTStructureBridge) ContextCore.getStructureBridge(CDTStructureBridge.CONTENT_TYPE); + + private boolean enabled = false; + + private boolean isDisposed = false; + + private final IPropertyChangeListener PREFERENCE_LISTENER = new IPropertyChangeListener() { + public void propertyChange(PropertyChangeEvent event) { + if (event.getProperty().equals(CDTUIBridgePlugin.AUTO_FOLDING_ENABLED)) { + if (Boolean.parseBoolean(event.getNewValue().toString())) { + enabled = true; + } else { + enabled = false; + } + updateFolding(); + } + } + }; + + public ActiveFoldingListener(CEditor editor) { + this.editor = editor; + ContextCore.getContextManager().addListener(this); + CDTUIBridgePlugin.getDefault().getPreferenceStore().addPropertyChangeListener(PREFERENCE_LISTENER); + + enabled = CDTUIBridgePlugin.getDefault() + .getPreferenceStore() + .getBoolean(CDTUIBridgePlugin.AUTO_FOLDING_ENABLED); + try { + Class clazz = CEditor.class; + Field f = clazz.getDeclaredField("fProjectionModelUpdater"); //$NON-NLS-1$ + f.setAccessible(true); + ICFoldingStructureProvider updater = (ICFoldingStructureProvider) f.get(editor); + if (updater instanceof ICFoldingStructureProvider) { + this.updater = updater; + } else { + StatusHandler.log(new Status(IStatus.ERROR, CDTUIBridgePlugin.ID_PLUGIN, + "Could not install active folding on provider: " + clazz + ", must extend " //$NON-NLS-1$ //$NON-NLS-2$ + + ICFoldingStructureProvider.class.getName())); + } + } catch (Exception e) { + StatusHandler.log(new Status(IStatus.ERROR, CDTUIBridgePlugin.ID_PLUGIN, + "Could not install auto folding, reflection denied", e)); //$NON-NLS-1$ + } + + // XXX Look into this, there must be something else that we can do to handle this case + Job j = new UIJob(Messages.ActiveFoldingListener_Updating_Folding) { + + @Override + public IStatus runInUIThread(IProgressMonitor monitor) { + // need the isDisposed since we do the folding asynchronously and the editor could have been closed + // between the time the job was scheduled and the time it runs + if (!isDisposed) { + updateFolding(); + } + return Status.OK_STATUS; + } + + }; + j.schedule(1000); + } + + public void dispose() { + isDisposed = true; + ContextCore.getContextManager().removeListener(this); + CDTUIBridgePlugin.getDefault().getPreferenceStore().removePropertyChangeListener(PREFERENCE_LISTENER); + } + + public void updateFolding() { + if (!enabled || !ContextCore.getContextManager().isContextActive()) { + editor.resetProjection(); + } else if (editor.getEditorInput() == null) { + return; + } else { + try { + List toExpand = new ArrayList(); + List toCollapse = new ArrayList(); + + ICElement element = editor.getInputCElement(); + if (element instanceof ITranslationUnit) { + ITranslationUnit compilationUnit = (ITranslationUnit) element; + List allChildren = getAllChildren(compilationUnit); + for (ICElement child : allChildren) { + IInteractionElement interactionElement = ContextCore.getContextManager().getElement( + bridge.getHandleIdentifier(child)); + if (interactionElement != null && interactionElement.getInterest().isInteresting()) { + toExpand.add(child); + } else { + toCollapse.add(child); + } + } + } + if (updater != null) { + collapseAllElements(); + Point selectedRange = editor.getViewer().getSelectedRange(); + expandElements(toExpand.toArray(new ICElement[toExpand.size()])); + editor.getViewer().setSelectedRange(selectedRange.x, selectedRange.y); + editor.getViewer().revealRange(selectedRange.x, selectedRange.y); + } + } catch (Exception e) { + StatusHandler.log(new Status(IStatus.ERROR, CDTUIBridgePlugin.ID_PLUGIN, "Could not update folding", e)); //$NON-NLS-1$ + } + } + } + + protected void collapseElements(ICElement[] elements) { + for (int i = 0; i < elements.length; ++i) { + collapse(elements[i]); + } + } + + private void collapseAllElements() { + CSourceViewer viewer = (CSourceViewer) editor.getViewer(); + if (viewer != null) { + viewer.doOperation(ProjectionViewer.COLLAPSE_ALL); + } + } + + private void collapse(ICElement element) { + // FIXME we do not support collapse right now +// CSourceViewer viewer = (CSourceViewer) editor.getViewer(); +// editor.setSelection(element); +// viewer.doOperation(ProjectionViewer.COLLAPSE); + } + + protected void expandElements(ICElement[] elements) { + for (int i = 0; i < elements.length; ++i) { + expand(elements[i]); + } + } + + private void expand(ICElement element) { + CSourceViewer viewer = (CSourceViewer) editor.getViewer(); + if (element instanceof ISourceReference && !(element instanceof ITranslationUnit)) { + ISourceReference reference = (ISourceReference) element; + + try { + viewer.exposeModelRange(new Region(reference.getSourceRange().getIdStartPos(), 0)); + } catch (CModelException e) { + // ignore failures + } + + // makes things jump around +// editor.setSelection(element); +// viewer.doOperation(ProjectionViewer.EXPAND); + } + } + + private static List getAllChildren(IParent parentElement) { + List allChildren = new ArrayList(); + try { + for (ICElement child : parentElement.getChildren()) { + allChildren.add(child); + if (child instanceof IParent) { + allChildren.addAll(getAllChildren((IParent) child)); + } + } + } catch (CModelException e) { + // ignore failures + } + return allChildren; + } + + public void updateFolding(List elements) { + try { + for (IInteractionElement element : elements) { + if (updater == null || !enabled) { + return; + } else { + Object object = bridge.getObjectForHandle(element.getHandleIdentifier()); + if (object instanceof ICElement) { + ICElement member = (ICElement) object; + if (element.getInterest().isInteresting()) { + expandElements(new ICElement[] { member }); + // expand the next 2 children down (e.g. anonymous types) + if (!(member instanceof IParent)) { + return; + } + ICElement[] children = ((IParent) member).getChildren(); + if (children.length == 1) { + expandElements(new ICElement[] { children[0] }); + if (children[0] instanceof IParent) { + ICElement[] childsChildren = ((IParent) children[0]).getChildren(); + if (childsChildren.length == 1) { + expandElements(new ICElement[] { childsChildren[0] }); + } + } + } + } else { + collapseElements(new ICElement[] { member }); + } + } + } + } + } catch (Exception e) { + // ignore elements that we can't resolve + } + } + + @Override + public void contextChanged(ContextChangeEvent event) { + switch (event.getEventKind()) { + case ACTIVATED: + case DEACTIVATED: + if (CDTUIBridgePlugin.getDefault().getPreferenceStore().getBoolean(CDTUIBridgePlugin.AUTO_FOLDING_ENABLED)) { + updateFolding(); + } + break; + case CLEARED: + if (event.isActiveContext()) { + if (CDTUIBridgePlugin.getDefault() + .getPreferenceStore() + .getBoolean(CDTUIBridgePlugin.AUTO_FOLDING_ENABLED)) { + updateFolding(); + } + } + break; + case INTEREST_CHANGED: + updateFolding(event.getElements()); + break; + } + } + + public static void resetProjection(CEditor editor2) { + // ignore + + } +} diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/editor/Messages.java b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/editor/Messages.java new file mode 100644 index 0000000..2be5502 --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/editor/Messages.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2009 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.internal.cdt.ui.editor; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.cdt.ui.editor.messages"; //$NON-NLS-1$ + + public static String ActiveFoldingListener_Updating_Folding; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/editor/messages.properties b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/editor/messages.properties new file mode 100644 index 0000000..afafeac --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/editor/messages.properties @@ -0,0 +1,11 @@ +############################################################################### +# Copyright (c) 2010 Tasktop Technologies and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Tasktop Technologies - initial API and implementation +############################################################################### +ActiveFoldingListener_Updating_Folding=Updating folding diff --git a/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/messages.properties b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/messages.properties new file mode 100644 index 0000000..946cc3f --- /dev/null +++ b/org.eclipse.cdt.mylyn.ui/src/org/eclipse/mylyn/internal/cdt/ui/messages.properties @@ -0,0 +1,14 @@ +############################################################################### +# Copyright (c) 2010 Tasktop Technologies and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Tasktop Technologies - initial API and implementation +############################################################################### +CDTContextLabelProvider_Missing_Element= +CDTContextLabelProvider_Containment=Containment +CDTUIBridgePlugin_Initializing_Content_Assist=Initializing Focused CDT Content Assist +LandmarkMarkerManager_Mylyn_Landmark=Mylyn Landmark diff --git a/org.eclipse.cdt.mylyn/.project b/org.eclipse.cdt.mylyn/.project new file mode 100644 index 0000000..94ebbb0 --- /dev/null +++ b/org.eclipse.cdt.mylyn/.project @@ -0,0 +1,17 @@ + + + org.eclipse.cdt.mylyn + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + diff --git a/org.eclipse.cdt.mylyn/build.properties b/org.eclipse.cdt.mylyn/build.properties new file mode 100644 index 0000000..694321c --- /dev/null +++ b/org.eclipse.cdt.mylyn/build.properties @@ -0,0 +1,4 @@ +bin.includes = epl-v10.html,\ + feature.properties,\ + feature.xml,\ + license.html diff --git a/org.eclipse.cdt.mylyn/epl-v10.html b/org.eclipse.cdt.mylyn/epl-v10.html new file mode 100644 index 0000000..ed4b196 --- /dev/null +++ b/org.eclipse.cdt.mylyn/epl-v10.html @@ -0,0 +1,328 @@ + + + + + + + + +Eclipse Public License - Version 1.0 + + + + + + +
+ +

Eclipse Public License - v 1.0 +

+ +

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.

+ +

1. DEFINITIONS

+ +

"Contribution" means:

+ +

a) +in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and
+b) in the case of each subsequent Contributor:

+ +

i) +changes to the Program, and

+ +

ii) +additions to the Program;

+ +

where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program.

+ +

"Contributor" means any person or +entity that distributes the Program.

+ +

"Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program.

+ +

"Program" means the Contributions +distributed in accordance with this Agreement.

+ +

"Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.

+ +

2. GRANT OF RIGHTS

+ +

a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.

+ +

b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide, royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder.

+ +

c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.

+ +

d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement.

+ +

3. REQUIREMENTS

+ +

A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that: +

+ +

a) +it complies with the terms and conditions of this Agreement; and

+ +

b) +its license agreement:

+ +

i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose;

+ +

ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits;

+ +

iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and

+ +

iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.

+ +

When the Program is made available in source +code form:

+ +

a) +it must be made available under this Agreement; and

+ +

b) a +copy of this Agreement must be included with each copy of the Program.

+ +

Contributors may not remove or alter any +copyright notices contained within the Program.

+ +

Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution.

+ +

4. COMMERCIAL DISTRIBUTION

+ +

Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.

+ +

For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.

+ +

5. NO WARRANTY

+ +

EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations.

+ +

6. DISCLAIMER OF LIABILITY

+ +

EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.

+ +

7. GENERAL

+ +

If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.

+ +

If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed.

+ +

All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive.

+ +

Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.

+ +

This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.

+ +

 

+ +
+ + + + \ No newline at end of file diff --git a/org.eclipse.cdt.mylyn/feature.properties b/org.eclipse.cdt.mylyn/feature.properties new file mode 100644 index 0000000..708cd80 --- /dev/null +++ b/org.eclipse.cdt.mylyn/feature.properties @@ -0,0 +1,139 @@ +############################################################################### +# Copyright (c) 2009, 2010 Tasktop Technologies and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Tasktop Technologies - initial API and implementation +############################################################################### +featureName=Mylyn Context Connector: C/C++ Development +description=NOTE: Installs CDT if not present. Mylyn Task-Focused UI extensions for CDT. Provides focusing of C/C++ element views and editors. +providerName=Eclipse Mylyn +copyright=Copyright (c) 2009, 2012 Tasktop Technologies and others. All rights reserved. + +license=\ +Eclipse Foundation Software User Agreement\n\ +February 1, 2011\n\ +\n\ +Usage Of Content\n\ +\n\ +THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ +OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ +USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ +AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ +NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ +AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ +AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ +OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ +TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ +OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ +BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ +\n\ +Applicable Licenses\n\ +\n\ +Unless otherwise indicated, all Content made available by the\n\ +Eclipse Foundation is provided to you under the terms and conditions of\n\ +the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\ +provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ +For purposes of the EPL, "Program" will mean the Content.\n\ +\n\ +Content includes, but is not limited to, source code, object code,\n\ +documentation and other files maintained in the Eclipse Foundation source code\n\ +repository ("Repository") in software modules ("Modules") and made available\n\ +as downloadable archives ("Downloads").\n\ +\n\ + - Content may be structured and packaged into modules to facilitate delivering,\n\ + extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ + plug-in fragments ("Fragments"), and features ("Features").\n\ + - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\ + in a directory named "plugins".\n\ + - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ + Each Feature may be packaged as a sub-directory in a directory named "features".\n\ + Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ + numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ + - Features may also include other Features ("Included Features"). Within a Feature, files\n\ + named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ +\n\ +The terms and conditions governing Plug-ins and Fragments should be\n\ +contained in files named "about.html" ("Abouts"). The terms and\n\ +conditions governing Features and Included Features should be contained\n\ +in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ +Licenses may be located in any directory of a Download or Module\n\ +including, but not limited to the following locations:\n\ +\n\ + - The top-level (root) directory\n\ + - Plug-in and Fragment directories\n\ + - Inside Plug-ins and Fragments packaged as JARs\n\ + - Sub-directories of the directory named "src" of certain Plug-ins\n\ + - Feature directories\n\ +\n\ +Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ +Provisioning Technology (as defined below), you must agree to a license ("Feature \n\ +Update License") during the installation process. If the Feature contains\n\ +Included Features, the Feature Update License should either provide you\n\ +with the terms and conditions governing the Included Features or inform\n\ +you where you can locate them. Feature Update Licenses may be found in\n\ +the "license" property of files named "feature.properties" found within a Feature.\n\ +Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\ +terms and conditions (or references to such terms and conditions) that\n\ +govern your use of the associated Content in that directory.\n\ +\n\ +THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\ +TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ +SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ +\n\ + - Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\ + - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ + - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ + - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ + - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\ + - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ +\n\ +IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ +TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\ +is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ +govern that particular Content.\n\ +\n\ +\n\Use of Provisioning Technology\n\ +\n\ +The Eclipse Foundation makes available provisioning software, examples of which include,\n\ +but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\ +the purpose of allowing users to install software, documentation, information and/or\n\ +other materials (collectively "Installable Software"). This capability is provided with\n\ +the intent of allowing such users to install, extend and update Eclipse-based products.\n\ +Information about packaging Installable Software is available at\n\ +http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\ +\n\ +You may use Provisioning Technology to allow other parties to install Installable Software.\n\ +You shall be responsible for enabling the applicable license agreements relating to the\n\ +Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\ +in accordance with the Specification. By using Provisioning Technology in such a manner and\n\ +making it available in accordance with the Specification, you further acknowledge your\n\ +agreement to, and the acquisition of all necessary rights to permit the following:\n\ +\n\ + 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\ + the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\ + extending or updating the functionality of an Eclipse-based product.\n\ + 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\ + Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\ + 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\ + govern the use of the Installable Software ("Installable Software Agreement") and such\n\ + Installable Software Agreement shall be accessed from the Target Machine in accordance\n\ + with the Specification. Such Installable Software Agreement must inform the user of the\n\ + terms and conditions that govern the Installable Software and must solicit acceptance by\n\ + the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\ + indication of agreement by the user, the provisioning Technology will complete installation\n\ + of the Installable Software.\n\ +\n\ +Cryptography\n\ +\n\ +Content may contain encryption software. The country in which you are\n\ +currently may have restrictions on the import, possession, and use,\n\ +and/or re-export to another country, of encryption software. BEFORE\n\ +using any encryption software, please check the country's laws,\n\ +regulations and policies concerning the import, possession, or use, and\n\ +re-export of encryption software, to see if this is permitted.\n\ +\n\ +Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n diff --git a/org.eclipse.cdt.mylyn/feature.xml b/org.eclipse.cdt.mylyn/feature.xml new file mode 100644 index 0000000..b8432ab --- /dev/null +++ b/org.eclipse.cdt.mylyn/feature.xml @@ -0,0 +1,43 @@ + + + + + + %description + + + + %copyright + + + + %license + + + + + + + + + + diff --git a/org.eclipse.cdt.mylyn/license.html b/org.eclipse.cdt.mylyn/license.html new file mode 100644 index 0000000..f19c483 --- /dev/null +++ b/org.eclipse.cdt.mylyn/license.html @@ -0,0 +1,108 @@ + + + + + +Eclipse Foundation Software User Agreement + + + +

Eclipse Foundation Software User Agreement

+

February 1, 2011

+ +

Usage Of Content

+ +

THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS + (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND + CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE + OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR + NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND + CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.

+ +

Applicable Licenses

+ +

Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 + ("EPL"). A copy of the EPL is provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html. + For purposes of the EPL, "Program" will mean the Content.

+ +

Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code + repository ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").

+ +
    +
  • Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").
  • +
  • Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".
  • +
  • A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins + and/or Fragments associated with that Feature.
  • +
  • Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.
  • +
+ +

The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and +Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module +including, but not limited to the following locations:

+ +
    +
  • The top-level (root) directory
  • +
  • Plug-in and Fragment directories
  • +
  • Inside Plug-ins and Fragments packaged as JARs
  • +
  • Sub-directories of the directory named "src" of certain Plug-ins
  • +
  • Feature directories
  • +
+ +

Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license ("Feature Update License") during the +installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or +inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature. +Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in +that directory.

+ +

THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE +OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):

+ + + +

IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please +contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.

+ + +

Use of Provisioning Technology

+ +

The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse + Update Manager ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or + other materials (collectively "Installable Software"). This capability is provided with the intent of allowing such users to + install, extend and update Eclipse-based products. Information about packaging Installable Software is available at http://eclipse.org/equinox/p2/repository_packaging.html + ("Specification").

+ +

You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the + applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology + in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the + Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:

+ +
    +
  1. A series of actions may occur ("Provisioning Process") in which a user may execute the Provisioning Technology + on a machine ("Target Machine") with the intent of installing, extending or updating the functionality of an Eclipse-based + product.
  2. +
  3. During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be + accessed and copied to the Target Machine.
  4. +
  5. Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable + Software ("Installable Software Agreement") and such Installable Software Agreement shall be accessed from the Target + Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern + the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such + indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.
  6. +
+ +

Cryptography

+ +

Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to + another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, + possession, or use, and re-export of encryption software, to see if this is permitted.

+ +

Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.

+ + diff --git a/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginResources.properties b/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginResources.properties index 8e36699..ef471dd 100644 --- a/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginResources.properties +++ b/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginResources.properties @@ -129,7 +129,7 @@ MngCCWizardSettings.description=Define the Managed Make C++ build settings. CProjectWizard.op_error.title=Error Creating Project CProjectWizard.op_error.message=Project cannot be created -CProjectWizard.op_description=C Project Wizard +CProjectWizard.op_description=Native Project Wizard CProjectWizard.windowTitle=New Project CProjectWizard.description=C Project Wizard CProjectWizard.title=C Project Wizard diff --git a/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CDocBrowserInformationControl.java b/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CDocBrowserInformationControl.java new file mode 100644 index 0000000..7123832 --- /dev/null +++ b/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CDocBrowserInformationControl.java @@ -0,0 +1,596 @@ +package org.eclipse.cdt.internal.ui.text.c.hover; + +import java.io.IOException; +import java.io.StringReader; +import java.util.Iterator; + +import org.eclipse.cdt.ui.CUIPreferenceInitializer; +import org.eclipse.core.runtime.Assert; +import org.eclipse.core.runtime.ListenerList; +import org.eclipse.jface.action.ToolBarManager; +import org.eclipse.jface.internal.text.html.BrowserInformationControlInput; +import org.eclipse.jface.internal.text.html.HTML2TextReader; +import org.eclipse.jface.internal.text.html.HTMLPrinter; +import org.eclipse.jface.resource.JFaceResources; +import org.eclipse.jface.text.AbstractInformationControl; +import org.eclipse.jface.text.IDelayedInputChangeProvider; +import org.eclipse.jface.text.IInformationControlExtension2; +import org.eclipse.jface.text.IInputChangedListener; +import org.eclipse.jface.text.TextPresentation; +import org.eclipse.swt.SWT; +import org.eclipse.swt.SWTError; +import org.eclipse.swt.browser.Browser; +import org.eclipse.swt.browser.LocationListener; +import org.eclipse.swt.browser.OpenWindowListener; +import org.eclipse.swt.browser.ProgressAdapter; +import org.eclipse.swt.browser.ProgressEvent; +import org.eclipse.swt.browser.WindowEvent; +import org.eclipse.swt.custom.StyleRange; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.graphics.GC; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.graphics.TextLayout; +import org.eclipse.swt.graphics.TextStyle; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Slider; + +/** + * Displays doxygen HTML information. + */ +public class CDocBrowserInformationControl extends AbstractInformationControl implements + IInformationControlExtension2, IDelayedInputChangeProvider { + + /** + * Tells whether the SWT Browser widget and hence this information + * control is available. + * + * @param parent the parent component used for checking or null if none + * @return true if this control is available + */ + public static boolean isAvailable(Composite parent) { + if (!fgAvailabilityChecked) { + try { + Browser browser= new Browser(parent, SWT.NONE); + browser.dispose(); + fgIsAvailable= true; + + Slider sliderV= new Slider(parent, SWT.VERTICAL); + Slider sliderH= new Slider(parent, SWT.HORIZONTAL); + int width= sliderV.computeSize(SWT.DEFAULT, SWT.DEFAULT).x; + int height= sliderH.computeSize(SWT.DEFAULT, SWT.DEFAULT).y; + fgScrollBarSize= new Point(width, height); + sliderV.dispose(); + sliderH.dispose(); + } catch (SWTError er) { + fgIsAvailable= false; + } finally { + fgAvailabilityChecked= true; + } + } + + return fgIsAvailable; + } + + /** + * Minimal size constraints. + * @since 3.2 + */ + private static final int MIN_WIDTH= 80; + + private static final int MIN_HEIGHT= 50; + + + /** + * Availability checking cache. + */ + private static boolean fgIsAvailable= false; + + private static boolean fgAvailabilityChecked= false; + + /** + * Cached scroll bar width and height + * @since 3.4 + */ + private static Point fgScrollBarSize; + + /** The control's browser widget */ + private Browser fBrowser; + + /** Tells whether the browser has content */ + private boolean fBrowserHasContent; + + /** Text layout used to approximate size of content when rendered in browser */ + private TextLayout fTextLayout; + + /** Bold text style */ + private TextStyle fBoldStyle; + + private BrowserInformationControlInput fInput; + + /** + * true iff the browser has completed loading of the last + * input set via {@link #setInformation(String)}. + * @since 3.4 + */ + private boolean fCompleted= false; + + /** + * The listener to be notified when a delayed location changing event happened. + * @since 3.4 + */ + private IInputChangedListener fDelayedInputChangeListener; + + /** + * The listeners to be notified when the input changed. + * @since 3.4 + */ + private ListenerList/**/fInputChangeListeners= new ListenerList(ListenerList.IDENTITY); + + /** + * The symbolic name of the font used for size computations, or null to use dialog font. + * @since 3.4 + */ + private final String fSymbolicFontName; + + + /** + * Creates a browser information control with the given shell as parent. + * + * @param parent the parent shell + * @param symbolicFontName the symbolic name of the font used for size computations + * @param resizable true if the control should be resizable + * @since 3.4 + */ + public CDocBrowserInformationControl(Shell parent, String symbolicFontName, boolean resizable) { + super(parent, resizable); + fSymbolicFontName= symbolicFontName; + create(); + } + + /** + * Creates a browser information control with the given shell as parent. + * + * @param parent the parent shell + * @param symbolicFontName the symbolic name of the font used for size computations + * @param statusFieldText the text to be used in the optional status field + * or null if the status field should be hidden + * @since 3.4 + */ + public CDocBrowserInformationControl(Shell parent, String symbolicFontName, String statusFieldText) { + super(parent, statusFieldText); + fSymbolicFontName= symbolicFontName; + create(); + } + + /** + * Creates a browser information control with the given shell as parent. + * + * @param parent the parent shell + * @param symbolicFontName the symbolic name of the font used for size computations + * @param toolBarManager the manager or null if toolbar is not desired + * @since 3.4 + */ + public CDocBrowserInformationControl(Shell parent, String symbolicFontName, ToolBarManager toolBarManager) { + super(parent, toolBarManager); + fSymbolicFontName= symbolicFontName; + create(); + } + + /* + * @see org.eclipse.jface.text.AbstractInformationControl#createContent(org.eclipse.swt.widgets.Composite) + */ + protected void createContent(Composite parent) { + fBrowser= new Browser(parent, SWT.NONE); + fBrowser.setJavascriptEnabled(false); + + Display display= getShell().getDisplay(); + fBrowser.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND)); + fBrowser.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND)); + + fBrowser.addProgressListener(new ProgressAdapter() { + public void completed(ProgressEvent event) { + fCompleted= true; + } + }); + + fBrowser.addOpenWindowListener(new OpenWindowListener() { + public void open(WindowEvent event) { + event.required= true; // Cancel opening of new windows + } + }); + + // Replace browser's built-in context menu with none + fBrowser.setMenu(new Menu(getShell(), SWT.NONE)); + + createTextLayout(); + } + + /** + * {@inheritDoc} + * @deprecated use {@link #setInput(Object)} + */ + public void setInformation(final String content) { + setInput(new BrowserInformationControlInput(null) { + public String getHtml() { + return content; + } + + public String getInputName() { + return ""; //$NON-NLS-1$ + } + + public Object getInputElement() { + return content; + } + }); + } + + /** + * {@inheritDoc} This control can handle {@link String} and + * {@link BrowserInformationControlInput}. + */ + public void setInput(Object input) { + Assert.isLegal(input == null || input instanceof String || input instanceof BrowserInformationControlInput); + + if (input instanceof String) { + setInformation((String)input); + return; + } + + fInput= (BrowserInformationControlInput)input; + + String content= null; + if (fInput != null) + content= fInput.getHtml(); + + fBrowserHasContent= content != null && content.length() > 0; + + if (!fBrowserHasContent) + content= ""; //$NON-NLS-1$ + + boolean RTL= (getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0; + boolean resizable= isResizable(); + + // The default "overflow:auto" would not result in a predictable width for the client area + // and the re-wrapping would cause visual noise + String[] styles= null; + if (RTL && resizable) + styles= new String[] { "direction:rtl;", "overflow:scroll;", "word-wrap:break-word;" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + else if (RTL && !resizable) + styles= new String[] { "direction:rtl;", "overflow:hidden;", "word-wrap:break-word;" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + else if (!resizable) + //XXX: In IE, "word-wrap: break-word;" causes bogus wrapping even in non-broken words :-(see e.g. Javadoc of String). + // Re-check whether we really still need this now that the Javadoc Hover header already sets this style. + styles= new String[] { "overflow:hidden;"/*, "word-wrap: break-word;"*/}; //$NON-NLS-1$ + else + styles= new String[] { "overflow:scroll;" }; //$NON-NLS-1$ + + StringBuffer buffer= new StringBuffer(content); + HTMLPrinter.insertStyles(buffer, styles); + content= buffer.toString(); + + /* + * XXX: Should add some JavaScript here that shows something like + * "(continued...)" or "..." at the end of the visible area when the page overflowed + * with "overflow:hidden;". + */ + + fCompleted= false; + if (!content.contains(".html")) { + return; + } + String url = CUIPreferenceInitializer.doxygenDirectoryPath + "/" + content; + CElementLinks.isSet = 1; + fBrowser.setUrl(url); + + Object[] listeners= fInputChangeListeners.getListeners(); + for (int i= 0; i < listeners.length; i++) + ((IInputChangedListener)listeners[i]).inputChanged(fInput); + } + + /* + * @see IInformationControl#setVisible(boolean) + */ + public void setVisible(boolean visible) { + Shell shell= getShell(); + if (shell.isVisible() == visible) + return; + + if (!visible) { + super.setVisible(false); + setInput(null); + return; + } + + /* + * The Browser widget flickers when made visible while it is not completely loaded. + * The fix is to delay the call to setVisible until either loading is completed + * (see ProgressListener in constructor), or a timeout has been reached. + */ + final Display display= shell.getDisplay(); + + // Make sure the display wakes from sleep after timeout: + display.timerExec(100, new Runnable() { + public void run() { + fCompleted= true; + } + }); + + while (!fCompleted) { + // Drive the event loop to process the events required to load the browser widget's contents: + if (!display.readAndDispatch()) { + display.sleep(); + } + } + + shell= getShell(); + if (shell == null || shell.isDisposed()) + return; + + /* + * Avoids flickering when replacing hovers, especially on Vista in ON_CLICK mode. + * Causes flickering on GTK. Carbon does not care. + */ + if ("win32".equals(SWT.getPlatform())) //$NON-NLS-1$ + shell.moveAbove(null); + + super.setVisible(true); + } + + /* + * @see org.eclipse.jface.text.AbstractInformationControl#setSize(int, int) + */ + public void setSize(int width, int height) { + fBrowser.setRedraw(false); // avoid flickering + try { + //super.setSize(width, height); + super.setSize(750, 300); // TODO Modify + } finally { + fBrowser.setRedraw(true); + } + } + + /** + * Creates and initializes the text layout used + * to compute the size hint. + * + * @since 3.2 + */ + private void createTextLayout() { + fTextLayout= new TextLayout(fBrowser.getDisplay()); + + // Initialize fonts + String symbolicFontName= fSymbolicFontName == null ? JFaceResources.DIALOG_FONT : fSymbolicFontName; + Font font= JFaceResources.getFont(symbolicFontName); + fTextLayout.setFont(font); + fTextLayout.setWidth(-1); + font= JFaceResources.getFontRegistry().getBold(symbolicFontName); + fBoldStyle= new TextStyle(font, null, null); + + // Compute and set tab width + fTextLayout.setText(" "); //$NON-NLS-1$ + int tabWidth= fTextLayout.getBounds().width; + fTextLayout.setTabs(new int[] { tabWidth }); + fTextLayout.setText(""); //$NON-NLS-1$ + } + + /* + * @see org.eclipse.jface.text.AbstractInformationControl#handleDispose() + * @since 3.6 + */ + protected void handleDispose() { + if (fTextLayout != null) { + fTextLayout.dispose(); + fTextLayout= null; + } + fBrowser= null; + + super.handleDispose(); + } + + /* + * @see IInformationControl#computeSizeHint() + */ + public Point computeSizeHint() { + Point sizeConstraints= getSizeConstraints(); + Rectangle trim= computeTrim(); + int height= trim.height; + + //FIXME: The HTML2TextReader does not render

like a browser. + // Instead of inserting an empty line, it just adds a single line break. + // Furthermore, the indentation of

elements is too small (e.g with a long @see line) + TextPresentation presentation= new TextPresentation(); + HTML2TextReader reader= new HTML2TextReader(new StringReader(fInput.getHtml()), presentation); + String text; + try { + text= reader.getString(); + } catch (IOException e) { + text= ""; //$NON-NLS-1$ + } + + fTextLayout.setText(text); + fTextLayout.setWidth(sizeConstraints == null ? SWT.DEFAULT : sizeConstraints.x - trim.width); + Iterator iter= presentation.getAllStyleRangeIterator(); + while (iter.hasNext()) { + StyleRange sr= (StyleRange)iter.next(); + if (sr.fontStyle == SWT.BOLD) + fTextLayout.setStyle(fBoldStyle, sr.start, sr.start + sr.length - 1); + } + + Rectangle bounds= fTextLayout.getBounds(); // does not return minimum width, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=217446 + int lineCount= fTextLayout.getLineCount(); + int textWidth= 0; + for (int i= 0; i < lineCount; i++) { + Rectangle rect= fTextLayout.getLineBounds(i); + int lineWidth= rect.x + rect.width; + if (i == 0) + lineWidth+= fInput.getLeadingImageWidth(); + textWidth= Math.max(textWidth, lineWidth); + } + bounds.width= textWidth; + fTextLayout.setText(""); //$NON-NLS-1$ + + int minWidth= bounds.width; + height= height + bounds.height; + + // Add some air to accommodate for different browser renderings + minWidth+= 15; + height+= 15; + + + // Apply max size constraints + if (sizeConstraints != null) { + if (sizeConstraints.x != SWT.DEFAULT) + minWidth= Math.min(sizeConstraints.x, minWidth + trim.width); + if (sizeConstraints.y != SWT.DEFAULT) + height= Math.min(sizeConstraints.y, height); + } + + // Ensure minimal size + int width= Math.max(MIN_WIDTH, minWidth); + height= Math.max(MIN_HEIGHT, height); + + return new Point(width, height); + } + + /* + * @see org.eclipse.jface.text.IInformationControlExtension3#computeTrim() + */ + public Rectangle computeTrim() { + Rectangle trim= super.computeTrim(); + if (isResizable()) { + boolean RTL= (getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0; + if (RTL) { + trim.x-= fgScrollBarSize.x; + } + trim.width+= fgScrollBarSize.x; + trim.height+= fgScrollBarSize.y; + } + return trim; + } + + /** + * Adds the listener to the collection of listeners who will be + * notified when the current location has changed or is about to change. + * + * @param listener the location listener + * @since 3.4 + */ + public void addLocationListener(LocationListener listener) { + fBrowser.addLocationListener(listener); + } + + /* + * @see IInformationControl#setForegroundColor(Color) + */ + public void setForegroundColor(Color foreground) { + super.setForegroundColor(foreground); + fBrowser.setForeground(foreground); + } + + /* + * @see IInformationControl#setBackgroundColor(Color) + */ + public void setBackgroundColor(Color background) { + super.setBackgroundColor(background); + fBrowser.setBackground(background); + } + + /* + * @see IInformationControlExtension#hasContents() + */ + public boolean hasContents() { + return fBrowserHasContent; + } + + /** + * Adds a listener for input changes to this input change provider. + * Has no effect if an identical listener is already registered. + * + * @param inputChangeListener the listener to add + * @since 3.4 + */ + public void addInputChangeListener(IInputChangedListener inputChangeListener) { + Assert.isNotNull(inputChangeListener); + fInputChangeListeners.add(inputChangeListener); + } + + /** + * Removes the given input change listener from this input change provider. + * Has no effect if an identical listener is not registered. + * + * @param inputChangeListener the listener to remove + * @since 3.4 + */ + public void removeInputChangeListener(IInputChangedListener inputChangeListener) { + fInputChangeListeners.remove(inputChangeListener); + } + + /* + * @see org.eclipse.jface.text.IDelayedInputChangeProvider#setDelayedInputChangeListener(org.eclipse.jface.text.IInputChangedListener) + * @since 3.4 + */ + public void setDelayedInputChangeListener(IInputChangedListener inputChangeListener) { + fDelayedInputChangeListener= inputChangeListener; + } + + /** + * Tells whether a delayed input change listener is registered. + * + * @return true iff a delayed input change + * listener is currently registered + * @since 3.4 + */ + public boolean hasDelayedInputChangeListener() { + return fDelayedInputChangeListener != null; + } + + /** + * Notifies listeners of a delayed input change. + * + * @param newInput the new input, or null to request cancellation + * @since 3.4 + */ + public void notifyDelayedInputChange(Object newInput) { + if (fDelayedInputChangeListener != null) + fDelayedInputChangeListener.inputChanged(newInput); + } + + /* + * @see java.lang.Object#toString() + * @since 3.4 + */ + public String toString() { + String style= (getShell().getStyle() & SWT.RESIZE) == 0 ? "fixed" : "resizeable"; //$NON-NLS-1$ //$NON-NLS-2$ + return super.toString() + " - style: " + style; //$NON-NLS-1$ + } + + /** + * @return the current browser input or null + */ + public BrowserInformationControlInput getInput() { + return fInput; + } + + /* + * @see org.eclipse.jface.text.IInformationControlExtension5#computeSizeConstraints(int, int) + */ + public Point computeSizeConstraints(int widthInChars, int heightInChars) { + if (fSymbolicFontName == null) + return null; + + GC gc= new GC(fBrowser); + Font font= fSymbolicFontName == null ? JFaceResources.getDialogFont() : JFaceResources.getFont(fSymbolicFontName); + gc.setFont(font); + int width= gc.getFontMetrics().getAverageCharWidth(); + int height= gc.getFontMetrics().getHeight(); + gc.dispose(); + + return new Point(widthInChars * width, heightInChars * height); + } +} diff --git a/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CDocBrowserInformationControlInput.java b/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CDocBrowserInformationControlInput.java new file mode 100644 index 0000000..3305a84 --- /dev/null +++ b/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CDocBrowserInformationControlInput.java @@ -0,0 +1,66 @@ +package org.eclipse.cdt.internal.ui.text.c.hover; + +import org.eclipse.core.runtime.Assert; +import org.eclipse.jface.internal.text.html.BrowserInformationControlInput; + +/** + * Provides input for CDocBrowserInformationControl. + */ +public class CDocBrowserInformationControlInput extends BrowserInformationControlInput { + private final String fElement; + private final String fHtml; + private final int fLeadingImageWidth; + + /** + * Creates a new browser information control input. + * + * @param previous previous input, or null if none available + * @param element the element, or null if none available + * @param html HTML contents, must not be null + * @param leadingImageWidth the indent required for the element image + */ + public CDocBrowserInformationControlInput(CDocBrowserInformationControlInput previous, String element, String html, int leadingImageWidth) { + super(previous); + Assert.isNotNull(html); + fElement= element; + fHtml= html; + fLeadingImageWidth= leadingImageWidth; + } + + /* + * @see org.eclipse.jface.internal.text.html.BrowserInformationControlInput#getLeadingImageWidth() + * @since 3.4 + */ + public int getLeadingImageWidth() { + return fLeadingImageWidth; + } + + /** + * Returns the Java element. + * + * @return the element or null if none available + */ + public String getElement() { + return fElement; + } + + @Override + public String getHtml() { + // TODO Auto-generated method stub + return fHtml; + } + + @Override + public Object getInputElement() { + // TODO Auto-generated method stub + return fElement == null ? (Object) fHtml : fElement; + } + + @Override + public String getInputName() { + // TODO Auto-generated method stub + //return fElement == null ? "" : fElement.getElementName(); //$NON-NLS-1$ + return fElement == null ? "" : fElement; + } + +} diff --git a/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CDocHover.java b/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CDocHover.java index e912220..34dc834 100644 --- a/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CDocHover.java +++ b/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CDocHover.java @@ -11,33 +11,992 @@ *******************************************************************************/ package org.eclipse.cdt.internal.ui.text.c.hover; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.util.Set; +import java.util.StringTokenizer; +import org.eclipse.cdt.core.dom.ast.DOMException; +import org.eclipse.cdt.core.dom.ast.IASTName; +import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; +import org.eclipse.cdt.core.dom.ast.IBinding; +import org.eclipse.cdt.core.model.CModelException; +import org.eclipse.cdt.core.model.ILanguage; +import org.eclipse.cdt.core.model.ITranslationUnit; +import org.eclipse.cdt.core.model.IWorkingCopy; +import org.eclipse.cdt.core.parser.KeywordSetKey; +import org.eclipse.cdt.core.parser.ParserFactory; +import org.eclipse.cdt.core.parser.ParserLanguage; +import org.eclipse.cdt.internal.core.model.ASTCache.ASTRunnable; +import org.eclipse.cdt.internal.corext.util.Strings; +import org.eclipse.cdt.internal.ui.CHelpProviderManager; +import org.eclipse.cdt.internal.ui.editor.ASTProvider; +import org.eclipse.cdt.internal.ui.editor.CEditorMessages; +import org.eclipse.cdt.internal.ui.text.CWordFinder; +import org.eclipse.cdt.internal.ui.text.HTMLPrinter; +import org.eclipse.cdt.ui.CUIPlugin; +import org.eclipse.cdt.ui.CUIPreferenceInitializer; +import org.eclipse.cdt.ui.IFunctionSummary; +import org.eclipse.cdt.ui.IFunctionSummary.IFunctionPrototypeSummary; +import org.eclipse.cdt.ui.IRequiredInclude; +import org.eclipse.cdt.ui.IWorkingCopyManager; +import org.eclipse.cdt.ui.PreferenceConstants; +import org.eclipse.cdt.ui.text.ICHelpInvocationContext; +import org.eclipse.cdt.ui.text.IHoverHelpInvocationContext; import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.ISchedulingRule; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.ToolBarManager; +import org.eclipse.jface.internal.text.html.BrowserInformationControlInput; +import org.eclipse.jface.internal.text.html.BrowserInput; +import org.eclipse.jface.text.AbstractReusableInformationControlCreator; +import org.eclipse.jface.text.BadLocationException; +import org.eclipse.jface.text.DefaultInformationControl; +import org.eclipse.jface.text.IInformationControl; +import org.eclipse.jface.text.IInformationControlCreator; +import org.eclipse.jface.text.IInformationControlExtension4; +import org.eclipse.jface.text.IInputChangedListener; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITextViewer; import org.eclipse.jface.text.Region; +import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.ISharedImages; +import org.eclipse.ui.IWorkbenchSite; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.editors.text.EditorsUI; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.IFunctionSummary; -import org.eclipse.cdt.ui.IRequiredInclude; -import org.eclipse.cdt.ui.IFunctionSummary.IFunctionPrototypeSummary; -import org.eclipse.cdt.ui.text.ICHelpInvocationContext; -import org.eclipse.cdt.ui.text.IHoverHelpInvocationContext; +/** + * Provides doxygen hover. + */ +public class CDocHover extends AbstractCEditorTextHover { -import org.eclipse.cdt.internal.ui.CHelpProviderManager; -import org.eclipse.cdt.internal.ui.editor.CEditorMessages; -import org.eclipse.cdt.internal.ui.text.CWordFinder; -import org.eclipse.cdt.internal.ui.text.HTMLPrinter; + private static String doxygenDirectoryPath; -public class CDocHover extends AbstractCEditorTextHover { - /** * Constructor for DefaultCEditorTextHover */ public CDocHover() { + doxygenDirectoryPath = CUIPreferenceInitializer.doxygenDirectoryPath; + } + + private static class SingletonRule implements ISchedulingRule { + public static final ISchedulingRule INSTANCE = new SingletonRule(); + public boolean contains(ISchedulingRule rule) { + return rule == this; + } + public boolean isConflicting(ISchedulingRule rule) { + return rule == this; + } + } + + /** + * Computes the source location for a given identifier. + */ + private static class ComputeSourceRunnable implements ASTRunnable { + + private final IRegion fTextRegion; + private String fSource; + + /** + * If method is in source file, this is used. + */ + private final int methodInSource = 1001; + /** + * If method is in header file, this is used. + */ + private final int methodInHeader = 1002; + + public ComputeSourceRunnable(ITranslationUnit tUnit, IRegion textRegion) { + fTextRegion = textRegion; + fSource = null; + } + + /** + * Tokenizer + * + * @param string string to tokenize + * @return array of tokenized string + */ + private String[] tokenizeString(String string) { + StringTokenizer tokenizer = new StringTokenizer(string); + String tokenOfString[] = new String[tokenizer.countTokens()]; + int index = 0; + while (tokenizer.hasMoreTokens()) { + tokenOfString[index] = tokenizer.nextToken(); + index++; + } + return tokenOfString; + } + /** + * Tokenizer with delimiter + * + * @param string string to tokenize + * @param delimiter delimiter + * @return array of tokenized string + */ + private String[] tokenizeStringWithDelimiter(String string, String delimiter) { + StringTokenizer tokenizer = new StringTokenizer(string, delimiter); + String tokenOfString[] = new String[tokenizer.countTokens()]; + int index = 0; + while (tokenizer.hasMoreTokens()) { + tokenOfString[index] = tokenizer.nextToken(); + index++; + } + return tokenOfString; + } + /** + * Check HTML file existence. + * + * @param htmlFileName HTML file name + * @return true if it exist, false if it doesn't exist + * @throws IOException if an I/O error has occurred + */ + private boolean checkHTMLFileExistence(String htmlFileName) throws IOException { + File file = new File(doxygenDirectoryPath); + File fileList[] = file.listFiles(); + for (int i = 0; i < fileList.length; i++) { + if (htmlFileName.equals(fileList[i].getName())) { + return true; + } + } + + return false; + } + /** + * Find location of member variable of class. + * + * @param htmlLine 1 line of HTML file + * @param memberName method name + * @return location of member variable of class n HTML file + */ + private String searchMemberVariableLocationOfCalss(String htmlLine, String memberName) { + String tempString = null; + String htmlFile = null; + if (htmlLine.contains("class=\"memlist\"") == true) { + tempString = htmlLine.trim(); + tempString = htmlLine.substring( htmlLine.indexOf(">", htmlLine.indexOf("href")) + 1, htmlLine.length()); + if (tempString.indexOf(memberName) == 0) { + htmlFile = htmlLine.substring(htmlLine.indexOf("href") + 6, htmlLine.indexOf("\"", htmlLine.indexOf("href") + 6)); + return htmlFile; + } + } + return null; + } + /** + * Change string with enumeration brace. + * + * @param str string with enumeration brace + * @return changed string + */ + private String changeStringWithEnumerationBrace(String str) { + StringBuilder sb = new StringBuilder(str); + int index = 0; + int index2 = 0; + while (index != 4) { + index = sb.indexOf("enum {", index) + 5; + index2 = sb.indexOf("}", index); + if ((index2 != -1) && (index != -1)) { + sb.delete(index2, index2 + 1); + sb.delete(index, index + 1); + } + } + return sb.toString(); + } + /** + * Change string with void. + * + * @param str string with void + * @return changed string + */ + private String changeStringWithVoid(String str) { + StringBuilder sb = new StringBuilder(str); + int index = 0; + int index2 = 0; + while (index != -1) { + index = sb.indexOf("(void)", index); + index2 = index + 5; + if ((index2 != -1) && (index != -1)) { + sb.delete(index2, index2 + 1); + sb.delete(index, index + 1); + } + } + return sb.toString(); + } + /** + * Change string with template. + * + * @param str string with template + * @return changed string + */ + private String changeStringWithTemplate(String str) { + StringBuilder sb = new StringBuilder(str); + String type = str.substring(str.indexOf("<") + 1, str.indexOf(">")); + if (!type.contains(",")) { + str = str.replaceAll(type, ""); + return str; + } else if (type.contains(",")) { + sb.replace(sb.indexOf("<") + 1, sb.indexOf(",", sb.indexOf("<")), ""); + sb.replace(sb.indexOf(",", sb.indexOf("<")) + 1, sb.indexOf(">"), ""); + return sb.toString(); + } + return null; + } + /** + * Change string with asterisk. + * + * @param str string with asterisk + * @return changed string + */ + private String changeStringWithAsterisk(String str) { + StringBuilder sb = new StringBuilder(str); + int index = 0; + while (index != -1) { + index = sb.indexOf("*", index); + if (index != -1) { + sb.delete(index, index + 1); + sb.replace(index - 1, index, "* "); + } + } + + return sb.toString(); + } + /** + * Find location of method of class in HTML file. + * + * @param htmlLine 1 line of HTML file + * @param binding IBinding + * @param isWhere methodInSource if method is in source file, methodInHeader if method is in header file + * @param isMethodOfClass true if method of class, false if method of interface + * @return location of method of class in HTML file + * @throws DOMException + */ + private String searchMethodLocationOfClass(String htmlLine, IBinding binding, int isWhere, boolean isMethodOfClass) throws DOMException { + String htmlFile = null; + + String str[] = tokenizeString(binding.toString()); + if (str.length == 2) { + if (str[1].equals("CPPFIELD")) { + if ( (htmlFile = searchMemberVariableLocationOfCalss(htmlLine, str[0])) != null) { + return htmlFile; + } + } + } + + String bindingString = binding.toString(); + if (bindingString.contains("long int")) { + bindingString = bindingString.replaceAll("long int", "long"); + } + if (bindingString.contains("short int")) { + bindingString = bindingString.replaceAll("short int", "short"); + } + if (bindingString.contains("enum {")) { + bindingString = changeStringWithEnumerationBrace(bindingString); + } + if (bindingString.contains("enum ")) { + bindingString = bindingString.replaceAll("enum ", ""); + } + /* handling defined type start */ + if (bindingString.contains("wchar_t")) { + bindingString = bindingString.replaceAll("wchar_t", "mchar"); + } + if (bindingString.contains("Buffer")) { + bindingString = bindingString.replaceAll("Buffer", "DoubleBuffer"); + } + if (bindingString.contains("Buffer")) { + bindingString = bindingString.replaceAll("Buffer", "FloatBuffer"); + } + if (bindingString.contains("Buffer")) { + bindingString = bindingString.replaceAll("Buffer", "IntBuffer"); + } + if (bindingString.contains("Buffer")) { + bindingString = bindingString.replaceAll("Buffer", "LongBuffer"); + } + if (bindingString.contains("Buffer")) { + bindingString = bindingString.replaceAll("Buffer", "LongLongBuffer"); + } + if (bindingString.contains("Buffer")) { + bindingString = bindingString.replaceAll("Buffer", "McharBuffer"); + } + if (bindingString.contains("Buffer")) { + bindingString = bindingString.replaceAll("Buffer", "ShortBuffer"); + } + if (bindingString.contains("UUID_")) { + bindingString = bindingString.replaceAll("UUID_", "UUID"); + } + /* handling defined type end */ + if (bindingString.contains("(void)")) { + changeStringWithVoid(bindingString); + } + String ownerOfBinding = binding.getOwner().toString(); + String namespace = ownerOfBinding.substring(0, ownerOfBinding.lastIndexOf(":") + 1); + String methodName = tokenizeStringWithDelimiter(bindingString, "(),")[0]; + if (!methodName.equals("Compare")) { + if (!bindingString.contains("Osp::Base::Object")) { + if (bindingString.contains(namespace)) { + bindingString = bindingString.replaceAll(namespace, ""); + } + } + } else if (methodName.equals("Compare")) { + if (!bindingString.contains("Osp::Base::Object")) { + if (bindingString.contains(namespace)) { + bindingString = bindingString.replaceAll(namespace, ""); + } + } + } + if (ownerOfBinding.equals("Osp::Base::Utility::StringUtil CPPCLASSTYPE")) { + bindingString = bindingString.replaceAll("Osp::Base::", ""); + } + if (ownerOfBinding.equals("Osp::Ui::Controls::Frame CPPCLASSTYPE")) { + if (!bindingString.contains("AddControl")) { + bindingString = bindingString.replaceAll("Osp::Ui::", ""); + } + } + if (bindingString.contains("{")) { + bindingString = bindingString.substring(0, bindingString.indexOf("{") - 1); + bindingString = bindingString + " CPPMETHOD"; + if (bindingString.contains("<")) { + bindingString = changeStringWithTemplate(bindingString); + } + } + bindingString = bindingString.replaceAll(" ", ""); + + String bindingStringMethod[] = tokenizeStringWithDelimiter(bindingString, "(),"); + String htmlLineString = null; + int isWhereTemp = 0; + if (isWhere == methodInSource) { + isWhereTemp = 2; + } else if (isWhere == methodInHeader) { + isWhereTemp = 1; + } + boolean isSame = true; + + if (htmlLine.contains("class=\"memlist\"") == true) { + htmlLineString = htmlLine.trim(); + htmlLineString = htmlLine.substring( htmlLine.indexOf(">", htmlLine.indexOf("href")) + 1, htmlLine.length()); + if (htmlLineString.contains("const ")) { + htmlLineString = htmlLineString.replaceAll("const ", "const"); + } + if (htmlLineString.contains(" &")) { + htmlLineString = htmlLineString.replaceAll(" &", "& "); + } + if (htmlLineString.contains("*")) { + htmlLineString = changeStringWithAsterisk(htmlLineString); + } + if (htmlLineString.contains("< ")) { + htmlLineString = htmlLineString.replaceAll("< ", "<"); + } + if (htmlLineString.contains(" >")) { + htmlLineString = htmlLineString.replaceAll(" >", ">"); + } + if (htmlLineString.contains("<")) { + htmlLineString = changeStringWithTemplate(htmlLineString); + } + if (htmlLineString.contains("(") && htmlLineString.contains(")")) { /* if member of class is method*/ + String tokenOfMethod1 = htmlLineString.substring(0, htmlLineString.indexOf("(")); + String tokenOfMethod2 = htmlLineString.substring(htmlLineString.indexOf("("), htmlLineString.indexOf(")") + 1); + String tokenOfMethod3 = htmlLineString.substring(htmlLineString.indexOf(")") + 1, htmlLineString.length()); + /* handling defined type start */ + if (tokenOfMethod2.contains("AppId")) { + tokenOfMethod2 = tokenOfMethod2.replaceAll("AppId", "Osp::Base::String"); + } + if (tokenOfMethod2.contains("AppSecret")) { + tokenOfMethod2 = tokenOfMethod2.replaceAll("AppSecret", "Osp::Base::String"); + } + if (tokenOfMethod2.contains("BuddyCategoryId")) { + tokenOfMethod2 = tokenOfMethod2.replaceAll("BuddyCategoryId", "Osp::Base::String"); + } + if (tokenOfMethod2.contains("ChatMsgId")) { + tokenOfMethod2 = tokenOfMethod2.replaceAll("ChatMsgId", "int"); + } + if (tokenOfMethod2.contains("KeyData")) { + tokenOfMethod2 = tokenOfMethod2.replaceAll("KeyData", "char"); + } + if (tokenOfMethod2.contains("LandmarkId")) { + tokenOfMethod2 = tokenOfMethod2.replaceAll("LandmarkId", "long"); + } + if (tokenOfMethod2.contains("LoginId")) { + tokenOfMethod2 = tokenOfMethod2.replaceAll("LoginId", "Osp::Base::String"); + } + if (tokenOfMethod2.contains("NetAccountId")) { + tokenOfMethod2 = tokenOfMethod2.replaceAll("NetAccountId", "int"); + } + if (tokenOfMethod2.contains("RecordId")) { + tokenOfMethod2 = tokenOfMethod2.replaceAll("RecordId", "long long"); + } + if (tokenOfMethod2.contains("RecurrenceId")) { + tokenOfMethod2 = tokenOfMethod2.replaceAll("RecurrenceId", "Osp::Base::DateTime"); + } + if (tokenOfMethod2.contains("RequestId")) { + tokenOfMethod2 = tokenOfMethod2.replaceAll("RequestId", "long"); + } + if (tokenOfMethod2.contains("result")) { + tokenOfMethod2 = tokenOfMethod2.replaceAll("result", "unsigned long"); + } + if (tokenOfMethod2.contains("UserId")) { + tokenOfMethod2 = tokenOfMethod2.replaceAll("UserId", "Osp::Base::String"); + } + if (tokenOfMethod2.contains("xmlChar")) { + tokenOfMethod2 = tokenOfMethod2.replaceAll("xmlChar", "unsigned char"); + } + if (tokenOfMethod2.contains("byte")) { + tokenOfMethod2 = tokenOfMethod2.replaceAll("byte", "unsigned char"); + } + if (tokenOfMethod2.contains("unsigned ")) { + tokenOfMethod2 = tokenOfMethod2.replaceAll("unsigned ", "unsigned"); + } + if (tokenOfMethod2.contains("long long")) { + tokenOfMethod2 = tokenOfMethod2.replaceAll("long long", "longlong"); + } + /* handling defined type end */ + htmlLineString = tokenOfMethod1 + tokenOfMethod2 + tokenOfMethod3; + } + if (isMethodOfClass == false) { + htmlLineString = htmlLineString.replaceAll("=0", ""); + } + if (htmlLineString.indexOf(bindingStringMethod[0]) == 0) { /* method name in HTML file and method[0] variable are same */ + if (bindingStringMethod.length != isWhereTemp) { /* method has parameter variable */ + if ( (bindingStringMethod.length == isWhereTemp + 1) && (bindingStringMethod[1].equals("void")) && (htmlLineString.contains("(void")) ) { /* method has void parameter variable */ + htmlFile = htmlLine.substring(htmlLine.indexOf("href") + 6, htmlLine.indexOf("\"", htmlLine.indexOf("href") + 6)); + return htmlFile; + } + htmlLineString = htmlLineString.substring(htmlLineString.indexOf("(") + 1, htmlLineString.indexOf(")")); + String htmlLineStringMethod[] = tokenizeStringWithDelimiter(htmlLineString, ", "); + if ( ( (bindingStringMethod.length - isWhereTemp) * 2 ) == htmlLineStringMethod.length ) { /* the number of parameter variable of method in HTML file and the number of parameter variable of method are same */ + if (binding.toString().contains("enum {")) { + htmlFile = htmlLine.substring(htmlLine.indexOf("href") + 6, htmlLine.indexOf("\"", htmlLine.indexOf("href") + 6)); + return htmlFile; + } + if (binding.getOwner().toString().contains("CPP_CLASS_INSTANCE")) { + htmlFile = htmlLine.substring(htmlLine.indexOf("href") + 6, htmlLine.indexOf("\"", htmlLine.indexOf("href") + 6)); + return htmlFile; + } + for (int i = 0; i < bindingStringMethod.length - 1; i++) { + if ( !bindingStringMethod[i + 1].equals(htmlLineStringMethod[i * 2]) ) { + isSame = false; + break; + } + if (isSame == true) { + htmlFile = htmlLine.substring(htmlLine.indexOf("href") + 6, htmlLine.indexOf("\"", htmlLine.indexOf("href") + 6)); + return htmlFile; + } + } + } + } else if (bindingStringMethod.length == isWhereTemp) { /* method doesn't have parameter variable */ + htmlFile = htmlLine.substring(htmlLine.indexOf("href") + 6, htmlLine.indexOf("\"", htmlLine.indexOf("href") + 6)); + return htmlFile; + } + } + } + + return null; + } + /** + * Find location of method of class in HTML file, if mouseover event occurs in header file. + * + * @param htmlLine 1 line of HTML file + * @param binding IBinding + * @return location of method of class in HTML file + * @throws DOMException, IOExceptio + */ + private String searchMethod(String htmlLine, IBinding binding) throws DOMException, IOException { + String stringOfOwner = binding.getOwner().toString(); + String htmlFileName = null; + boolean isExist = false; + + if (htmlLine.contains("class=\"el\"") == true) { + if (htmlLine.contains(">" + stringOfOwner + "<")) { + int beginIndex = htmlLine.indexOf("\">", htmlLine.indexOf(">" + stringOfOwner + "<") + stringOfOwner.length() + 4); + int endIndex = htmlLine.indexOf("<", beginIndex); + String namespace = htmlLine.substring(beginIndex + 2, endIndex); + if (checkIsInterface(stringOfOwner) == false) { + htmlFileName = "class" + namespace.replaceAll("::", "_1_1") +"_1_1" + stringOfOwner + "-members.html"; + + isExist = checkHTMLFileExistence(htmlFileName); /* check HTML file existence */ + + if (isExist == true) { + BufferedReader reader = new BufferedReader(new FileReader(doxygenDirectoryPath + "/" + htmlFileName)); + String tempString = null; + String htmlFileName2 = null; + while ( (tempString = reader.readLine()) != null) { + if ( (htmlFileName2 = searchMethodLocationOfClass(tempString, binding, methodInHeader, true)) != null) { + break; + } + } + reader.close(); + htmlFileName = htmlFileName2; + } + + return htmlFileName; + } else if (checkIsInterface(stringOfOwner) == true) { + htmlFileName = "interface" + namespace.replaceAll("::", "_1_1") +"_1_1" + stringOfOwner + "-members.html"; + + isExist = checkHTMLFileExistence(htmlFileName); /* check HTML file existence */ + + if (isExist == true) { + BufferedReader reader = new BufferedReader(new FileReader(doxygenDirectoryPath + "/" + htmlFileName)); + String tempString = null; + String htmlFileName2 = null; + while ( (tempString = reader.readLine()) != null) { + if ( (htmlFileName2 = searchMethodLocationOfClass(tempString, binding, methodInHeader, false)) != null) { + break; + } + } + reader.close(); + htmlFileName = htmlFileName2; + } + + return htmlFileName; + } + } + } + + return null; + } + /** + * Check is owner a interface or a class. + * + * @param owner string of owner + * @return true if interface, false if class + */ + private boolean checkIsInterface(String owner) { + boolean isInterface = false; + if (owner.substring(0, 1).equals("I")) { + if (Character.isUpperCase(owner.charAt(1)) == true) { + isInterface = true; + } else if (Character.isUpperCase(owner.charAt(1)) == false) { + isInterface = false; + } + } else if (!owner.substring(0, 1).equals("I")) { + isInterface = false; + } + + return isInterface; + } + /** + * Check is owner a interface or a class. + * + * @param owner string array of owner + * @return true if interface, false if class + */ + private boolean checkIsInterface(String[] owner) { + boolean isInterface = false; + if (owner[owner.length - 1].substring(0, 1).equals("I")) { + if (Character.isUpperCase(owner[owner.length - 1].charAt(1)) == true) { + isInterface = true; + } else if (Character.isUpperCase(owner[owner.length - 1].charAt(1)) == false) { + isInterface = false; + } + } else if (!owner[owner.length - 1].substring(0, 1).equals("I")) { + isInterface = false; + } + + return isInterface; + } + /** + * Find location of enumerator in HTML file. + * + * @param htmlFileName name of HTML file + * @param binding IBinding + * @param isWhere methodInSource if enumerator is in source file, methodInHeader if enumerator is in header file + * @return location of enumerator in HTML file + * @throws IOException + */ + private String searchEnumerator(String htmlFileName, IBinding binding, int isWhere) throws IOException { + String enumeratorName = null; + if (isWhere == methodInSource) { + enumeratorName = tokenizeString(binding.toString())[0]; + } else if (isWhere == methodInHeader) { + enumeratorName = binding.getName(); + } + + boolean isExist = false; + + isExist = checkHTMLFileExistence(htmlFileName); /* check HTML file existence */ + + if (isExist == true) { + BufferedReader reader = new BufferedReader(new FileReader(doxygenDirectoryPath + "/" + htmlFileName)); + String htmlLine = null; + String htmlFileName2 = null; + while ( (htmlLine = reader.readLine()) != null) { + if (htmlLine.contains(enumeratorName)) { + htmlLine = reader.readLine(); + htmlFileName2 = htmlLine.substring(htmlLine.indexOf("href") + 6, htmlLine.indexOf("\"", htmlLine.indexOf("href") + 6)); + break; + } + } + reader.close(); + htmlFileName = htmlFileName2; + } else if (isExist == false) { + return null; + } + + return htmlFileName; + } + /** + * Find location of enumeration in HTML file. + * + * @param htmlFileName name of HTML file + * @param binding IBinding + * @return location of enumeration in HTML file + * @throws IOException + */ + private String searchEnumeration(String htmlFileName, IBinding binding) throws IOException { + String enumerationName = null; + enumerationName = binding.getName(); + + boolean isExist = false; + + isExist = checkHTMLFileExistence(htmlFileName); /* check HTML file existence */ + + if (isExist == true) { + BufferedReader reader = new BufferedReader(new FileReader(doxygenDirectoryPath + "/" + htmlFileName)); + String htmlLine = null; + String htmlFileName2 = null; + while ( (htmlLine = reader.readLine()) != null) { + if (htmlLine.contains(enumerationName)) { + htmlLine = reader.readLine(); + htmlFileName2 = htmlLine.substring(htmlLine.indexOf("href") + 6, htmlLine.indexOf("\"", htmlLine.indexOf("href") + 6)); + break; + } + } + reader.close(); + htmlFileName = htmlFileName2; + } else if (isExist == false) { + return null; + } + + return htmlFileName; + } + + /* + * @see org.eclipse.cdt.internal.core.model.ASTCache.ASTRunnable#runOnAST(org.eclipse.cdt.core.dom.ast.IASTTranslationUnit) + */ + public IStatus runOnAST(ILanguage lang, IASTTranslationUnit ast) { + if (ast != null) { + try { + IASTName name= ast.getNodeSelector(null).findEnclosingName(fTextRegion.getOffset(), fTextRegion.getLength()); + if (name != null) { + IBinding binding= name.resolveBinding(); + + if (binding != null) { + String htmlFileName = null; + boolean isExist = false; + + if (binding.getOwner() == null) { + String stringOfBinding[] = tokenizeString(binding.toString()); + if (stringOfBinding.length == 2) { /* Case 1-1. using root namespace in source file */ + if (stringOfBinding[0].equals("Osp") && stringOfBinding[1].equals("CPPNAMESPACE")) { + htmlFileName = "namespaceOsp.html"; + isExist = checkHTMLFileExistence(htmlFileName); + } + } else if (stringOfBinding.length == 1) { /* Case 1-2. declaration root namespace in header or source file */ + if (stringOfBinding[0].equals("Osp")) { + htmlFileName = "namespaceOsp.html"; + isExist = checkHTMLFileExistence(htmlFileName); + } + } + } else if (binding.getOwner() != null) { + String stringOfOwner[] = tokenizeString(binding.getOwner().toString()); + if (stringOfOwner.length == 3) { + if (stringOfOwner[2].equals("CPPENUMERATION")) { + String stringOfBinding[] = tokenizeString(binding.toString()); + if (stringOfBinding[1].equals("CPPENUMERATOR")) { /* Case 2-0. enumerator in source file */ + char firstChar = stringOfBinding[0].charAt(0); + if (firstChar == 'A') { + htmlFileName = "namespacemembers_eval.html"; + } else { + for (int i = 66; i < 91; i++) { + if ((int)firstChar == i) { + htmlFileName = "namespacemembers_eval_0x" + Integer.toHexString(i + 32) + ".html"; + } + } + } + + String htmlFileName2 = null; + if ( (htmlFileName2 = searchEnumerator(htmlFileName, binding, methodInSource)) != null) { + isExist = true; + htmlFileName = htmlFileName2; + } + } + } + } else if (stringOfOwner.length == 2) { + if (stringOfOwner[1].equals("CPPNAMESPACE")) { + String stringOfBinding[] = tokenizeString(binding.toString()); + if (stringOfBinding[1].equals("CPPNAMESPACE")) { /* Case 2-1-1. using namespace in source file */ + htmlFileName = "namespace" + tokenizeString(binding.toString())[0].replaceAll("::", "_1_1") + ".html"; + isExist = checkHTMLFileExistence(htmlFileName); + } else if (stringOfBinding[1].equals("CPPCLASSTYPE")) { /* Case 2-1-2. class in source file */ + htmlFileName = "class" + stringOfBinding[0].replaceAll("::", "_1_1") + ".html"; + isExist = checkHTMLFileExistence(htmlFileName); /* check HTML file existence */ + } else if (stringOfBinding[1].equals("CPP_CLASS_TEMPLATE")) { /* Case 2-1-3. class template in source file */ + htmlFileName = "class" + stringOfBinding[0].replaceAll("::", "_1_1") + ".html"; + isExist = checkHTMLFileExistence(htmlFileName); /* check HTML file existence */ + } /*else if (stringOfBinding[1].equals("CPPENUMERATOR")) { Case 2-1-4. enumerator in source file + char firstChar = stringOfBinding[0].charAt(0); + if (firstChar == 'A') { + htmlFileName = "namespacemembers_eval.html"; + } else { + for (int i = 66; i < 91; i++) { + if ((int)firstChar == i) { + htmlFileName = "namespacemembers_eval_0x" + Integer.toHexString(i + 32) + ".html"; + } + } + } + + String htmlFileName2 = null; + if ( (htmlFileName2 = searchEnumerator(htmlFileName, binding, methodInSource)) != null) { + isExist = true; + htmlFileName = htmlFileName2; + } + }*/ else if (stringOfBinding.length == 3 && stringOfBinding[2].equals("CPPENUMERATION")) { /* Case 2-1-5. enumeration used as parameter variable in header file */ + char firstChar = stringOfBinding[1].charAt(0); + if (firstChar == 'A') { + htmlFileName = "namespacemembers_enum.html"; + } else { + for (int i = 66; i < 91; i++) { + if ((int)firstChar == i) { + htmlFileName = "namespacemembers_enum_0x" + Integer.toHexString(i + 32) + ".html"; + } + } + } + + String htmlFileName2 = null; + if ( (htmlFileName2 = searchEnumeration(htmlFileName, binding)) != null) { + isExist = true; + htmlFileName = htmlFileName2; + } + } else if (binding.toString().contains("CPPTYPEDEF") && binding.toString().contains("enum")) { /* Case 2-1-6. typedef enumeration used as parameter variable in header file */ + char firstChar = stringOfBinding[0].charAt(0); + if (firstChar == 'A') { + htmlFileName = "namespacemembers_enum.html"; + } else { + for (int i = 66; i < 91; i++) { + if ((int)firstChar == i) { + htmlFileName = "namespacemembers_enum_0x" + Integer.toHexString(i + 32) + ".html"; + } + } + } + + String htmlFileName2 = null; + if ( (htmlFileName2 = searchEnumeration(htmlFileName, binding)) != null) { + isExist = true; + htmlFileName = htmlFileName2; + } + } + } else if (stringOfOwner[1].equals("CPPCLASSTYPE")) { /* Case 2-2. constructor or member method in source file */ + String tokenOfStringOfOwner[] = tokenizeStringWithDelimiter(stringOfOwner[0], "::"); + if ( checkIsInterface(tokenOfStringOfOwner) == false ) { /* Case 2-2-1. constructor or member method of class in source file */ + htmlFileName = "class" + stringOfOwner[0].replaceAll("::", "_1_1") + "-members.html"; + + isExist = checkHTMLFileExistence(htmlFileName); /* check HTML file existence */ + + if (isExist == true) { + BufferedReader reader = new BufferedReader(new FileReader(doxygenDirectoryPath + "/" + htmlFileName)); + String tempString = null; + String htmlFileName2 = null; + while ( (tempString = reader.readLine()) != null) { + if ( (htmlFileName2 = searchMethodLocationOfClass(tempString, binding, methodInSource, true)) != null) { + break; + } + } + reader.close(); + htmlFileName = htmlFileName2; + } + } else if ( checkIsInterface(tokenOfStringOfOwner) == true ) { /* Case 2-2-2. constructor or member method of interface in source file */ + htmlFileName = "interface" + stringOfOwner[0].replaceAll("::", "_1_1") + "-members.html"; + + isExist = checkHTMLFileExistence(htmlFileName); /* check HTML file existence */ + + if (isExist == true) { + BufferedReader reader = new BufferedReader(new FileReader(doxygenDirectoryPath + "/" + htmlFileName)); + String tempString = null; + String htmlFileName2 = null; + while ( (tempString = reader.readLine()) != null) { + if ( (htmlFileName2 = searchMethodLocationOfClass(tempString, binding, methodInSource, false)) != null) { + break; + } + } + reader.close(); + htmlFileName = htmlFileName2; + } + } + } else if (stringOfOwner[1].equals("CPP_CLASS_INSTANCE")) { /* Case 2-3. member method with in source file */ + String tokenOfStringOfOwner[] = tokenizeStringWithDelimiter(stringOfOwner[0], "::"); + if ( checkIsInterface(tokenOfStringOfOwner) == false ) { /* Case 2-3-1. member method with of class in source file */ + String owner = stringOfOwner[0].substring(0, stringOfOwner[0].indexOf("<")); + htmlFileName = "class" + owner.replaceAll("::", "_1_1") + "-members.html"; + + isExist = checkHTMLFileExistence(htmlFileName); /* check HTML file existence */ + + if (isExist == true) { + BufferedReader reader = new BufferedReader(new FileReader(doxygenDirectoryPath + "/" + htmlFileName)); + String tempString = null; + String htmlFileName2 = null; + while ( (tempString = reader.readLine()) != null) { + if ( (htmlFileName2 = searchMethodLocationOfClass(tempString, binding, methodInSource, true)) != null) { + break; + } + } + reader.close(); + htmlFileName = htmlFileName2; + } + } else if ( checkIsInterface(tokenOfStringOfOwner) == true ) { /* Case 2-3-2. member method with of interface in source file */ + String owner = stringOfOwner[0].substring(0, stringOfOwner[0].indexOf("<")); + htmlFileName = "interface" + owner.replaceAll("::", "_1_1") + "-members.html"; + + isExist = checkHTMLFileExistence(htmlFileName); /* check HTML file existence */ + + if (isExist == true) { + BufferedReader reader = new BufferedReader(new FileReader(doxygenDirectoryPath + "/" + htmlFileName)); + String tempString = null; + String htmlFileName2 = null; + while ( (tempString = reader.readLine()) != null) { + if ( (htmlFileName2 = searchMethodLocationOfClass(tempString, binding, methodInSource, false)) != null) { + break; + } + } + reader.close(); + htmlFileName = htmlFileName2; + } + } + + } + } else if (stringOfOwner.length == 1) { + String stringOfClass[] = tokenizeStringWithDelimiter(binding.getClass().toString(), "."); + if ( stringOfClass[stringOfClass.length - 1].equals("CPPNamespace") ) { /* Case 3-1-1. declaration namespace in header or source file */ + htmlFileName = "namespace" + binding.toString().replaceAll("::", "_1_1") + ".html"; + isExist = checkHTMLFileExistence(htmlFileName); /* check HTML file existence */ + } else if ( stringOfClass[stringOfClass.length - 1].equals("CPPClassType") ) { /* Case 3-1-2. class in header file */ + htmlFileName = "class" + binding.getOwner().toString().replaceAll("::", "_1_1") + "_1_1" + binding.toString() + ".html"; + isExist = checkHTMLFileExistence(htmlFileName); /* check HTML file existence */ + } /*else if ( stringOfClass[stringOfClass.length - 1].equals("CPPEnumerator") ) { Case 3-1-3. enumerator in header file + char firstChar = binding.getName().charAt(0); + if (firstChar == 'A') { + htmlFileName = "namespacemembers_eval.html"; + } else { + for (int i = 66; i < 91; i++) { + if ((int)firstChar == i) { + htmlFileName = "namespacemembers_eval_0x" + Integer.toHexString(i + 32) + ".html"; + } + } + } + + String htmlFileName2 = null; + if ( (htmlFileName2 = searchEnumerator(htmlFileName, binding, methodInHeader)) != null) { + isExist = true; + htmlFileName = htmlFileName2; + } + }*/ else if ( stringOfClass[stringOfClass.length - 1].equals("CPPEnumeration") ) { /* Case 3-1-4. declared enumeration in header file */ + char firstChar = binding.getName().charAt(0); + if (firstChar == 'A') { + htmlFileName = "namespacemembers_enum.html"; + } else { + for (int i = 66; i < 91; i++) { + if ((int)firstChar == i) { + htmlFileName = "namespacemembers_enum_0x" + Integer.toHexString(i + 32) + ".html"; + } + } + } + + String htmlFileName2 = null; + if ( (htmlFileName2 = searchEnumeration(htmlFileName, binding)) != null) { + isExist = true; + htmlFileName = htmlFileName2; + } + } else if ( stringOfClass[stringOfClass.length - 1].equals("CPPTypedef") ) { /* Case 3-1-5. typedef declared enumeration in header file */ + char firstChar = binding.getName().charAt(0); + if (firstChar == 'A') { + htmlFileName = "namespacemembers_enum.html"; + } else { + for (int i = 66; i < 91; i++) { + if ((int)firstChar == i) { + htmlFileName = "namespacemembers_enum_0x" + Integer.toHexString(i + 32) + ".html"; + } + } + } + + String htmlFileName2 = null; + if ( (htmlFileName2 = searchEnumeration(htmlFileName, binding)) != null) { + isExist = true; + htmlFileName = htmlFileName2; + } + } else if ( stringOfClass[stringOfClass.length - 1].equals("CPPClassType") || stringOfClass[stringOfClass.length - 1].equals("CPPMethod") ) { /* Case 3-1-6. constructor or member method in header file */ + htmlFileName = "classes.html"; + + isExist = checkHTMLFileExistence(htmlFileName); /* check HTML file existence */ + + if (isExist == true) { + BufferedReader reader = new BufferedReader(new FileReader(doxygenDirectoryPath + "/" + htmlFileName)); + String tempString = null; + String htmlFileName2 = null; + while ( (tempString = reader.readLine()) != null) { + if ( (htmlFileName2 = searchMethod(tempString, binding)) != null) { + break; + } + } + reader.close(); + htmlFileName = htmlFileName2; + } + } + } else if (stringOfOwner.length == 0) { + String stringOfClass[] = tokenizeStringWithDelimiter(binding.getClass().toString(), "."); + if ( stringOfClass[stringOfClass.length - 1].equals("CPPEnumerator") ) { /* Case 4-1. enumerator in header file */ + char firstChar = binding.getName().charAt(0); + if (firstChar == 'A') { + htmlFileName = "namespacemembers_eval.html"; + } else { + for (int i = 66; i < 91; i++) { + if ((int)firstChar == i) { + htmlFileName = "namespacemembers_eval_0x" + Integer.toHexString(i + 32) + ".html"; + } + } + } + + String htmlFileName2 = null; + if ( (htmlFileName2 = searchEnumerator(htmlFileName, binding, methodInHeader)) != null) { + isExist = true; + htmlFileName = htmlFileName2; + } + } + } + } + + if (isExist == true) { + fSource = htmlFileName; + } + /* TODO Modify End */ + + if (fSource != null) { + return Status.OK_STATUS; + } + } + } + } catch (DOMException exc) { + return new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, "Internal Error", exc); //$NON-NLS-1$ + } catch (Exception e) { + // + } + } + return Status.CANCEL_STATUS; + } + + /** + * @return the computed source or null, if no source could be computed + */ + public String getSource() { + return fSource; + } + } /* (non-Javadoc) @@ -120,6 +1079,125 @@ public class CDocHover extends AbstractCEditorTextHover { return null; } + + /* + * @see ITextHover#getHoverInfo(ITextViewer, IRegion) + */ + @Override + public Object getHoverInfo2(ITextViewer textViewer, IRegion hoverRegion) { + IEditorPart editor = getEditor(); + if (editor != null) { + IEditorInput input = editor.getEditorInput(); + IWorkingCopyManager manager = CUIPlugin.getDefault().getWorkingCopyManager(); + IWorkingCopy copy = manager.getWorkingCopy(input); + try { + if (copy == null || !copy.isConsistent()) { + return null; + } + } catch (CModelException exc) { + return null; + } + + String expression; + try { + expression = textViewer.getDocument().get(hoverRegion.getOffset(), hoverRegion.getLength()); + expression = expression.trim(); + if (expression.length() == 0) + return null; + + //Before trying a search lets make sure that the user is not hovering over a keyword + if (selectionIsKeyword(expression)) + return null; + + String source = null; + + // Try with the indexer + source= searchInIndex(copy, hoverRegion); + + if (source == null || source.trim().length() == 0) + return null; + + if (!source.contains(".html")) { + return null; + } + + // we are actually interested in the comments, too. + //source= removeLeadingComments(source); + + String delim= System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$ + + String[] sourceLines = Strings.convertIntoLines(source); + String firstLine = sourceLines[0]; + if (!Character.isWhitespace(firstLine.charAt(0))) + sourceLines[0] = ""; //$NON-NLS-1$ + Strings.trimIndentation(sourceLines, getTabWidth(), getTabWidth()); + + if (!Character.isWhitespace(firstLine.charAt(0))) + sourceLines[0] = firstLine; + + source = Strings.concatenate(sourceLines, delim); + + return internalGetHoverInfo(source, hoverRegion); + } catch (BadLocationException e) { + } + } + return null; + } + + private CDocBrowserInformationControlInput internalGetHoverInfo(String elements, IRegion hoverRegion) { + return getHoverInfo(elements, null, hoverRegion, null); + } + + private static CDocBrowserInformationControlInput getHoverInfo(String elements, String editorInputElement, IRegion hoverRegion, CDocBrowserInformationControlInput previousInput) { + int leadingImageWidth = 20; + return new CDocBrowserInformationControlInput(previousInput, elements, elements, leadingImageWidth); + } + + private static int getTabWidth() { + return 4; + } + + private String searchInIndex(final ITranslationUnit tUnit, IRegion textRegion) { + final ComputeSourceRunnable computer= new ComputeSourceRunnable(tUnit, textRegion); + Job job= new Job(CHoverMessages.CSourceHover_jobTitle) { + @Override + protected IStatus run(IProgressMonitor monitor) { + try { + return ASTProvider.getASTProvider().runOnAST(tUnit, ASTProvider.WAIT_ACTIVE_ONLY, monitor, computer); + } catch (Throwable t) { + CUIPlugin.log(t); + } + return Status.CANCEL_STATUS; + } + }; + // If the hover thread is interrupted this might have negative + // effects on the index - see http://bugs.eclipse.org/219834 + // Therefore we schedule a job to decouple the parsing from this thread. + job.setPriority(Job.DECORATE); + job.setSystem(true); + job.setRule(SingletonRule.INSTANCE); + job.schedule(); + try { + job.join(); + } catch (InterruptedException exc) { + job.cancel(); + return null; + } + return computer.getSource(); + } + + + /** + * Test whether the given name is a known keyword. + * + * @param name + * @return true if the name is a known keyword or false if the + * name is not considered a keyword + */ + private boolean selectionIsKeyword(String name) { + Set keywords = ParserFactory.getKeywordSet(KeywordSetKey.KEYWORDS, ParserLanguage.CPP); + return keywords.contains(name); + } /* (non-Javadoc) * @see org.eclipse.jface.text.ITextHover#getHoverRegion(org.eclipse.jface.text.ITextViewer, int) @@ -138,5 +1216,378 @@ public class CDocHover extends AbstractCEditorTextHover { } return null; } - + + /* + * @see org.eclipse.jface.text.ITextHoverExtension2#getInformationPresenterControlCreator() + * @since 3.1 + */ + public IInformationControlCreator getInformationPresenterControlCreator() { + if (fPresenterControlCreator == null) + fPresenterControlCreator = new PresenterControlCreator(getSite()); + return fPresenterControlCreator; + } + + private IWorkbenchSite getSite() { + IEditorPart editor= getEditor(); + if (editor != null) + return editor.getSite(); + + return null; + } + + /* + * @see org.eclipse.jface.text.ITextHoverExtension#getHoverControlCreator() + * @since 3.0 + */ + @Override + public IInformationControlCreator getHoverControlCreator() { + if (fHoverControlCreator == null) + fHoverControlCreator = new HoverControlCreator(getInformationPresenterControlCreator()); + return fHoverControlCreator; + } + + private static void addLinkListener(final CDocBrowserInformationControl control) { + control.addLocationListener(CElementLinks.createLocationListener(new CElementLinks.ILinkHandler() { + /* (non-Javadoc) + * @see org.eclipse.jdt.internal.ui.viewsupport.JavaElementLinks.ILinkHandler#handleInlineJavadocLink(org.eclipse.jdt.core.IJavaElement) + */ + public void handleInlineCDocLink(String linkTarget) { + CDocBrowserInformationControlInput hoverInfo = getHoverInfo(linkTarget, null, null, (CDocBrowserInformationControlInput) control.getInput()); + if (control.hasDelayedInputChangeListener()) { + control.notifyDelayedInputChange(hoverInfo); + } else { + control.setInput(hoverInfo); + } + } + + public void handleTextSet() { + } + })); + } + + /** + * Get element name of back or forward action. + * + * @param htmlName HTML name + * @return element name + */ + private static String getBackForwardElementName(String htmlName) { + String elementName = ""; + try { + if (htmlName.equals("namespaceOsp.html")) { + elementName = "Osp"; + } else if (htmlName.equals("privlevel.html")) { + elementName = "Privilege Level"; + } else if (htmlName.equals("privgroup.html")) { + elementName = "Privilege Group"; + } else if (htmlName.contains("_1_1")) { + if (!htmlName.contains("#")) { + elementName = htmlName.substring(htmlName.lastIndexOf("_1_1") + 4, htmlName.lastIndexOf(".html")); + } else if (htmlName.contains("#_details")) { + elementName = "Detailed Description"; + } else if (htmlName.contains("#")) { + String htmlFileName = htmlName.substring(0, htmlName.lastIndexOf("#")); + + File file = new File(doxygenDirectoryPath); + File fileList[] = file.listFiles(); + BufferedReader reader = null; + for (int i = 0; i < fileList.length; i++) { + if (htmlFileName.equals(fileList[i].getName())) { + reader = new BufferedReader(new FileReader(doxygenDirectoryPath + "/" + htmlFileName)); + String tempString = null; + while ( (tempString = reader.readLine()) != null) { + if (tempString.contains(htmlName)) { + int startIndex = tempString.indexOf(">", tempString.indexOf(htmlName)) + 1; + int endIndex = tempString.indexOf("", startIndex); + elementName = tempString.substring(startIndex, endIndex); + break; + } + } + } + } + reader.close(); + } + } else if (!htmlName.contains("_1_1")) { + elementName = htmlName.substring(0, htmlName.indexOf(".html")); + if (!htmlName.contains("#")) { + File file = new File(doxygenDirectoryPath); + File fileList[] = file.listFiles(); + BufferedReader reader = null; + for (int i = 0; i < fileList.length; i++) { + reader = new BufferedReader(new FileReader(doxygenDirectoryPath + "/" + htmlName)); + String tempString = null; + while ( (tempString = reader.readLine()) != null) { + if (tempString.contains("h1")) { + int startIndex = tempString.indexOf("h1") + 3; + int endIndex = tempString.indexOf("<", startIndex); + elementName = tempString.substring(startIndex, endIndex); + break; + } + } + } + reader.close(); + } else if (htmlName.contains("#")) { + String htmlFileName = htmlName.substring(0, htmlName.lastIndexOf("#")); + String htmlName2 = htmlName.substring(htmlName.indexOf("#"), htmlName.length()); + boolean isSearchFail = false; + + File file = new File(doxygenDirectoryPath); + File fileList[] = file.listFiles(); + BufferedReader reader = null; + for (int i = 0; i < fileList.length; i++) { + if (htmlFileName.equals(fileList[i].getName())) { + reader = new BufferedReader(new FileReader(doxygenDirectoryPath + "/" + htmlFileName)); + String tempString = null; + while ( (tempString = reader.readLine()) != null) { + if (tempString.contains(htmlName)) { + int startIndex = tempString.indexOf(">", tempString.indexOf(htmlName)) + 1; + int endIndex = tempString.indexOf("", startIndex); + elementName = tempString.substring(startIndex, endIndex); + isSearchFail = true; + break; + } + if (isSearchFail == false) { + if (tempString.contains(htmlName2)) { + int startIndex = tempString.indexOf(">", tempString.indexOf(htmlName2)) + 1; + int endIndex = tempString.indexOf("", startIndex); + elementName = tempString.substring(startIndex, endIndex); + break; + } + } + } + } + } + reader.close(); + + if (elementName.contains("")) { + elementName = elementName.replaceAll("", ""); + } + if (elementName.contains("")) { + elementName = elementName.replaceAll("", ""); + } + } + } + } catch (IOException e) { + // + } catch (Exception e) { + // + } + return elementName; + } + + /** + * Action to go back to the previous input in the hover control. + * + * @since 3.4 + */ + private static final class BackAction extends Action { + private final CDocBrowserInformationControl fInfoControl; + + public BackAction(CDocBrowserInformationControl infoControl) { + fInfoControl= infoControl; + setText(CHoverMessages.CDocHover_back); + ISharedImages images = PlatformUI.getWorkbench().getSharedImages(); + setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_BACK)); + setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_BACK_DISABLED)); + + update(); + } + + public void run() { + BrowserInformationControlInput previous = (BrowserInformationControlInput) fInfoControl.getInput().getPrevious(); + if (previous != null) { + fInfoControl.setInput(previous); + } + } + + public void update() { + BrowserInformationControlInput current = fInfoControl.getInput(); + + if (current != null && current.getPrevious() != null) { + BrowserInput previous = current.getPrevious(); + setToolTipText("Back to " + getBackForwardElementName(previous.toString())); + setEnabled(true); + } else { + setToolTipText(CHoverMessages.CDocHover_back); + setEnabled(false); + } + } + } + + /** + * Action to go forward to the next input in the hover control. + * + * @since 3.4 + */ + private static final class ForwardAction extends Action { + private final CDocBrowserInformationControl fInfoControl; + + public ForwardAction(CDocBrowserInformationControl infoControl) { + fInfoControl = infoControl; + setText(CHoverMessages.CDocHover_forward); + ISharedImages images = PlatformUI.getWorkbench().getSharedImages(); + setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD)); + setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD_DISABLED)); + + update(); + } + + public void run() { + BrowserInformationControlInput next = (BrowserInformationControlInput) fInfoControl.getInput().getNext(); + if (next != null) { + fInfoControl.setInput(next); + } + } + + public void update() { + BrowserInformationControlInput current = fInfoControl.getInput(); + + if (current != null && current.getNext() != null) { + setToolTipText("Forward to " + getBackForwardElementName(current.getNext().toString())); + setEnabled(true); + } else { + setToolTipText(CHoverMessages.CDocHover_forward); + setEnabled(false); + } + } + } + + /** + * Presenter control creator. + * + * @since 3.3 + */ + public static final class PresenterControlCreator extends AbstractReusableInformationControlCreator { + + private IWorkbenchSite fSite; + + /** + * Creates a new PresenterControlCreator. + * + * @param site the site or null if none + * @since 3.6 + */ + public PresenterControlCreator(IWorkbenchSite site) { + fSite = site; + } + + /* + * @see org.eclipse.jdt.internal.ui.text.java.hover.AbstractReusableInformationControlCreator#doCreateInformationControl(org.eclipse.swt.widgets.Shell) + */ + public IInformationControl doCreateInformationControl(Shell parent) { + if (CDocBrowserInformationControl.isAvailable(parent)) { + ToolBarManager tbm = new ToolBarManager(SWT.FLAT); + String font = PreferenceConstants.EDITOR_TEXT_FONT; + CDocBrowserInformationControl iControl = new CDocBrowserInformationControl(parent, font, tbm); + + final BackAction backAction = new BackAction(iControl); + backAction.setEnabled(false); + tbm.add(backAction); + final ForwardAction forwardAction = new ForwardAction(iControl); + tbm.add(forwardAction); + forwardAction.setEnabled(false); + + IInputChangedListener inputChangeListener= new IInputChangedListener() { + public void inputChanged(Object newInput) { + backAction.update(); + forwardAction.update(); + } + }; + iControl.addInputChangeListener(inputChangeListener); + + tbm.update(true); + + addLinkListener(iControl); + return iControl; + + } else { + return new DefaultInformationControl(parent, true); + } + } + } + + /** + * Hover control creator. + * + * @since 3.3 + */ + public static final class HoverControlCreator extends AbstractReusableInformationControlCreator { + /** + * The information presenter control creator. + * @since 3.4 + */ + private final IInformationControlCreator fInformationPresenterControlCreator; + /** + * true to use the additional info affordance, false to use the hover affordance. + */ + private final boolean fAdditionalInfoAffordance; + + /** + * @param informationPresenterControlCreator control creator for enriched hover + * @since 3.4 + */ + public HoverControlCreator(IInformationControlCreator informationPresenterControlCreator) { + this(informationPresenterControlCreator, false); + } + + /** + * @param informationPresenterControlCreator control creator for enriched hover + * @param additionalInfoAffordance true to use the additional info affordance, false to use the hover affordance + * @since 3.4 + */ + public HoverControlCreator(IInformationControlCreator informationPresenterControlCreator, boolean additionalInfoAffordance) { + fInformationPresenterControlCreator = informationPresenterControlCreator; + fAdditionalInfoAffordance = additionalInfoAffordance; + } + + /* + * @see org.eclipse.jdt.internal.ui.text.java.hover.AbstractReusableInformationControlCreator#doCreateInformationControl(org.eclipse.swt.widgets.Shell) + */ + public IInformationControl doCreateInformationControl(Shell parent) { + String tooltipAffordanceString = fAdditionalInfoAffordance ? "showTextHoverAffordance" : EditorsUI.getTooltipAffordanceString(); + if (CDocBrowserInformationControl.isAvailable(parent)) { + String font= PreferenceConstants.EDITOR_TEXT_FONT; + CDocBrowserInformationControl iControl = new CDocBrowserInformationControl(parent, font, tooltipAffordanceString) { + /* + * @see org.eclipse.jface.text.IInformationControlExtension5#getInformationPresenterControlCreator() + */ + public IInformationControlCreator getInformationPresenterControlCreator() { + return fInformationPresenterControlCreator; + } + }; + addLinkListener(iControl); + return iControl; + } else { + return new DefaultInformationControl(parent, tooltipAffordanceString); + } + } + + /* + * @see org.eclipse.jdt.internal.ui.text.java.hover.AbstractReusableInformationControlCreator#canReuse(org.eclipse.jface.text.IInformationControl) + */ + public boolean canReuse(IInformationControl control) { + if (!super.canReuse(control)) + return false; + + if (control instanceof IInformationControlExtension4) { + String tooltipAffordanceString = fAdditionalInfoAffordance ? "showTextHoverAffordance" : EditorsUI.getTooltipAffordanceString(); + ((IInformationControlExtension4)control).setStatusText(tooltipAffordanceString); + } + + return true; + } + } + + /** + * The hover control creator. + * + * @since 3.2 + */ + private IInformationControlCreator fHoverControlCreator; + /** + * The presentation control creator. + * + * @since 3.2 + */ + private IInformationControlCreator fPresenterControlCreator; } diff --git a/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CElementLinks.java b/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CElementLinks.java new file mode 100644 index 0000000..4430dc1 --- /dev/null +++ b/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CElementLinks.java @@ -0,0 +1,100 @@ +package org.eclipse.cdt.internal.ui.text.c.hover; + +import java.io.File; +import java.net.URI; +import java.net.URISyntaxException; + +import org.eclipse.swt.browser.Browser; +import org.eclipse.swt.browser.LocationAdapter; +import org.eclipse.swt.browser.LocationEvent; +import org.eclipse.swt.browser.LocationListener; + +/** + * Links inside doxygen hovers. + */ +public class CElementLinks { + /** + * A handler is asked to handle links to targets. + */ + public interface ILinkHandler { + + /** + * Handle normal kind of link to given target. + * + * @param target the target to show + */ + void handleInlineCDocLink(String target); + + /** + * Informs the handler that the text of the browser was set. + */ + void handleTextSet(); + } + + public static final String CDOC_SCHEME= "file"; //$NON-NLS-1$ + public static int isSet = 0; + + private CElementLinks() { + // static only + } + + /** + * Creates a location listener which uses the given handler + * to handle java element links. + * + * The location listener can be attached to a {@link Browser} + * + * @param handler the handler to use to handle links + * @return a new {@link LocationListener} + */ + public static LocationListener createLocationListener(final ILinkHandler handler) { + return new LocationAdapter() { + public void changing(LocationEvent event) { + String loc = event.location; + if (CElementLinks.isSet == 1) { + CElementLinks.isSet = 0; + return; + } + + if ("about:blank".equals(loc)) { //$NON-NLS-1$ + /* + * Using the Browser.setText API triggers a location change to "about:blank". + * XXX: remove this code once https://bugs.eclipse.org/bugs/show_bug.cgi?id=130314 is fixed + */ + //input set with setText + handler.handleTextSet(); + return; + } + + event.doit= false; + + if (loc.startsWith("about:")) { //$NON-NLS-1$ + // Relative links should be handled via head > base tag. + // If no base is available, links just won't work. + return; + } + + URI uri; + try { + uri= new URI(loc); + } catch (URISyntaxException e) { + // try it with a file (workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=237903 ): + File file= new File(loc); + if (!file.exists()) { + //JavaPlugin.log(e); + return; + } + uri = file.toURI(); + loc = uri.toASCIIString(); + } + + String scheme = uri.getScheme(); + if (CElementLinks.CDOC_SCHEME.equals(scheme)) { + String uriString = uri.toString(); + handler.handleInlineCDocLink(uriString.substring(uriString.lastIndexOf("/") + 1, uriString.length())); + event.doit= true; + } + } + }; + } +} diff --git a/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CHoverMessages.java b/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CHoverMessages.java index 9838be3..6f63c01 100644 --- a/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CHoverMessages.java +++ b/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CHoverMessages.java @@ -33,6 +33,9 @@ public final class CHoverMessages extends NLS { public static String CSourceHover_jobTitle; + public static String CDocHover_back; + public static String CDocHover_forward; + static { NLS.initializeMessages(CHoverMessages.class.getName(), CHoverMessages.class); } diff --git a/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CHoverMessages.properties b/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CHoverMessages.properties index cb14e7a..b44e269 100644 --- a/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CHoverMessages.properties +++ b/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CHoverMessages.properties @@ -26,3 +26,6 @@ CMacroExpansionControl_title_original=Original CMacroExpansionInput_jobTitle= Computing Macro Expansion CSourceHover_jobTitle= Computing Source + +CDocHover_back=Back +CDocHover_forward=Forward diff --git a/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/DOMCompletionProposalComputer.java b/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/DOMCompletionProposalComputer.java index 969caba..ced0020 100644 --- a/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/DOMCompletionProposalComputer.java +++ b/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/DOMCompletionProposalComputer.java @@ -17,25 +17,24 @@ package org.eclipse.cdt.internal.ui.text.contentassist; import java.util.ArrayList; import java.util.List; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITypedRegion; -import org.eclipse.jface.text.TextUtilities; -import org.eclipse.jface.text.contentassist.ICompletionProposal; -import org.eclipse.swt.graphics.Image; - +import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.core.IPositionConverter; +import org.eclipse.cdt.core.dom.IName; import org.eclipse.cdt.core.dom.ast.ASTTypeUtil; import org.eclipse.cdt.core.dom.ast.DOMException; import org.eclipse.cdt.core.dom.ast.IASTCompletionContext; import org.eclipse.cdt.core.dom.ast.IASTCompletionNode; import org.eclipse.cdt.core.dom.ast.IASTDeclarator; +import org.eclipse.cdt.core.dom.ast.IASTFileLocation; +import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition; import org.eclipse.cdt.core.dom.ast.IASTFunctionStyleMacroParameter; import org.eclipse.cdt.core.dom.ast.IASTIdExpression; import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTNamedTypeSpecifier; +import org.eclipse.cdt.core.dom.ast.IASTNode; import org.eclipse.cdt.core.dom.ast.IASTPreprocessorFunctionStyleMacroDefinition; import org.eclipse.cdt.core.dom.ast.IASTPreprocessorMacroDefinition; +import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.ICompositeType; import org.eclipse.cdt.core.dom.ast.IEnumeration; @@ -43,7 +42,9 @@ import org.eclipse.cdt.core.dom.ast.IEnumerator; import org.eclipse.cdt.core.dom.ast.IField; import org.eclipse.cdt.core.dom.ast.IFunction; import org.eclipse.cdt.core.dom.ast.IFunctionType; +import org.eclipse.cdt.core.dom.ast.IMacroBinding; import org.eclipse.cdt.core.dom.ast.IParameter; +import org.eclipse.cdt.core.dom.ast.IProblemBinding; import org.eclipse.cdt.core.dom.ast.IScope; import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.ITypedef; @@ -62,13 +63,18 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate; import org.eclipse.cdt.core.dom.ast.cpp.ICPPMember; import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod; import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter; import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; +import org.eclipse.cdt.core.dom.ast.gnu.c.ICASTKnRFunctionDeclarator; +import org.eclipse.cdt.core.index.IIndex; +import org.eclipse.cdt.core.index.IIndexName; +import org.eclipse.cdt.core.model.ITranslationUnit; +import org.eclipse.cdt.core.model.IWorkingCopy; import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; import org.eclipse.cdt.core.parser.util.CharArrayUtils; import org.eclipse.cdt.core.parser.util.IContentAssistMatcher; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.text.ICPartitions; - import org.eclipse.cdt.internal.core.dom.parser.c.CBuiltinParameter; import org.eclipse.cdt.internal.core.dom.parser.c.CBuiltinVariable; import org.eclipse.cdt.internal.core.dom.parser.c.CImplicitFunction; @@ -80,8 +86,36 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPImplicitMethod; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPImplicitTypedef; import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.AccessContext; import org.eclipse.cdt.internal.core.parser.util.ContentAssistMatcherFactory; - +import org.eclipse.cdt.internal.ui.text.CHeuristicScanner; +import org.eclipse.cdt.internal.ui.util.EditorUtility; import org.eclipse.cdt.internal.ui.viewsupport.CElementImageProvider; +import org.eclipse.cdt.ui.CUIPlugin; +import org.eclipse.cdt.ui.IWorkingCopyManager; +import org.eclipse.cdt.ui.text.ICPartitions; +import org.eclipse.core.filebuffers.FileBuffers; +import org.eclipse.core.filebuffers.ITextFileBuffer; +import org.eclipse.core.filebuffers.ITextFileBufferManager; +import org.eclipse.core.filebuffers.LocationKind; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Path; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.text.BadLocationException; +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.IRegion; +import org.eclipse.jface.text.ITypedRegion; +import org.eclipse.jface.text.Region; +import org.eclipse.jface.text.TextUtilities; +import org.eclipse.jface.text.contentassist.ICompletionProposal; +import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; /** * Searches the DOM (both the AST and the index) for completion proposals. @@ -89,20 +123,42 @@ import org.eclipse.cdt.internal.ui.viewsupport.CElementImageProvider; * @author Bryan Wilkinson */ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer { + private final IProgressMonitor fMonitor; + private ITranslationUnit fTU; /** * Default constructor is required (executable extension). */ public DOMCompletionProposalComputer() { + fMonitor = new NullProgressMonitor(); + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + IWorkingCopy copy = null; + if (window != null) { + IWorkbenchPage page = window.getActivePage(); + if (page != null) { + IEditorPart editor = page.getActiveEditor(); + if (editor != null) { + IEditorInput input = editor.getEditorInput(); + IWorkingCopyManager manager = CUIPlugin.getDefault().getWorkingCopyManager(); + copy = manager.getWorkingCopy(input); + fTU = copy; + } + } + } } - + @Override protected List computeCompletionProposals( CContentAssistInvocationContext context, - IASTCompletionNode completionNode, String prefix) { + IASTCompletionNode completionNode, String prefix) throws CoreException { List proposals = new ArrayList(); - + + int indices[] = new int[200]; + for (int i = 0; i < indices.length; i++) { + indices[i] = -1; + } + if (inPreprocessorDirective(context)) { if (!inPreprocessorKeyword(context)) { // add only macros @@ -116,6 +172,9 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer addMacroProposals(context, prefix, proposals); } } else { + IASTTranslationUnit ast = completionNode.getTranslationUnit(); + String source = null; + boolean handleMacros= false; IASTName[] names = completionNode.getNames(); @@ -123,7 +182,7 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer if (name.getTranslationUnit() == null) // The node isn't properly hooked up, must have backtracked out of this node continue; - + IASTCompletionContext astContext = name.getCompletionContext(); if (astContext == null) { continue; @@ -132,14 +191,25 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer // handle macros only if there is a prefix handleMacros = prefix.length() > 0; } - + IBinding[] bindings = astContext.findBindings(name, !context.isContextInformationStyle()); - + if (bindings != null) { + int index = 0; + int index2 = 0; AccessContext accessibilityContext = new AccessContext(name); for (IBinding binding : bindings) { - if (accessibilityContext.isAccessible(binding)) + if (accessibilityContext.isAccessible(binding)) { handleBinding(binding, context, prefix, astContext, proposals); + + source = computeSourceForBinding(ast, binding); + if (source != null) { + if ( !source.contains("@class") && !source.contains("@interface") && source.contains("@internal") ) { + indices[index2++] = index; + } + index++; + } + } } } } @@ -147,11 +217,435 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer if (handleMacros) addMacroProposals(context, prefix, proposals); } - + + for (int i = indices.length - 1; i > -1; i--) { + if (indices[i] != -1) { + proposals.remove(indices[i]); + } + } + return proposals; } /** + * Find a definition or declaration for the given binding and returns the source for it. + * Definitions are preferred over declarations. In case of multiple definitions or declarations, + * and the first name which yields source is taken. + * + * @param ast the AST of the translation unit + * @param binding the binding + * @return a source string or null, if no source could be computed + * @throws CoreException if the source file could not be loaded or if there was a + * problem with the index + */ + private String computeSourceForBinding(IASTTranslationUnit ast, IBinding binding) throws CoreException { + IName[] names = findDefsOrDecls(ast, binding); + + // in case the binding is a non-explicit specialization we need + // to consider the original binding (bug 281396) + if (names.length == 0 && binding instanceof ICPPSpecialization) { + binding= ((ICPPSpecialization) binding).getSpecializedBinding(); + if (!(binding instanceof IProblemBinding)) { + names= findDefsOrDecls(ast, binding); + } + } + if (names.length > 0) { + for (IName name : names) { + String source= computeSourceForName(name, binding); + if (source != null) { + return source; + } + } + } + return null; + } + /** + * Search for definitions or declarations for the given binding. + * @param ast the AST of the translation unit + * @param binding the binding + * @return an array of definitions or declarations, never null + * @throws CoreException + */ + private IName[] findDefsOrDecls(IASTTranslationUnit ast, IBinding binding) throws CoreException { + IName[] names= findDefinitions(ast, binding); + if (names.length == 0) { + names= findDeclarations(ast, binding); + } + return names; + } + /** + * Search for definitions for the given binding. + * + * @param ast the AST of the translation unit + * @param binding the binding + * @return an array of definitions, never null + * @throws CoreException + */ + private IName[] findDefinitions(IASTTranslationUnit ast, IBinding binding) throws CoreException { + IName[] declNames= ast.getDefinitionsInAST(binding); + if (declNames.length == 0 && ast.getIndex() != null) { + // search definitions in index + declNames = ast.getIndex().findNames(binding, IIndex.FIND_DEFINITIONS | IIndex.SEARCH_ACROSS_LANGUAGE_BOUNDARIES); + } + return declNames; + } + /** + * Search for declarations for the given binding. + * + * @param ast the AST of the translation unit + * @param binding the binding + * @return an array of declarations, never null + * @throws CoreException + */ + private IName[] findDeclarations(IASTTranslationUnit ast, IBinding binding) throws CoreException { + IName[] declNames= ast.getDeclarationsInAST(binding); + if (declNames.length == 0 && ast.getIndex() != null) { + // search declarations in index + declNames= ast.getIndex().findNames(binding, IIndex.FIND_DECLARATIONS | IIndex.SEARCH_ACROSS_LANGUAGE_BOUNDARIES); + } + return declNames; + } + /** + * Get the source for the given name from the underlying file. + * + * @param name the name to get the source for + * @param binding the binding of the name + * @return the source string or null, if the source could not be computed + * @throws CoreException if the file could not be loaded + */ + private String computeSourceForName(IName name, IBinding binding) throws CoreException { + IASTFileLocation fileLocation= name.getFileLocation(); + if (fileLocation == null) { + return null; + } + int nodeOffset= fileLocation.getNodeOffset(); + int nodeLength= fileLocation.getNodeLength(); + + String fileName= fileLocation.getFileName(); + //if (DEBUG) System.out.println("[CSourceHover] Computing source for " + name + " in " + fileName); //$NON-NLS-1$//$NON-NLS-2$ + IPath location= Path.fromOSString(fileName); + LocationKind locationKind= LocationKind.LOCATION; + if (name instanceof IASTName && !name.isReference()) { + IASTName astName= (IASTName)name; + if (astName.getTranslationUnit().getFilePath().equals(fileName) && fTU.getResource() != null) { + // reuse editor buffer for names local to the translation unit + location= fTU.getResource().getFullPath(); + locationKind= LocationKind.IFILE; + } + } else { + // try to resolve path to a resource for proper encoding (bug 221029) + IFile file= EditorUtility.getWorkspaceFileAtLocation(location, fTU); + if (file != null) { + location= file.getFullPath(); + locationKind= LocationKind.IFILE; + if (name instanceof IIndexName) { + // need to adjust index offsets to current offsets + // in case file has been modified since last index time + IIndexName indexName= (IIndexName) name; + long timestamp= indexName.getFile().getTimestamp(); + IPositionConverter converter= CCorePlugin.getPositionTrackerManager().findPositionConverter(file, timestamp); + if (converter != null) { + IRegion currentLocation= converter.historicToActual(new Region(nodeOffset, nodeLength)); + nodeOffset= currentLocation.getOffset(); + nodeLength= currentLocation.getLength(); + } + } + } + } + ITextFileBufferManager mgr= FileBuffers.getTextFileBufferManager(); + mgr.connect(location, locationKind, fMonitor); + ITextFileBuffer buffer= mgr.getTextFileBuffer(location, locationKind); + try { + IRegion nameRegion= new Region(nodeOffset, nodeLength); + final int nameOffset= nameRegion.getOffset(); + final int sourceStart; + final int sourceEnd; + IDocument doc= buffer.getDocument(); + if (nameOffset >= doc.getLength() || nodeLength <= 0) { + return null; + } + if (binding instanceof IMacroBinding) { + ITypedRegion partition= TextUtilities.getPartition(doc, ICPartitions.C_PARTITIONING, nameOffset, false); + if (ICPartitions.C_PREPROCESSOR.equals(partition.getType())) { + int directiveStart= partition.getOffset(); + int commentStart= searchCommentBackward(doc, directiveStart, -1); + if (commentStart >= 0) { + sourceStart= commentStart; + } else { + sourceStart= directiveStart; + } + sourceEnd= directiveStart + partition.getLength(); + } else { + return null; + } + } else { + // expand source range to include preceding comment, if any + boolean isKnR= isKnRSource(name); + sourceStart= computeSourceStart(doc, nameOffset, binding, isKnR); + if (sourceStart == CHeuristicScanner.NOT_FOUND) { + return null; + } + sourceEnd= computeSourceEnd(doc, nameOffset + nameRegion.getLength(), binding, name.isDefinition(), isKnR); + } + String source= buffer.getDocument().get(sourceStart, sourceEnd - sourceStart); + return source; + + } catch (BadLocationException exc) { + // ignore - should not happen anyway + //if (DEBUG) exc.printStackTrace(); + } finally { + mgr.disconnect(location, LocationKind.LOCATION, fMonitor); + } + return null; + } + /** + * Searches the start of the comment preceding the given source offset. + * Continuous line comments are considered as one comment until a block + * comment is reached or a non-comment partition. + * + * @param doc the document + * @param start the start of the backward search + * @param bound search boundary (exclusive) + * @return the comment start offset or -1, if no suitable comment was found + * @throws BadLocationException + */ + private static int searchCommentBackward(IDocument doc, int start, int bound) throws BadLocationException { + int firstLine= doc.getLineOfOffset(start); + if (firstLine == 0) { + return 0; + } + ITypedRegion partition= TextUtilities.getPartition(doc, ICPartitions.C_PARTITIONING, start, true); + int currentOffset= Math.max(doc.getLineOffset(firstLine - 1), partition.getOffset() - 1); + int commentOffset= -1; + while (currentOffset > bound) { + partition= TextUtilities.getPartition(doc, ICPartitions.C_PARTITIONING, currentOffset, true); + currentOffset= partition.getOffset() - 1; + if (ICPartitions.C_MULTI_LINE_COMMENT.equals(partition.getType()) + || ICPartitions.C_MULTI_LINE_DOC_COMMENT.equals(partition.getType())) { + final int partitionOffset= partition.getOffset(); + final int startLine= doc.getLineOfOffset(partitionOffset); + final int lineOffset= doc.getLineOffset(startLine); + if (partitionOffset == lineOffset || + doc.get(lineOffset, partitionOffset - lineOffset).trim().length() == 0) { + return lineOffset; + } + return commentOffset; + } else if (ICPartitions.C_SINGLE_LINE_COMMENT.equals(partition.getType()) + || ICPartitions.C_SINGLE_LINE_DOC_COMMENT.equals(partition.getType())) { + final int partitionOffset= partition.getOffset(); + final int startLine= doc.getLineOfOffset(partitionOffset); + final int lineOffset= doc.getLineOffset(startLine); + if (partitionOffset == lineOffset || + doc.get(lineOffset, partitionOffset - lineOffset).trim().length() == 0) { + commentOffset= lineOffset; + continue; + } + return commentOffset; + } else if (IDocument.DEFAULT_CONTENT_TYPE.equals(partition.getType())) { + if (doc.get(partition.getOffset(), partition.getLength()).trim().length() == 0) { + continue; + } + if (commentOffset >= 0) { + break; + } + } else { + break; + } + } + return commentOffset; + } + /** + * Determine if the name is part of a KnR function definition. + * @param name + * @return true if the name is part of a KnR function + */ + private boolean isKnRSource(IName name) { + if (name instanceof IASTName) { + IASTNode node= (IASTNode)name; + while (node.getParent() != null) { + if (node instanceof ICASTKnRFunctionDeclarator) { + return node.getParent() instanceof IASTFunctionDefinition; + } + node= node.getParent(); + } + } + return false; + } + private int computeSourceStart(IDocument doc, int nameOffset, IBinding binding, boolean isKnR) throws BadLocationException { + int sourceStart= nameOffset; + CHeuristicScanner scanner= new CHeuristicScanner(doc); + if (binding instanceof IParameter) { + if (isKnR) { + sourceStart= scanner.scanBackward(nameOffset, CHeuristicScanner.UNBOUND, new char[] { ')', ';' }); + } else { + sourceStart= scanner.scanBackward(nameOffset, CHeuristicScanner.UNBOUND, new char[] { '>', '(', ',' }); + if (sourceStart > 0 && doc.getChar(sourceStart) == '>') { + sourceStart= scanner.findOpeningPeer(sourceStart - 1, '<', '>'); + if (sourceStart > 0) { + sourceStart= scanner.scanBackward(sourceStart, CHeuristicScanner.UNBOUND, new char[] { '(', ',' }); + } + } + } + if (sourceStart == CHeuristicScanner.NOT_FOUND) { + return sourceStart; + } + sourceStart= scanner.findNonWhitespaceForward(sourceStart + 1, nameOffset); + if (sourceStart == CHeuristicScanner.NOT_FOUND) { + sourceStart = nameOffset; + } + } else if (binding instanceof ICPPTemplateParameter) { + sourceStart= scanner.scanBackward(nameOffset, CHeuristicScanner.UNBOUND, new char[] { '>', '<', ',' }); + if (sourceStart > 0 && doc.getChar(sourceStart) == '>') { + sourceStart= scanner.findOpeningPeer(sourceStart - 1, '<', '>'); + if (sourceStart > 0) { + sourceStart= scanner.scanBackward(sourceStart, CHeuristicScanner.UNBOUND, new char[] { '<', ',' }); + } + } + if (sourceStart == CHeuristicScanner.NOT_FOUND) { + return sourceStart; + } + sourceStart= scanner.findNonWhitespaceForward(sourceStart + 1, nameOffset); + if (sourceStart == CHeuristicScanner.NOT_FOUND) { + sourceStart = nameOffset; + } + } else if (binding instanceof IEnumerator) { + sourceStart= scanner.scanBackward(nameOffset, CHeuristicScanner.UNBOUND, new char[] { '{', ',' }); + if (sourceStart == CHeuristicScanner.NOT_FOUND) { + return sourceStart; + } + sourceStart= scanner.findNonWhitespaceForward(sourceStart + 1, nameOffset); + if (sourceStart == CHeuristicScanner.NOT_FOUND) { + sourceStart = nameOffset; + } + } else { + final boolean expectClosingBrace; + IType type= null; + if (binding instanceof ITypedef) { + type= ((ITypedef)binding).getType(); + } else if (binding instanceof IVariable) { + type= ((IVariable)binding).getType(); + } + expectClosingBrace= type instanceof ICompositeType || type instanceof IEnumeration; + final int nameLine= doc.getLineOfOffset(nameOffset); + sourceStart= nameOffset; + int commentBound; + if (isKnR) { + commentBound= scanner.scanBackward(sourceStart, CHeuristicScanner.UNBOUND, new char[] { ')', ';' }); + } else { + commentBound= scanner.scanBackward(sourceStart, CHeuristicScanner.UNBOUND, new char[] { '{', '}', ';' }); + } + while (expectClosingBrace && commentBound > 0 && doc.getChar(commentBound) == '}') { + int openingBrace= scanner.findOpeningPeer(commentBound - 1, '{', '}'); + if (openingBrace != CHeuristicScanner.NOT_FOUND) { + sourceStart= openingBrace - 1; + } + if (isKnR) { + commentBound= scanner.scanBackward(sourceStart, CHeuristicScanner.UNBOUND, new char[] { ')', ';' }); + } else { + commentBound= scanner.scanBackward(sourceStart, CHeuristicScanner.UNBOUND, new char[] { '{', '}', ';' }); + } + } + if (commentBound == CHeuristicScanner.NOT_FOUND) { + commentBound= -1; // unbound + } + sourceStart= Math.min(sourceStart, doc.getLineOffset(nameLine)); + int commentStart= searchCommentBackward(doc, sourceStart, commentBound); + if (commentStart >= 0) { + sourceStart= commentStart; + } else { + int nextNonWS= scanner.findNonWhitespaceForward(commentBound+1, sourceStart); + if (nextNonWS != CHeuristicScanner.NOT_FOUND) { + int nextNonWSLine= doc.getLineOfOffset(nextNonWS); + int lineOffset= doc.getLineOffset(nextNonWSLine); + if (doc.get(lineOffset, nextNonWS - lineOffset).trim().length() == 0) { + sourceStart= doc.getLineOffset(nextNonWSLine); + } + } + } + } + return sourceStart; + } + private int computeSourceEnd(IDocument doc, int start, IBinding binding, boolean isDefinition, boolean isKnR) throws BadLocationException { + int sourceEnd= start; + CHeuristicScanner scanner= new CHeuristicScanner(doc); + // expand forward to the end of the definition/declaration + boolean searchBrace= false; + boolean searchSemi= false; + boolean searchComma= false; + if (binding instanceof ICompositeType || binding instanceof IEnumeration) { + searchBrace= true; + } else if (binding instanceof ICPPTemplateDefinition) { + searchBrace= true; + } else if (binding instanceof IFunction && isDefinition) { + searchBrace= true; + } else if (binding instanceof IParameter) { + if (isKnR) { + searchSemi= true; + } else { + searchComma= true; + } + } else if (binding instanceof IEnumerator || binding instanceof ICPPTemplateParameter) { + searchComma= true; + } else if (binding instanceof IVariable || binding instanceof ITypedef) { + searchSemi= true; + } else if (!isDefinition) { + searchSemi= true; + } + if (searchBrace) { + int brace= scanner.scanForward(start, CHeuristicScanner.UNBOUND, '{'); + if (brace != CHeuristicScanner.NOT_FOUND) { + sourceEnd= scanner.findClosingPeer(brace + 1, '{', '}'); + if (sourceEnd == CHeuristicScanner.NOT_FOUND) { + sourceEnd= doc.getLength(); + } + } + // expand region to include whole line + IRegion lineRegion= doc.getLineInformationOfOffset(sourceEnd); + sourceEnd= lineRegion.getOffset() + lineRegion.getLength(); + } else if (searchSemi) { + int semi= scanner.scanForward(start, CHeuristicScanner.UNBOUND, ';'); + if (semi != CHeuristicScanner.NOT_FOUND) { + sourceEnd= semi+1; + } + // expand region to include whole line + IRegion lineRegion= doc.getLineInformationOfOffset(sourceEnd); + sourceEnd= lineRegion.getOffset() + lineRegion.getLength(); + } else if (searchComma) { + int bound; + if (binding instanceof IParameter) { + bound= scanner.findClosingPeer(start, '(', ')'); + } else if (binding instanceof ICPPTemplateParameter) { + bound= scanner.findClosingPeer(start, '<', '>'); + } else if (binding instanceof IEnumerator) { + bound= scanner.findClosingPeer(start, '{', '}'); + } else { + bound = CHeuristicScanner.NOT_FOUND; + } + if (bound == CHeuristicScanner.NOT_FOUND) { + bound= Math.min(doc.getLength(), start + 100); + } + int comma= scanner.scanForward(start, bound, ','); + if (comma == CHeuristicScanner.NOT_FOUND) { + // last argument + sourceEnd= bound; + } else { + sourceEnd= comma; + // expand region to include whole line if rest is comment + IRegion lineRegion= doc.getLineInformationOfOffset(sourceEnd); + int lineEnd= lineRegion.getOffset() + lineRegion.getLength(); + int nextNonWS= scanner.findNonWhitespaceForwardInAnyPartition(sourceEnd + 1, lineEnd); + if (nextNonWS != CHeuristicScanner.NOT_FOUND) { + String contentType= TextUtilities.getContentType(doc, ICPartitions.C_PARTITIONING, nextNonWS, false); + if (ICPartitions.C_MULTI_LINE_COMMENT.equals(contentType) || ICPartitions.C_SINGLE_LINE_COMMENT.equals(contentType)) { + sourceEnd= lineEnd; + } + } + } + } + return sourceEnd; + } + + /** * Test whether the invocation offset is inside or before the preprocessor directive keyword. * * @param context the invocation context diff --git a/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CUIPreferenceInitializer.java b/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CUIPreferenceInitializer.java index 60d6458..deb2213 100644 --- a/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CUIPreferenceInitializer.java +++ b/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CUIPreferenceInitializer.java @@ -10,6 +10,14 @@ *******************************************************************************/ package org.eclipse.cdt.ui; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.util.Enumeration; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; + import org.eclipse.cdt.internal.ui.cview.CView; import org.eclipse.cdt.internal.ui.editor.SemanticHighlightings; import org.eclipse.cdt.internal.ui.preferences.BuildConsolePreferencePage; @@ -18,6 +26,7 @@ import org.eclipse.cdt.internal.ui.preferences.CPluginPreferencePage; import org.eclipse.cdt.internal.ui.preferences.CodeAssistPreferencePage; import org.eclipse.cdt.internal.ui.preferences.WorkInProgressPreferencePage; +import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.ui.editors.text.EditorsUI; @@ -30,7 +39,13 @@ import org.eclipse.ui.texteditor.AbstractTextEditor; * @noextend This class is not intended to be subclassed by clients. */ public class CUIPreferenceInitializer extends AbstractPreferenceInitializer { - + + private static boolean isFirst = true; + private static final String path = "plugins"; + private static final String fileName = "org.tizen.cpp.apireference"; + public static String doxygenJarFilePath; + public static String doxygenDirectoryPath; + /* (non-Javadoc) * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() */ @@ -38,7 +53,7 @@ public class CUIPreferenceInitializer extends AbstractPreferenceInitializer { public void initializeDefaultPreferences() { final IPreferenceStore store = CUIPlugin.getDefault().getPreferenceStore(); - PreferenceConstants.initializeDefaultValues(store); + PreferenceConstants.initializeDefaultValues(store); CPluginPreferencePage.initDefaults(store); BuildConsolePreferencePage.initDefaults(store); CView.initDefaults(store); @@ -52,14 +67,86 @@ public class CUIPreferenceInitializer extends AbstractPreferenceInitializer { // All of those settings are now in the workbench "All TextEditor" preference Page. // Later we should remove this calls, after CDT-3.0 EditorsUI.useAnnotationsPreferencePage(store); - EditorsUI.useQuickDiffPreferencePage(store); + EditorsUI.useQuickDiffPreferencePage(store); useTextEditorPreferencePage(store); + + if (isFirst == true) { + setPath(); + extractJarFile(); + } + } + + /** + * Set doxygenJarFilePath and doxygenDirectoryPath. + */ + private void setPath() { + isFirst = false; + String eclipseRootPath = Platform.getInstallLocation().getURL().getPath(); + // In Windows, path is like /D:/works/workspace/slp/indigo-winpde/eclipse/ + if (System.getProperty("os.name").startsWith("Windows")) + eclipseRootPath = eclipseRootPath.substring(1, eclipseRootPath.length()); + + String eclipsePluginPath = eclipseRootPath + path; + String doxygenJarFileName = null; + File file = new File(eclipsePluginPath); + File fileList[] = file.listFiles(); + for (int i = 0; i < fileList.length; i++) { + if (fileList[i].getName().contains(fileName)) { + doxygenJarFileName = fileList[i].getName(); + } + } + + doxygenJarFilePath = eclipseRootPath + path + "/" + doxygenJarFileName; + doxygenDirectoryPath = eclipseRootPath + path + "/" + fileName; + } + + /** + * Extract jar file. + */ + private void extractJarFile() { + try { + JarFile jarFile = new JarFile(doxygenJarFilePath); + File destinationDir = new File(doxygenDirectoryPath); + if (!destinationDir.exists()) { + destinationDir.mkdirs(); + } else if (destinationDir.exists()) { + return; + } + for (Enumeration entries = jarFile.entries(); entries.hasMoreElements(); ) { + JarEntry entry = entries.nextElement(); + if (entry.isDirectory()) { + if (entry.getName().toUpperCase().indexOf("META-INF") != -1) { + continue; + } + File newDirectory = new File(destinationDir, entry.getName()); + newDirectory.mkdirs(); + } else { + if (entry.getName().toUpperCase().indexOf("META-INF") != -1) { + continue; + } + File output = new File(destinationDir, entry.getName()); + InputStream inputStream = jarFile.getInputStream(entry); + BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(output)); + byte[] buf = new byte[4096]; + int read = -1; + while ( (read = inputStream.read(buf)) != -1 ) { + outputStream.write(buf, 0, read); + } + outputStream.flush(); + inputStream.close(); + outputStream.close(); + } + } + } catch (Exception e) { + // + } } /* - * Reset to default, those constants that are no longer maintained in CUIPlugin store. + * reset to default, those constants are no longer maintain int CUIPlugin store. */ public static void useTextEditorPreferencePage(IPreferenceStore store) { + store.setToDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE); store.setToDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR); @@ -88,4 +175,5 @@ public class CUIPreferenceInitializer extends AbstractPreferenceInitializer { store.setToDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_DISABLE_OVERWRITE_MODE); store.setToDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SMART_HOME_END); } + } diff --git a/org.eclipse.jst.pagedesigner.patch/META-INF/MANIFEST.MF b/org.eclipse.jst.pagedesigner.patch/META-INF/MANIFEST.MF index 4cfafd0..ab13cc9 100644 --- a/org.eclipse.jst.pagedesigner.patch/META-INF/MANIFEST.MF +++ b/org.eclipse.jst.pagedesigner.patch/META-INF/MANIFEST.MF @@ -8,5 +8,5 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Eclipse-PatchFragment: true Bundle-ClassPath: patch.jar, . -Bundle-Vendor: Samsung +Bundle-Vendor: Samsung Electronics diff --git a/org.eclipse.jst.pagedesigner.patch/src/org/eclipse/jst/pagedesigner/editors/HTMLEditor.java b/org.eclipse.jst.pagedesigner.patch/src/org/eclipse/jst/pagedesigner/editors/HTMLEditor.java index 20e2188..1363700 100755 --- a/org.eclipse.jst.pagedesigner.patch/src/org/eclipse/jst/pagedesigner/editors/HTMLEditor.java +++ b/org.eclipse.jst.pagedesigner.patch/src/org/eclipse/jst/pagedesigner/editors/HTMLEditor.java @@ -1035,6 +1035,7 @@ public final class HTMLEditor extends MultiPageEditorPart implements try { String url = file.getLocationURI().toURL().toString(); getPreviewBrowser().getBrowser().setUrl(url); + getPreviewBrowser().getBrowser().refresh(); } catch (Exception e) { getPreviewBrowser().getBrowser().setUrl("about:blank"); //$NON-NLS-1$ } diff --git a/org.eclipse.wst.jsdt.core/.classpath b/org.eclipse.wst.jsdt.core/.classpath new file mode 100644 index 0000000..ce73933 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.eclipse.wst.jsdt.core/.project b/org.eclipse.wst.jsdt.core/.project new file mode 100644 index 0000000..c508d53 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/.project @@ -0,0 +1,34 @@ + + + org.eclipse.wst.jsdt.core + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.wst.jsdt.core.javascriptValidator + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/org.eclipse.wst.jsdt.core/.settings/.jsdtscope b/org.eclipse.wst.jsdt.core/.settings/.jsdtscope new file mode 100644 index 0000000..ed6635a --- /dev/null +++ b/org.eclipse.wst.jsdt.core/.settings/.jsdtscope @@ -0,0 +1,5 @@ + + + + + diff --git a/org.eclipse.wst.jsdt.core/.settings/org.eclipse.core.resources.prefs b/org.eclipse.wst.jsdt.core/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..1cf13c6 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +#Wed Nov 07 11:22:55 CST 2007 +eclipse.preferences.version=1 +encoding/=ISO-8859-1 diff --git a/org.eclipse.wst.jsdt.core/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.wst.jsdt.core/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000..7ec5750 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,3 @@ +#Mon Apr 17 01:48:39 EDT 2006 +eclipse.preferences.version=1 +line.separator=\r\n diff --git a/org.eclipse.wst.jsdt.core/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.wst.jsdt.core/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..6e07215 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,96 @@ +#Wed Oct 24 19:49:45 EDT 2007 +eclipse.preferences.version=1 +org.eclipse.jdt.core.builder.cleanOutputFolder=clean +org.eclipse.jdt.core.builder.duplicateResourceTask=warning +org.eclipse.jdt.core.builder.invalidClasspath=ignore +org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch +org.eclipse.jdt.core.circularClasspath=error +org.eclipse.jdt.core.classpath.exclusionPatterns=enabled +org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.4 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.deprecation=ignore +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=ignore +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=error +org.eclipse.jdt.core.compiler.problem.unusedLabel=error +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.3 +org.eclipse.jdt.core.incompatibleJDKLevel=ignore +org.eclipse.jdt.core.incompleteClasspath=error diff --git a/org.eclipse.wst.jsdt.core/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.wst.jsdt.core/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..c91d09d --- /dev/null +++ b/org.eclipse.wst.jsdt.core/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,51 @@ +#Wed Oct 24 19:41:31 EDT 2007 +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=false +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_serial_version_id=true +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=true +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.format_source_code=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=false +cleanup.organize_imports=true +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=true +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=true +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_SSE Team Styles +cleanup_settings_version=2 +eclipse.preferences.version=1 +internal.default.compliance=default +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.overrideannotation=false +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/org.eclipse.wst.jsdt.core/.settings/org.eclipse.ltk.core.refactoring.prefs b/org.eclipse.wst.jsdt.core/.settings/org.eclipse.ltk.core.refactoring.prefs new file mode 100644 index 0000000..c59368c --- /dev/null +++ b/org.eclipse.wst.jsdt.core/.settings/org.eclipse.ltk.core.refactoring.prefs @@ -0,0 +1,3 @@ +#Tue Apr 04 03:36:32 EDT 2006 +eclipse.preferences.version=1 +org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/org.eclipse.wst.jsdt.core/.settings/org.eclipse.pde.prefs b/org.eclipse.wst.jsdt.core/.settings/org.eclipse.pde.prefs new file mode 100644 index 0000000..fc522bb --- /dev/null +++ b/org.eclipse.wst.jsdt.core/.settings/org.eclipse.pde.prefs @@ -0,0 +1,16 @@ +#Mon Apr 17 02:01:33 EDT 2006 +compilers.incompatible-environment=0 +compilers.p.build=0 +compilers.p.deprecated=1 +compilers.p.illegal-att-value=0 +compilers.p.no-required-att=0 +compilers.p.not-externalized-att=0 +compilers.p.unknown-attribute=0 +compilers.p.unknown-class=0 +compilers.p.unknown-element=0 +compilers.p.unknown-resource=0 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.p.unused-element-or-attribute=0 +compilers.use-project=true +eclipse.preferences.version=1 diff --git a/org.eclipse.wst.jsdt.core/.settings/org.eclipse.wst.jsdt.ui.superType.container b/org.eclipse.wst.jsdt.core/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..49c8cd4 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.JRE_CONTAINER \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/.settings/org.eclipse.wst.jsdt.ui.superType.name b/org.eclipse.wst.jsdt.core/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..7827809 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Object \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/META-INF/MANIFEST.MF b/org.eclipse.wst.jsdt.core/META-INF/MANIFEST.MF new file mode 100644 index 0000000..00a7556 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/META-INF/MANIFEST.MF @@ -0,0 +1,65 @@ +Manifest-Version: 1.0 +Bundle-SymbolicName: org.eclipse.wst.jsdt.core; singleton:=true +Bundle-Version: 1.1.101.v201108151912_patch +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-Vendor: %providerName +Export-Package: org.eclipse.wst.jsdt.core, + org.eclipse.wst.jsdt.core.ast, + org.eclipse.wst.jsdt.core.compiler, + org.eclipse.wst.jsdt.core.compiler.libraries, + org.eclipse.wst.jsdt.core.dom, + org.eclipse.wst.jsdt.core.dom.rewrite, + org.eclipse.wst.jsdt.core.eval, + org.eclipse.wst.jsdt.core.formatter, + org.eclipse.wst.jsdt.core.infer, + org.eclipse.wst.jsdt.core.search, + org.eclipse.wst.jsdt.core.util, + org.eclipse.wst.jsdt.internal.codeassist;x-friends:="org.eclipse.wst.jsdt.ui", + org.eclipse.wst.jsdt.internal.codeassist.complete;x-friends:="org.eclipse.wst.jsdt.ui", + org.eclipse.wst.jsdt.internal.codeassist.impl;x-friends:="org.eclipse.wst.jsdt.ui", + org.eclipse.wst.jsdt.internal.codeassist.select;x-friends:="org.eclipse.wst.jsdt.ui", + org.eclipse.wst.jsdt.internal.compiler;x-internal:=true, + org.eclipse.wst.jsdt.internal.compiler.ast;x-internal:=true, + org.eclipse.wst.jsdt.internal.compiler.batch;x-internal:=true, + org.eclipse.wst.jsdt.internal.compiler.classfmt;x-internal:=true, + org.eclipse.wst.jsdt.internal.compiler.env;x-internal:=true, + org.eclipse.wst.jsdt.internal.compiler.flow;x-internal:=true, + org.eclipse.wst.jsdt.internal.compiler.impl;x-internal:=true, + org.eclipse.wst.jsdt.internal.compiler.lookup;x-internal:=true, + org.eclipse.wst.jsdt.internal.compiler.parser;x-internal:=true, + org.eclipse.wst.jsdt.internal.compiler.parser.diagnose;x-internal:=true, + org.eclipse.wst.jsdt.internal.compiler.problem;x-internal:=true, + org.eclipse.wst.jsdt.internal.compiler.util;x-friends:="org.eclipse.wst.jsdt.ui,org.eclipse.wst.jsdt.web.core", + org.eclipse.wst.jsdt.internal.core;x-friends:="org.eclipse.wst.jsdt.ui,org.eclipse.wst.jsdt.web.core", + org.eclipse.wst.jsdt.internal.core.builder;x-internal:=true, + org.eclipse.wst.jsdt.internal.core.dom.rewrite;x-internal:=true, + org.eclipse.wst.jsdt.internal.core.hierarchy;x-internal:=true, + org.eclipse.wst.jsdt.internal.core.index;x-friends:="org.eclipse.wst.jsdt.ui,org.eclipse.wst.jsdt.web.core", + org.eclipse.wst.jsdt.internal.core.interpret;x-internal:=true, + org.eclipse.wst.jsdt.internal.core.interpret.builtin;x-internal:=true, + org.eclipse.wst.jsdt.internal.core.search;x-friends:="org.eclipse.wst.jsdt.ui,org.eclipse.wst.jsdt.web.core", + org.eclipse.wst.jsdt.internal.core.search.indexing;x-friends:="org.eclipse.wst.jsdt.ui,org.eclipse.wst.jsdt.web.core", + org.eclipse.wst.jsdt.internal.core.search.matching;x-internal:=true, + org.eclipse.wst.jsdt.internal.core.search.processing;x-friends:="org.eclipse.wst.jsdt.ui,org.eclipse.wst.jsdt.web.core", + org.eclipse.wst.jsdt.internal.core.util;x-friends:="org.eclipse.wst.jsdt.ui,org.eclipse.wst.jsdt.web.core", + org.eclipse.wst.jsdt.internal.formatter;x-friends:="org.eclipse.wst.jsdt.ui", + org.eclipse.wst.jsdt.internal.formatter.align;x-friends:="org.eclipse.wst.jsdt.ui", + org.eclipse.wst.jsdt.internal.formatter.comment;x-friends:="org.eclipse.wst.jsdt.ui", + org.eclipse.wst.jsdt.internal.oaametadata;x-friends:="org.eclipse.wst.jsdt.ui", + org.eclipse.wst.jsdt.launching, + org.eclipse.wst.jsdt.libraries +Import-Package: com.ibm.icu.text; version="3.8" +Bundle-Activator: org.eclipse.wst.jsdt.core.JavaScriptCore +Require-Bundle: org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)", + org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)", + org.eclipse.core.filesystem;bundle-version="[1.2.0,2.0.0)", + org.eclipse.text;bundle-version="[3.5.0,4.0.0)", + org.eclipse.team.core;bundle-version="[3.5.0,4.0.0)";resolution:=optional, + org.eclipse.debug.core;bundle-version="[3.5.0,4.0.0)" +Eclipse-LazyStart: true +Bundle-RequiredExecutionEnvironment: J2SE-1.4 +Main-Class: org.eclipse.wst.jsdt.internal.compiler.batch.Main +Bundle-Localization: plugin +Bundle-ActivationPolicy: lazy + diff --git a/org.eclipse.wst.jsdt.core/about.html b/org.eclipse.wst.jsdt.core/about.html new file mode 100644 index 0000000..4602330 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

June 2, 2006

+

License

+ +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

+ + + \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/build.properties b/org.eclipse.wst.jsdt.core/build.properties new file mode 100644 index 0000000..6df812e --- /dev/null +++ b/org.eclipse.wst.jsdt.core/build.properties @@ -0,0 +1,20 @@ +############################################################################### +# Copyright (c) 2005, 2007 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# IBM Corporation - initial API and implementation +############################################################################### +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + libraries/,\ + plugin.properties,\ + plugin.xml,\ + about.html +src.includes = grammar/,\ + schema/ diff --git a/org.eclipse.wst.jsdt.core/grammar/js.g b/org.eclipse.wst.jsdt.core/grammar/js.g new file mode 100644 index 0000000..ce10080 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/grammar/js.g @@ -0,0 +1,1313 @@ +--main options +%options ACTION, AN=JavaAction.java, GP=java, +%options FILE-PREFIX=java, ESCAPE=$, PREFIX=TokenName, OUTPUT-SIZE=125 , +%options NOGOTO-DEFAULT, SINGLE-PRODUCTIONS, LALR=1 , TABLE, + +--error recovering options..... +%options ERROR_MAPS + +--grammar understanding options +%options first follow +%options TRACE=FULL , +%options VERBOSE + +%options DEFERRED +%options NAMES=MAX +%options SCOPES + +--Usefull macros helping reading/writing semantic actions +$Define +$putCase +/. case $rule_number : if (DEBUG) { System.out.println("$rule_text"); } //$NON-NLS-1$ + ./ + +$break +/. + break; +./ + +$readableName +/.1#$rule_number#./ +$compliance +/.2#$rule_number#./ +$recovery +/.2#$rule_number# recovery./ +$recovery_template +/.3#$rule_number#./ +$no_statements_recovery +/.4#$rule_number# 1./ +$empty_statement +/.5#$rule_number# 1./ +-- here it starts really ------------------------------------------ +$Terminals + + Identifier + + abstract boolean break byte case catch char class + continue const default debugger delete do double else enum export extends false final finally float + for function goto if in implements import instanceof int + interface let long native new null package private + protected public return short static super switch + synchronized this throw throws transient true try typeof undefined var void + volatile while with yield + + IntegerLiteral + LongLiteral + FloatingPointLiteral + DoubleLiteral + CharacterLiteral + StringLiteral + RegExLiteral + + PLUS_PLUS + MINUS_MINUS + EQUAL_EQUAL + EQUAL_EQUAL_EQUAL + NOT_EQUAL_EQUAL + LESS_EQUAL + GREATER_EQUAL + NOT_EQUAL + LEFT_SHIFT + RIGHT_SHIFT + UNSIGNED_RIGHT_SHIFT + PLUS_EQUAL + MINUS_EQUAL + MULTIPLY_EQUAL + DIVIDE_EQUAL + AND_EQUAL + OR_EQUAL + XOR_EQUAL + REMAINDER_EQUAL + LEFT_SHIFT_EQUAL + RIGHT_SHIFT_EQUAL + UNSIGNED_RIGHT_SHIFT_EQUAL + OR_OR + AND_AND + PLUS + MINUS + NOT + REMAINDER + XOR + AND + MULTIPLY + OR + TWIDDLE + DIVIDE + GREATER + LESS + LPAREN + RPAREN + LBRACE + RBRACE + LBRACKET + RBRACKET + SEMICOLON + QUESTION + COLON + COMMA + DOT + EQUAL + +-- BodyMarker + +$Alias + + '++' ::= PLUS_PLUS + '--' ::= MINUS_MINUS + '==' ::= EQUAL_EQUAL + '===' ::= EQUAL_EQUAL_EQUAL + '<=' ::= LESS_EQUAL + '>=' ::= GREATER_EQUAL + '!=' ::= NOT_EQUAL + '!==' ::= NOT_EQUAL_EQUAL + '<<' ::= LEFT_SHIFT + '>>' ::= RIGHT_SHIFT + '>>>' ::= UNSIGNED_RIGHT_SHIFT + '+=' ::= PLUS_EQUAL + '-=' ::= MINUS_EQUAL + '*=' ::= MULTIPLY_EQUAL + '/=' ::= DIVIDE_EQUAL + '&=' ::= AND_EQUAL + '|=' ::= OR_EQUAL + '^=' ::= XOR_EQUAL + '%=' ::= REMAINDER_EQUAL + '<<=' ::= LEFT_SHIFT_EQUAL + '>>=' ::= RIGHT_SHIFT_EQUAL + '>>>=' ::= UNSIGNED_RIGHT_SHIFT_EQUAL + '||' ::= OR_OR + '&&' ::= AND_AND + '+' ::= PLUS + '-' ::= MINUS + '!' ::= NOT + '%' ::= REMAINDER + '^' ::= XOR + '&' ::= AND + '*' ::= MULTIPLY + '|' ::= OR + '~' ::= TWIDDLE + '/' ::= DIVIDE + '>' ::= GREATER + '<' ::= LESS + '(' ::= LPAREN + ')' ::= RPAREN + '{' ::= LBRACE + '}' ::= RBRACE + '[' ::= LBRACKET + ']' ::= RBRACKET + ';' ::= SEMICOLON + '?' ::= QUESTION + ':' ::= COLON + ',' ::= COMMA + '.' ::= DOT + '=' ::= EQUAL + +$Start + Goal + +$Rules + +/.// This method is part of an automatic generation : do NOT edit-modify +protected void consumeRule(int act) { + switch ( act ) { +./ + + + +Goal ::= '++' CompilationUnit +Goal ::= '--' MethodBody +-- error recovery +-- Modifiersopt is used to properly consume a header and exit the rule reduction at the end of the parse() method +Goal ::= '>>>' Header1 Modifiersopt +Goal ::= '*' BlockStatements +Goal ::= '*' CatchHeader +-- JDOM +Goal ::= '&&' LocalVariableDeclaration +-- code snippet +Goal ::= '%' Expression +-- completion parser +Goal ::= '~' BlockStatementsopt +Goal ::= '+' ProgramElement +/:$readableName Goal:/ + +Literal -> IntegerLiteral +Literal -> LongLiteral +Literal -> FloatingPointLiteral +Literal -> DoubleLiteral +Literal -> CharacterLiteral +Literal -> StringLiteral +Literal -> RegExLiteral +Literal -> null +Literal -> undefined +Literal -> BooleanLiteral +/:$readableName Literal:/ +BooleanLiteral -> true +BooleanLiteral -> false +/:$readableName BooleanLiteral:/ + +-------------------------------------------------------------- +SimpleName -> Identifier +/:$readableName SimpleName:/ + +CompilationUnit ::= EnterCompilationUnit InternalCompilationUnit +/.$putCase consumeCompilationUnit(); $break ./ +/:$readableName CompilationUnit:/ + +InternalCompilationUnit ::= ProgramElements +/.$putCase consumeInternalCompilationUnitWithTypes(); $break ./ +InternalCompilationUnit ::= $empty +/.$putCase consumeEmptyInternalCompilationUnit(); $break ./ +/:$readableName CompilationUnit:/ + +EnterCompilationUnit ::= $empty +/.$putCase consumeEnterCompilationUnit(); $break ./ +/:$readableName EnterCompilationUnit:/ + +Header -> RecoveryMethodHeader +Header -> LocalVariableDeclaration +/:$readableName Header:/ + +Header1 -> Header +/:$readableName Header1:/ + +CatchHeader ::= 'catch' '(' FormalParameter ')' '{' +/.$putCase consumeCatchHeader(); $break ./ +/:$readableName CatchHeader:/ + +VariableDeclarators -> VariableDeclarator +VariableDeclarators ::= VariableDeclarators ',' VariableDeclarator +/.$putCase consumeVariableDeclarators(); $break ./ +/:$readableName VariableDeclarators:/ + +VariableDeclaratorsNoIn -> VariableDeclaratorNoIn +VariableDeclaratorsNoIn ::= VariableDeclaratorsNoIn ',' VariableDeclaratorNoIn +/.$putCase consumeVariableDeclarators(); $break ./ +/:$readableName VariableDeclarators:/ + +VariableDeclarator ::= VariableDeclaratorId EnterVariable ExitVariableWithoutInitialization +VariableDeclarator ::= VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization +/:$readableName VariableDeclarator:/ +/:$recovery_template Identifier:/ + +VariableDeclaratorNoIn ::= VariableDeclaratorId EnterVariable ExitVariableWithoutInitialization +VariableDeclaratorNoIn ::= VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializerNoIn RestoreDiet ExitVariableWithInitialization +/:$readableName VariableDeclarator:/ +/:$recovery_template Identifier:/ + +EnterVariable ::= $empty +/.$putCase consumeEnterVariable(); $break ./ +/:$readableName EnterVariable:/ + +ExitVariableWithInitialization ::= $empty +/.$putCase consumeExitVariableWithInitialization(); $break ./ +/:$readableName ExitVariableWithInitialization:/ + +ExitVariableWithoutInitialization ::= $empty +/.$putCase consumeExitVariableWithoutInitialization(); $break ./ +/:$readableName ExitVariableWithoutInitialization:/ + +ForceNoDiet ::= $empty +/.$putCase consumeForceNoDiet(); $break ./ +/:$readableName ForceNoDiet:/ +RestoreDiet ::= $empty +/.$putCase consumeRestoreDiet(); $break ./ +/:$readableName RestoreDiet:/ + +VariableDeclaratorId ::= 'Identifier' +/:$readableName VariableDeclaratorId:/ +/:$recovery_template Identifier:/ + +VariableInitializer -> AssignmentExpression +/:$readableName VariableInitializer:/ +/:$recovery_template Identifier:/ + +VariableInitializerNoIn -> AssignmentExpressionNoIn +/:$readableName VariableInitializer:/ +/:$recovery_template Identifier:/ + +FunctionExpression ::= FunctionExpressionHeader MethodBody +/.$putCase // set to true to consume a method with a body + consumeFunctionExpression(); $break ./ +/:$readableName FunctionExpression:/ + +FunctionExpressionHeader ::= FunctionExpressionHeaderName FormalParameterListopt MethodHeaderRightParen +/.$putCase consumeMethodHeader(); $break ./ +/:$readableName FunctionExpressionHeader :/ + +FunctionExpressionHeaderName ::= Modifiersopt 'function' 'Identifier' '(' +/.$putCase consumeMethodHeaderName(false); $break ./ +FunctionExpressionHeaderName ::= Modifiersopt 'function' '(' +/.$putCase consumeMethodHeaderName(true); $break ./ +/:$readableName FunctionExpressionHeaderName :/ + +MethodDeclaration -> AbstractMethodDeclaration +MethodDeclaration ::= MethodHeader MethodBody +/.$putCase // set to true to consume a method with a body + consumeMethodDeclaration(true); $break ./ +/:$readableName MethodDeclaration:/ + +AbstractMethodDeclaration ::= MethodHeader ';' +/.$putCase // set to false to consume a method without body + consumeMethodDeclaration(false); $break ./ +/:$readableName MethodDeclaration:/ + +MethodHeader ::= MethodHeaderName FormalParameterListopt MethodHeaderRightParen +/.$putCase consumeMethodHeader(); $break ./ +/:$readableName MethodDeclaration:/ + +MethodHeaderName ::= Modifiersopt 'function' 'Identifier' '(' +/.$putCase consumeMethodHeaderName(false); $break ./ +/:$readableName MethodHeaderName:/ + +MethodHeaderRightParen ::= ')' +/.$putCase consumeMethodHeaderRightParen(); $break ./ +/:$readableName ):/ +/:$recovery_template ):/ + +FormalParameterList -> FormalParameter +FormalParameterList ::= FormalParameterList ',' FormalParameter +/.$putCase consumeFormalParameterList(); $break ./ +/:$readableName FormalParameterList:/ + +--1.1 feature +FormalParameter ::= VariableDeclaratorId +/.$putCase consumeFormalParameter(false); $break ./ +/:$readableName FormalParameter:/ + +MethodBody ::= NestedMethod '{' PostDoc BlockStatementsopt '}' +/.$putCase consumeMethodBody(); $break ./ +/:$readableName MethodBody:/ +-- /:$no_statements_recovery:/ + +NestedMethod ::= $empty +/.$putCase consumeNestedMethod(); $break ./ +/:$readableName NestedMethod:/ + +PostDoc ::= $empty +/.$putCase consumePostDoc(); $break ./ +/:$readableName PostDoc:/ + +PushLeftBraceObjectLiteral ::= $empty +/.$putCase consumePushLeftBrace(); $break ./ +/:$readableName PushLeftBrace:/ + +Block ::= OpenBlock '{' BlockStatementsopt '}' +/.$putCase consumeBlock(); $break ./ +/:$readableName Block:/ + +OpenBlock ::= $empty +/.$putCase consumeOpenBlock() ; $break ./ +/:$readableName OpenBlock:/ + +ProgramElements -> ProgramElement +ProgramElements ::= ProgramElements ProgramElement +/.$putCase consumeProgramElements() ; $break ./ +/:$readableName ProgramElements:/ + +ProgramElement -> BlockStatement +/:$readableName ProgramElement:/ + +BlockStatements -> BlockStatement +BlockStatements ::= BlockStatements BlockStatement +/.$putCase consumeBlockStatements() ; $break ./ +/:$readableName BlockStatements:/ + +BlockStatement -> LocalVariableDeclarationStatement +BlockStatement -> MethodDeclaration +BlockStatement -> Statement +/:$readableName BlockStatement:/ + +LocalVariableDeclarationStatement ::= LocalVariableDeclaration ';' +/.$putCase consumeLocalVariableDeclarationStatement(); $break ./ +/:$readableName LocalVariableDeclarationStatement:/ + +LocalVariableDeclaration ::= 'var' PushModifiers VariableDeclarators +/.$putCase consumeLocalVariableDeclaration(); $break ./ +/:$readableName LocalVariableDeclaration:/ + +LocalVariableDeclarationNoIn ::= 'var' PushModifiers VariableDeclaratorsNoIn +/.$putCase consumeLocalVariableDeclaration(); $break ./ +/:$readableName LocalVariableDeclaration:/ + +PushModifiers ::= $empty +/.$putCase consumePushModifiers(); $break ./ +/:$readableName PushModifiers:/ + +Statement -> StatementWithoutTrailingSubstatement +Statement -> LabeledStatement +Statement -> IfThenStatement +Statement -> IfThenElseStatement +Statement -> WhileStatement +Statement -> WithStatement +Statement -> ForStatement +/:$readableName Statement:/ +/:$recovery_template ;:/ + +StatementNoShortIf -> StatementWithoutTrailingSubstatement +StatementNoShortIf -> LabeledStatementNoShortIf +StatementNoShortIf -> IfThenElseStatementNoShortIf +StatementNoShortIf -> WhileStatementNoShortIf +StatementNoShortIf -> WithStatementNoShortIf +StatementNoShortIf -> ForStatementNoShortIf +/:$readableName Statement:/ + +StatementWithoutTrailingSubstatement -> Block +StatementWithoutTrailingSubstatement -> EmptyStatement +StatementWithoutTrailingSubstatement -> ExpressionStatement +StatementWithoutTrailingSubstatement -> SwitchStatement +StatementWithoutTrailingSubstatement -> DoStatement +StatementWithoutTrailingSubstatement -> BreakStatement +StatementWithoutTrailingSubstatement -> ContinueStatement +StatementWithoutTrailingSubstatement -> ReturnStatement +StatementWithoutTrailingSubstatement -> ThrowStatement +StatementWithoutTrailingSubstatement -> TryStatement +StatementWithoutTrailingSubstatement -> DebuggerStatement +/:$readableName Statement:/ + +EmptyStatement ::= PushPosition ';' +/.$putCase consumeEmptyStatement(); $break ./ +/:$readableName EmptyStatement:/ +/:$empty_statement:/ + +LabeledStatement ::= Label ':' Statement +/.$putCase consumeStatementLabel() ; $break ./ +/:$readableName LabeledStatement:/ + +LabeledStatementNoShortIf ::= Label ':' StatementNoShortIf +/.$putCase consumeStatementLabel() ; $break ./ +/:$readableName LabeledStatement:/ + +Label ::= Identifier +/.$putCase consumeLabel() ; $break ./ +/:$readableName Label:/ + +ExpressionStatement ::= StatementExpression ';' +/. $putCase consumeExpressionStatement(); $break ./ +/:$readableName Statement:/ + +StatementExpression ::= ListExpressionStmt +/:$readableName Expression:/ + +IfThenStatement ::= 'if' '(' Expression ')' BlockStatement +/.$putCase consumeStatementIfNoElse(); $break ./ +/:$readableName IfStatement:/ + +IfThenElseStatement ::= 'if' '(' Expression ')' StatementNoShortIf 'else' BlockStatement +/.$putCase consumeStatementIfWithElse(); $break ./ +/:$readableName IfStatement:/ + +IfThenElseStatementNoShortIf ::= 'if' '(' Expression ')' StatementNoShortIf 'else' StatementNoShortIf +/.$putCase consumeStatementIfWithElse(); $break ./ +/:$readableName IfStatement:/ + +IfThenElseStatement ::= 'if' '(' Expression ')' LocalVariableDeclarationStatement 'else' BlockStatement +/.$putCase consumeStatementIfWithElse(); $break ./ +/:$readableName IfStatement:/ + +IfThenElseStatementNoShortIf ::= 'if' '(' Expression ')' LocalVariableDeclarationStatement 'else' StatementNoShortIf +/.$putCase consumeStatementIfWithElse(); $break ./ +/:$readableName IfStatement:/ + +SwitchStatement ::= 'switch' '(' Expression ')' OpenBlock SwitchBlock +/.$putCase consumeStatementSwitch() ; $break ./ +/:$readableName SwitchStatement:/ + +SwitchBlock ::= '{' '}' +/.$putCase consumeEmptySwitchBlock() ; $break ./ + +SwitchBlock ::= '{' SwitchBlockStatements '}' +SwitchBlock ::= '{' SwitchLabels '}' +SwitchBlock ::= '{' SwitchBlockStatements SwitchLabels '}' +/.$putCase consumeSwitchBlock() ; $break ./ +/:$readableName SwitchBlock:/ + +SwitchBlockStatements -> SwitchBlockStatement +SwitchBlockStatements ::= SwitchBlockStatements SwitchBlockStatement +/.$putCase consumeSwitchBlockStatements() ; $break ./ +/:$readableName SwitchBlockStatements:/ + +SwitchBlockStatement ::= SwitchLabels BlockStatements +/.$putCase consumeSwitchBlockStatement() ; $break ./ +/:$readableName SwitchBlockStatement:/ + +SwitchLabels -> SwitchLabel +SwitchLabels ::= SwitchLabels SwitchLabel +/.$putCase consumeSwitchLabels() ; $break ./ +/:$readableName SwitchLabels:/ + +SwitchLabel ::= 'case' ConstantExpression ':' +/. $putCase consumeCaseLabel(); $break ./ + +SwitchLabel ::= 'default' ':' +/. $putCase consumeDefaultLabel(); $break ./ +/:$readableName SwitchLabel:/ + +WhileStatement ::= 'while' '(' Expression ')' Statement +/.$putCase consumeStatementWhile() ; $break ./ +/:$readableName WhileStatement:/ + +WhileStatementNoShortIf ::= 'while' '(' Expression ')' StatementNoShortIf +/.$putCase consumeStatementWhile() ; $break ./ +/:$readableName WhileStatement:/ + +WithStatement ::= 'with' '(' Expression ')' Statement +/.$putCase consumeStatementWith() ; $break ./ +/:$readableName WithStatement:/ + +WithStatementNoShortIf ::= 'with' '(' Expression ')' StatementNoShortIf +/.$putCase consumeStatementWith() ; $break ./ +/:$readableName WithStatementNoShortIf:/ + +DoStatement ::= 'do' Statement 'while' '(' Expression ')' ';' +/.$putCase consumeStatementDo() ; $break ./ +/:$readableName DoStatement:/ + +ForStatement ::= 'for' '(' ForInitopt ';' Expressionopt ';' ForUpdateopt ')' Statement +/.$putCase consumeStatementFor() ; $break ./ +/:$readableName ForStatement:/ + +ForStatement ::= 'for' '(' ForInInit 'in' Expression ')' Statement +/.$putCase consumeStatementForIn() ; $break ./ +/:$readableName ForStatement:/ + +ForStatementNoShortIf ::= 'for' '(' ForInitopt ';' Expressionopt ';' ForUpdateopt ')' StatementNoShortIf +/.$putCase consumeStatementFor() ; $break ./ +/:$readableName ForStatement:/ + +ForStatementNoShortIf ::= 'for' '(' ForInInit 'in' Expression ')' StatementNoShortIf +/.$putCase consumeStatementForIn() ; $break ./ +/:$readableName ForStatement:/ + +ForInInit ::= LeftHandSideExpression +/.$putCase consumeForInInit() ; $break ./ +ForInInit -> LocalVariableDeclarationNoIn +/:$readableName ForInInit:/ + +-- the minus one allows to avoid a stack-to-stack transfer +ForInit ::= ExpressionNoIn +/.$putCase consumeForInit() ; $break ./ +ForInit -> LocalVariableDeclarationNoIn +/:$readableName ForInit:/ + +ForUpdate -> StatementExpressionList +/:$readableName ForUpdate:/ + +StatementExpressionList -> AssignmentExpression +StatementExpressionList ::= StatementExpressionList ',' AssignmentExpression +/.$putCase consumeStatementExpressionList() ; $break ./ +/:$readableName StatementExpressionList:/ + +BreakStatement ::= 'break' ';' +/.$putCase consumeStatementBreak() ; $break ./ + +BreakStatement ::= 'break' Identifier ';' +/.$putCase consumeStatementBreakWithLabel() ; $break ./ +/:$readableName BreakStatement:/ + +ContinueStatement ::= 'continue' ';' +/.$putCase consumeStatementContinue() ; $break ./ + +ContinueStatement ::= 'continue' Identifier ';' +/.$putCase consumeStatementContinueWithLabel() ; $break ./ +/:$readableName ContinueStatement:/ + +ReturnStatement ::= 'return' Expressionopt ';' +/.$putCase consumeStatementReturn() ; $break ./ +/:$readableName ReturnStatement:/ + +ThrowStatement ::= 'throw' Expression ';' +/.$putCase consumeStatementThrow(); $break ./ +/:$readableName ThrowStatement:/ + +TryStatement ::= 'try' TryBlock Catches +/.$putCase consumeStatementTry(false); $break ./ +TryStatement ::= 'try' TryBlock Catchesopt Finally +/.$putCase consumeStatementTry(true); $break ./ +/:$readableName TryStatement:/ + +TryBlock ::= Block ExitTryBlock +/:$readableName Block:/ + +ExitTryBlock ::= $empty +/.$putCase consumeExitTryBlock(); $break ./ +/:$readableName ExitTryBlock:/ + +Catches -> CatchClause +Catches ::= Catches CatchClause +/.$putCase consumeCatches(); $break ./ +/:$readableName Catches:/ + +CatchClause ::= 'catch' '(' FormalParameter ')' Block +/.$putCase consumeStatementCatch() ; $break ./ +/:$readableName CatchClause:/ + +Finally ::= 'finally' Block +/:$readableName Finally:/ + +DebuggerStatement ::= 'debugger' ';' +/.$putCase consumeDebuggerStatement() ; $break ./ +/:$readableName DebuggerStatement:/ +--18.12 Productions from 14: Expressions + +--for source positionning purpose +PushLPAREN ::= '(' +/.$putCase consumeLeftParen(); $break ./ +/:$readableName (:/ +/:$recovery_template (:/ +PushRPAREN ::= ')' +/.$putCase consumeRightParen(); $break ./ +/:$readableName ):/ +/:$recovery_template ):/ + +Primary -> PrimaryNoNewArray +Primary -> ArrayLiteral +Primary -> ObjectLiteral +/:$readableName Primary:/ + +PrimaryNoNewArray -> Literal +PrimaryNoNewArray ::= SimpleName +/.$putCase consumePrimarySimpleName(); $break ./ +PrimaryNoNewArray ::= 'this' +/.$putCase consumePrimaryNoNewArrayThis(); $break ./ +/:$readableName PrimaryNoNewArray:/ + +PrimaryNoNewArray ::= PushLPAREN Expression PushRPAREN +/.$putCase consumePrimaryNoNewArray(); $break ./ +/:$readableName PrimaryNoNewArray:/ + +ObjectLiteral ::= '{' PushLeftBraceObjectLiteral '}' +/.$putCase consumeEmptyObjectLiteral(); $break ./ +/:$readableName ObjectLiteral:/ + +ObjectLiteral ::= '{' PushLeftBraceObjectLiteral PropertyNameAndValueList '}' +/.$putCase consumeObjectLiteral(); $break ./ +/:$readableName ObjectLiteral:/ + +ObjectLiteral ::= '{' PushLeftBraceObjectLiteral PropertyNameAndValueList ',' '}' +/.$putCase consumeObjectLiteral(); $break ./ +/:$readableName ObjectLiteral:/ + +PropertyNameAndValueList -> PropertyAssignment +PropertyNameAndValueList ::= PropertyNameAndValueList ',' PropertyAssignment +/.$putCase consumePropertyNameAndValueList(); $break ./ +/:$readableName NonemptyFieldList:/ + +PropertyAssignment ::= PropertyName ':' AssignmentExpression +/.$putCase consumePropertyAssignment(); $break ./ +/:$readableName PropertyAssignment:/ + +-- the first PropertyName can only be 'get' or 'set' +PropertyAssignment ::= PropertyName PropertyName '(' ')' FunctionBody +/.$putCase consumeGetSetPropertyAssignment(false); $break ./ +PropertyAssignment ::= PropertyName PropertyName '(' PropertySetParameterList ')' FunctionBody +/.$putCase consumeGetSetPropertyAssignment(true); $break ./ +/:$readableName PropertyAssignment:/ + +PropertySetParameterList ::= SimpleName +/.$putCase consumePropertySetParameterList(); $break ./ +/:$readableName PropertySetParameterList:/ + +FunctionBody ::= NestedMethod '{' PostDoc ProgramElementsopt '}' +/.$putCase consumeMethodBody(); $break ./ +/:$readableName FunctionBody:/ + +ProgramElementsopt ::= $empty +/.$putCase consumeEmptyProgramElements(); $break ./ +ProgramElementsopt -> ProgramElements +/:$readableName ProgramElementsopt:/ + +PropertyName ::= SimpleName +/.$putCase consumePropertyName(); $break ./ +PropertyName -> StringLiteral +PropertyName -> CharacterLiteral +PropertyName -> IntegerLiteral +/:$readableName FieldName:/ + +ArrayLiteral ::= ArrayLiteralHeader ElisionOpt ']' +/.$putCase consumeArrayLiteral(false); $break ./ + +ArrayLiteral ::= ArrayLiteralHeader ArrayLiteralElementList ']' +/.$putCase consumeArrayLiteral(false); $break ./ +/:$readableName ArrayLiteral:/ + +ArrayLiteral ::= ArrayLiteralHeader ArrayLiteralElementList ',' ElisionOpt ']' +/.$putCase consumeArrayLiteral(true); $break ./ +/:$readableName ArrayLiteral:/ + +ArrayLiteralHeader ::= '[' +/.$putCase consumeArrayLiteralHeader(); $break ./ +/:$readableName ArrayLiteralHeader:/ + +ElisionOpt ::= $empty +/.$putCase consumeElisionEmpty(); $break ./ +ElisionOpt -> Elision +/:$readableName ElisionOpt:/ + +Elision ::= ',' +/.$putCase consumeElisionOne(); $break ./ +Elision ::= Elision ',' +/.$putCase consumeElisionList(); $break ./ +/:$readableName Elision:/ + +ArrayLiteralElementList ::= ElisionOpt ArrayLiteralElement +/.$putCase consumeArrayLiteralListOne(); $break ./ +ArrayLiteralElementList ::= ArrayLiteralElementList ',' ElisionOpt ArrayLiteralElement +/.$putCase consumeArrayLiteralList(); $break ./ +/:$readableName ArrayLiteralElementList:/ + +ArrayLiteralElement ::= AssignmentExpression +/.$putCase consumeArrayLiteralElement(); $break ./ +/:$readableName ArrayLiteralElement:/ + +MemberExpression -> Primary +MemberExpression -> FunctionExpression +MemberExpression ::= MemberExpression '[' Expression ']' +/.$putCase consumeMemberExpressionWithArrayReference(); $break ./ +MemberExpression ::= MemberExpression '.' SimpleName +/.$putCase consumeMemberExpressionWithSimpleName(); $break ./ +MemberExpression ::= 'new' MemberExpression Arguments +/.$putCase consumeNewMemberExpressionWithArguments(); $break ./ +/:$readableName MemberExpression:/ + +NewExpression -> MemberExpression +NewExpression ::= 'new' NewExpression +/.$putCase consumeNewExpression(); $break ./ +/:$readableName NewExpression:/ + +CallExpression ::= MemberExpression Arguments +/.$putCase consumeCallExpressionWithArguments(); $break ./ +CallExpression ::= CallExpression Arguments +/.$putCase consumeCallExpressionWithArguments(); $break ./ +CallExpression ::= CallExpression '[' Expression ']' +/.$putCase consumeCallExpressionWithArrayReference(); $break ./ +CallExpression ::= CallExpression '.' SimpleName +/.$putCase consumeCallExpressionWithSimpleName(); $break ./ +/:$readableName CallExpression:/ + +LeftHandSideExpression -> NewExpression +LeftHandSideExpression -> CallExpression +/:$readableName LeftHandSideExpression:/ + +PostfixExpression -> LeftHandSideExpression +PostfixExpression ::= LeftHandSideExpression '++' +/.$putCase consumeUnaryExpression(OperatorIds.PLUS, true); $break ./ +PostfixExpression ::= LeftHandSideExpression '--' +/.$putCase consumeUnaryExpression(OperatorIds.MINUS, true); $break ./ +/:$readableName PostFixExpression:/ + +ListExpression -> AssignmentExpression +ListExpression ::= ListExpression ',' AssignmentExpression +/.$putCase consumeListExpression(); $break ./ +/:$readableName ListExpression:/ + +ListExpressionNoIn -> AssignmentExpressionNoIn +ListExpressionNoIn ::= ListExpressionNoIn ',' AssignmentExpressionNoIn +/.$putCase consumeListExpression(); $break ./ +/:$readableName ListExpression:/ + +ListExpressionStmt -> AssignmentExpressionStmt +ListExpressionStmt ::= ListExpressionStmt ',' AssignmentExpression +/.$putCase consumeListExpression(); $break ./ +/:$readableName ListExpression:/ + +ArgumentList -> AssignmentExpression +ArgumentList ::= ArgumentList ',' AssignmentExpression +/.$putCase consumeArgumentList(); $break ./ +/:$readableName ArgumentList:/ + +--for source management purpose +PushPosition ::= $empty + /.$putCase consumePushPosition(); $break ./ +/:$readableName PushPosition:/ + +UnaryExpression -> PreIncrementExpression +UnaryExpression -> PreDecrementExpression +UnaryExpression ::= '+' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.PLUS); $break ./ +UnaryExpression ::= '-' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.MINUS); $break ./ +UnaryExpression -> UnaryExpressionNotPlusMinus +/:$readableName Expression:/ + +PreIncrementExpression ::= '++' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.PLUS, false); $break ./ +/:$readableName PreIncrementExpression:/ + +PreDecrementExpression ::= '--' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.MINUS, false); $break ./ +/:$readableName PreDecrementExpression:/ + +UnaryExpressionNotPlusMinus -> PostfixExpression +UnaryExpressionNotPlusMinus ::= '~' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.TWIDDLE); $break ./ +UnaryExpressionNotPlusMinus ::= '!' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.NOT); $break ./ +UnaryExpressionNotPlusMinus ::= 'delete' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.DELETE); $break ./ +UnaryExpressionNotPlusMinus ::= 'void' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.VOID); $break ./ +UnaryExpressionNotPlusMinus ::= 'typeof' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.TYPEOF); $break ./ +/:$readableName Expression:/ + +MultiplicativeExpression -> UnaryExpression +MultiplicativeExpression ::= MultiplicativeExpression '*' UnaryExpression +/.$putCase consumeBinaryExpression(OperatorIds.MULTIPLY); $break ./ +MultiplicativeExpression ::= MultiplicativeExpression '/' UnaryExpression +/.$putCase consumeBinaryExpression(OperatorIds.DIVIDE); $break ./ +MultiplicativeExpression ::= MultiplicativeExpression '%' UnaryExpression +/.$putCase consumeBinaryExpression(OperatorIds.REMAINDER); $break ./ +/:$readableName Expression:/ + +AdditiveExpression -> MultiplicativeExpression +AdditiveExpression ::= AdditiveExpression '+' MultiplicativeExpression +/.$putCase consumeBinaryExpression(OperatorIds.PLUS); $break ./ +AdditiveExpression ::= AdditiveExpression '-' MultiplicativeExpression +/.$putCase consumeBinaryExpression(OperatorIds.MINUS); $break ./ +/:$readableName Expression:/ + +ShiftExpression -> AdditiveExpression +ShiftExpression ::= ShiftExpression '<<' AdditiveExpression +/.$putCase consumeBinaryExpression(OperatorIds.LEFT_SHIFT); $break ./ +ShiftExpression ::= ShiftExpression '>>' AdditiveExpression +/.$putCase consumeBinaryExpression(OperatorIds.RIGHT_SHIFT); $break ./ +ShiftExpression ::= ShiftExpression '>>>' AdditiveExpression +/.$putCase consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT); $break ./ +/:$readableName Expression:/ + +-- +--RelationalExpression +-- +RelationalExpression -> ShiftExpression +RelationalExpression ::= RelationalExpression '<' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.LESS); $break ./ +RelationalExpression ::= RelationalExpression '>' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.GREATER); $break ./ +RelationalExpression ::= RelationalExpression '<=' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.LESS_EQUAL); $break ./ +RelationalExpression ::= RelationalExpression '>=' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.GREATER_EQUAL); $break ./ +RelationalExpression ::= RelationalExpression 'instanceof' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.INSTANCEOF); $break ./ +RelationalExpression ::= RelationalExpression 'in' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.IN); $break ./ +/:$readableName Expression:/ + +RelationalExpressionNoIn -> ShiftExpression +RelationalExpressionNoIn ::= RelationalExpressionNoIn '<' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.LESS); $break ./ +RelationalExpressionNoIn ::= RelationalExpressionNoIn '>' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.GREATER); $break ./ +RelationalExpressionNoIn ::= RelationalExpressionNoIn '<=' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.LESS_EQUAL); $break ./ +RelationalExpressionNoIn ::= RelationalExpressionNoIn '>=' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.GREATER_EQUAL); $break ./ +RelationalExpressionNoIn ::= RelationalExpressionNoIn 'instanceof' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.INSTANCEOF); $break ./ +/:$readableName Expression:/ + +-- +--EqualityExpression +-- +EqualityExpression -> RelationalExpression +EqualityExpression ::= EqualityExpression '==' RelationalExpression +/.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); $break ./ +EqualityExpression ::= EqualityExpression '!=' RelationalExpression +/.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL); $break ./ +EqualityExpression ::= EqualityExpression '===' RelationalExpression +/.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL_EQUAL); $break ./ +EqualityExpression ::= EqualityExpression '!==' RelationalExpression +/.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL_EQUAL); $break ./ +/:$readableName Expression:/ + +EqualityExpressionNoIn -> RelationalExpressionNoIn +EqualityExpressionNoIn ::= EqualityExpressionNoIn '==' RelationalExpressionNoIn +/.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); $break ./ +EqualityExpressionNoIn ::= EqualityExpressionNoIn '!=' RelationalExpressionNoIn +/.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL); $break ./ +EqualityExpressionNoIn ::= EqualityExpressionNoIn '===' RelationalExpressionNoIn +/.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL_EQUAL); $break ./ +EqualityExpressionNoIn ::= EqualityExpressionNoIn '!==' RelationalExpressionNoIn +/.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL_EQUAL); $break ./ +/:$readableName Expression:/ + +-- +--AndExpression +-- +AndExpression -> EqualityExpression +AndExpression ::= AndExpression '&' EqualityExpression +/.$putCase consumeBinaryExpression(OperatorIds.AND); $break ./ +/:$readableName Expression:/ + +AndExpressionNoIn -> EqualityExpressionNoIn +AndExpressionNoIn ::= AndExpressionNoIn '&' EqualityExpressionNoIn +/.$putCase consumeBinaryExpression(OperatorIds.AND); $break ./ +/:$readableName Expression:/ + +-- +--ExclusiveOrExpression +-- +ExclusiveOrExpression -> AndExpression +ExclusiveOrExpression ::= ExclusiveOrExpression '^' AndExpression +/.$putCase consumeBinaryExpression(OperatorIds.XOR); $break ./ +/:$readableName Expression:/ + +ExclusiveOrExpressionNoIn -> AndExpressionNoIn +ExclusiveOrExpressionNoIn ::= ExclusiveOrExpressionNoIn '^' AndExpressionNoIn +/.$putCase consumeBinaryExpression(OperatorIds.XOR); $break ./ +/:$readableName Expression:/ + +-- +--InclusiveOrExpression +-- +InclusiveOrExpression -> ExclusiveOrExpression +InclusiveOrExpression ::= InclusiveOrExpression '|' ExclusiveOrExpression +/.$putCase consumeBinaryExpression(OperatorIds.OR); $break ./ +/:$readableName Expression:/ + +InclusiveOrExpressionNoIn -> ExclusiveOrExpressionNoIn +InclusiveOrExpressionNoIn ::= InclusiveOrExpressionNoIn '|' ExclusiveOrExpressionNoIn +/.$putCase consumeBinaryExpression(OperatorIds.OR); $break ./ +/:$readableName Expression:/ + +-- +--ConditionalAndExpression +-- +ConditionalAndExpression -> InclusiveOrExpression +ConditionalAndExpression ::= ConditionalAndExpression '&&' InclusiveOrExpression +/.$putCase consumeBinaryExpression(OperatorIds.AND_AND); $break ./ +/:$readableName Expression:/ + +ConditionalAndExpressionNoIn -> InclusiveOrExpressionNoIn +ConditionalAndExpressionNoIn ::= ConditionalAndExpressionNoIn '&&' InclusiveOrExpressionNoIn +/.$putCase consumeBinaryExpression(OperatorIds.AND_AND); $break ./ +/:$readableName Expression:/ + +-- +--ConditionalOrExpression +-- +ConditionalOrExpression -> ConditionalAndExpression +ConditionalOrExpression ::= ConditionalOrExpression '||' ConditionalAndExpression +/.$putCase consumeBinaryExpression(OperatorIds.OR_OR); $break ./ +/:$readableName Expression:/ + +ConditionalOrExpressionNoIn -> ConditionalAndExpressionNoIn +ConditionalOrExpressionNoIn ::= ConditionalOrExpressionNoIn '||' ConditionalAndExpressionNoIn +/.$putCase consumeBinaryExpression(OperatorIds.OR_OR); $break ./ +/:$readableName Expression:/ + +-- +--ConditionalExpression +-- +ConditionalExpression -> ConditionalOrExpression +ConditionalExpression ::= ConditionalOrExpression ? AssignmentExpression ':' AssignmentExpression +/.$putCase consumeConditionalExpression(OperatorIds.QUESTIONCOLON); $break ./ +/:$readableName Expression:/ + +ConditionalExpressionNoIn -> ConditionalOrExpressionNoIn +ConditionalExpressionNoIn ::= ConditionalOrExpressionNoIn ? AssignmentExpressionNoIn ':' AssignmentExpressionNoIn +/.$putCase consumeConditionalExpression(OperatorIds.QUESTIONCOLON); $break ./ +/:$readableName Expression:/ + +-- +--AssignmentExpression +-- +AssignmentExpression -> ConditionalExpression +AssignmentExpression -> Assignment +/:$readableName Expression:/ +/:$recovery_template Identifier:/ + +AssignmentExpressionNoIn -> ConditionalExpressionNoIn +AssignmentExpressionNoIn -> AssignmentNoIn +/:$readableName Expression:/ +/:$recovery_template Identifier:/ + +-- +--Assignment +-- +Assignment ::= PostfixExpression AssignmentOperator AssignmentExpression +/.$putCase consumeAssignment(); $break ./ +/:$readableName Assignment:/ + +AssignmentNoIn ::= PostfixExpression AssignmentOperator AssignmentExpressionNoIn +/.$putCase consumeAssignment(); $break ./ +/:$readableName Assignment:/ + +AssignmentOperator ::= '=' +/.$putCase consumeAssignmentOperator(EQUAL); $break ./ +AssignmentOperator ::= '*=' +/.$putCase consumeAssignmentOperator(MULTIPLY); $break ./ +AssignmentOperator ::= '/=' +/.$putCase consumeAssignmentOperator(DIVIDE); $break ./ +AssignmentOperator ::= '%=' +/.$putCase consumeAssignmentOperator(REMAINDER); $break ./ +AssignmentOperator ::= '+=' +/.$putCase consumeAssignmentOperator(PLUS); $break ./ +AssignmentOperator ::= '-=' +/.$putCase consumeAssignmentOperator(MINUS); $break ./ +AssignmentOperator ::= '<<=' +/.$putCase consumeAssignmentOperator(LEFT_SHIFT); $break ./ +AssignmentOperator ::= '>>=' +/.$putCase consumeAssignmentOperator(RIGHT_SHIFT); $break ./ +AssignmentOperator ::= '>>>=' +/.$putCase consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT); $break ./ +AssignmentOperator ::= '&=' +/.$putCase consumeAssignmentOperator(AND); $break ./ +AssignmentOperator ::= '^=' +/.$putCase consumeAssignmentOperator(XOR); $break ./ +AssignmentOperator ::= '|=' +/.$putCase consumeAssignmentOperator(OR); $break ./ +/:$readableName AssignmentOperator:/ +/:$recovery_template =:/ + +Expression -> ListExpression +/:$readableName Expression:/ +/:$recovery_template Identifier:/ + +ExpressionNoIn -> ListExpressionNoIn +/:$readableName Expression:/ +/:$recovery_template Identifier:/ + +Expressionopt ::= $empty +/.$putCase consumeEmptyExpression(); $break ./ +Expressionopt -> Expression +/:$readableName Expression:/ + +ConstantExpression -> Expression +/:$readableName ConstantExpression:/ + +PrimaryStmt -> PrimaryNoNewArrayStmt +PrimaryStmt -> ArrayLiteral +/:$readableName Primary:/ + +PrimaryNoNewArrayStmt -> Literal +PrimaryNoNewArrayStmt ::= SimpleName +/.$putCase consumePrimarySimpleName(); $break ./ +PrimaryNoNewArrayStmt ::= 'this' +/.$putCase consumePrimaryNoNewArrayThis(); $break ./ +PrimaryNoNewArrayStmt ::= PushLPAREN Expression PushRPAREN +/.$putCase consumePrimaryNoNewArray(); $break ./ +/:$readableName PrimaryNoNewArray:/ + +MemberExpressionStmt -> PrimaryStmt +MemberExpressionStmt ::= MemberExpressionStmt '[' Expression ']' +/.$putCase consumeMemberExpressionWithArrayReference(); $break ./ +MemberExpressionStmt ::= MemberExpressionStmt '.' SimpleName +/.$putCase consumeMemberExpressionWithSimpleName(); $break ./ +MemberExpressionStmt ::= 'new' MemberExpression Arguments +/.$putCase consumeNewMemberExpressionWithArguments(); $break ./ +/:$readableName MemberExpression:/ + +NewExpressionStmt -> MemberExpressionStmt +NewExpressionStmt ::= 'new' NewExpression +/.$putCase consumeNewExpression(); $break ./ +/:$readableName NewExpression:/ + +CallExpressionStmt ::= MemberExpressionStmt Arguments +/.$putCase consumeCallExpressionWithArguments(); $break ./ +CallExpressionStmt ::= CallExpressionStmt Arguments +/.$putCase consumeCallExpressionWithArguments(); $break ./ +CallExpressionStmt ::= CallExpressionStmt '[' Expression ']' +/.$putCase consumeCallExpressionWithArrayReference(); $break ./ +CallExpressionStmt ::= CallExpressionStmt '.' SimpleName +/.$putCase consumeCallExpressionWithSimpleName(); $break ./ +/:$readableName CallExpression:/ + +Arguments ::= '(' ArgumentListopt ')' +/.$putCase consumeArguments(); $break ./ +/:$readableName Arguments:/ + +LeftHandSideExpressionStmt -> NewExpressionStmt +LeftHandSideExpressionStmt -> CallExpressionStmt +/:$readableName LeftHandSideExpressionStmt:/ + +PostfixExpressionStmt -> LeftHandSideExpressionStmt +PostfixExpressionStmt ::= LeftHandSideExpressionStmt '++' +/.$putCase consumeUnaryExpression(OperatorIds.PLUS, true); $break ./ +PostfixExpressionStmt ::= LeftHandSideExpressionStmt '--' +/.$putCase consumeUnaryExpression(OperatorIds.MINUS, true); $break ./ +/:$readableName PostfixExpression:/ + +PreIncrementExpressionStmt ::= '++' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.PLUS, false); $break ./ +/:$readableName PreIncrementExpression:/ + +PreDecrementExpressionStmt ::= '--' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.MINUS, false); $break ./ +/:$readableName PreDecrementExpression:/ + +UnaryExpressionStmt -> PreIncrementExpressionStmt +UnaryExpressionStmt -> PreDecrementExpressionStmt +UnaryExpressionStmt ::= '+' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.PLUS); $break ./ +UnaryExpressionStmt ::= '-' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.MINUS); $break ./ +UnaryExpressionStmt -> UnaryExpressionNotPlusMinusStmt +/:$readableName UnaryExpression:/ + +UnaryExpressionNotPlusMinusStmt -> PostfixExpressionStmt +UnaryExpressionNotPlusMinusStmt ::= '~' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.TWIDDLE); $break ./ +UnaryExpressionNotPlusMinusStmt ::= '!' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.NOT); $break ./ +UnaryExpressionNotPlusMinusStmt ::= 'delete' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.DELETE); $break ./ +UnaryExpressionNotPlusMinusStmt ::= 'void' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.VOID); $break ./ +UnaryExpressionNotPlusMinusStmt ::= 'typeof' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.TYPEOF); $break ./ +/:$readableName UnaryExpression:/ + +MultiplicativeExpressionStmt -> UnaryExpressionStmt +MultiplicativeExpressionStmt ::= MultiplicativeExpressionStmt '*' UnaryExpression +/.$putCase consumeBinaryExpression(OperatorIds.MULTIPLY); $break ./ +MultiplicativeExpressionStmt ::= MultiplicativeExpressionStmt '/' UnaryExpression +/.$putCase consumeBinaryExpression(OperatorIds.DIVIDE); $break ./ +MultiplicativeExpressionStmt ::= MultiplicativeExpressionStmt '%' UnaryExpression +/.$putCase consumeBinaryExpression(OperatorIds.REMAINDER); $break ./ +/:$readableName MultiplicativeExpression:/ + +AdditiveExpressionStmt -> MultiplicativeExpressionStmt +AdditiveExpressionStmt ::= AdditiveExpressionStmt '+' MultiplicativeExpression +/.$putCase consumeBinaryExpression(OperatorIds.PLUS); $break ./ +AdditiveExpressionStmt ::= AdditiveExpressionStmt '-' MultiplicativeExpression +/.$putCase consumeBinaryExpression(OperatorIds.MINUS); $break ./ +/:$readableName AdditiveExpression:/ + +ShiftExpressionStmt -> AdditiveExpressionStmt +ShiftExpressionStmt ::= ShiftExpressionStmt '<<' AdditiveExpression +/.$putCase consumeBinaryExpression(OperatorIds.LEFT_SHIFT); $break ./ +ShiftExpressionStmt ::= ShiftExpressionStmt '>>' AdditiveExpression +/.$putCase consumeBinaryExpression(OperatorIds.RIGHT_SHIFT); $break ./ +ShiftExpressionStmt ::= ShiftExpressionStmt '>>>' AdditiveExpression +/.$putCase consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT); $break ./ +/:$readableName Expression:/ + +RelationalExpressionStmt -> ShiftExpressionStmt +RelationalExpressionStmt ::= RelationalExpressionStmt '<' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.LESS); $break ./ +RelationalExpressionStmt ::= RelationalExpressionStmt '>' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.GREATER); $break ./ +RelationalExpressionStmt ::= RelationalExpressionStmt '<=' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.LESS_EQUAL); $break ./ +RelationalExpressionStmt ::= RelationalExpressionStmt '>=' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.GREATER_EQUAL); $break ./ +RelationalExpressionStmt ::= RelationalExpressionStmt 'instanceof' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.INSTANCEOF); $break ./ +RelationalExpressionStmt ::= RelationalExpressionStmt 'in' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.IN); $break ./ +/:$readableName Expression:/ + +EqualityExpressionStmt -> RelationalExpressionStmt +EqualityExpressionStmt ::= EqualityExpressionStmt '==' RelationalExpression +/.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); $break ./ +EqualityExpressionStmt ::= EqualityExpressionStmt '!=' RelationalExpression +/.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL); $break ./ +EqualityExpressionStmt ::= EqualityExpressionStmt '===' RelationalExpression +/.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL_EQUAL); $break ./ +EqualityExpressionStmt ::= EqualityExpressionStmt '!==' RelationalExpression +/.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL_EQUAL); $break ./ +/:$readableName Expression:/ + +AndExpressionStmt -> EqualityExpressionStmt +AndExpressionStmt ::= AndExpressionStmt '&' EqualityExpression +/.$putCase consumeBinaryExpression(OperatorIds.AND); $break ./ +/:$readableName Expression:/ + +ExclusiveOrExpressionStmt -> AndExpressionStmt +ExclusiveOrExpressionStmt ::= ExclusiveOrExpressionStmt '^' AndExpression +/.$putCase consumeBinaryExpression(OperatorIds.XOR); $break ./ +/:$readableName Expression:/ + +InclusiveOrExpressionStmt -> ExclusiveOrExpressionStmt +InclusiveOrExpressionStmt ::= InclusiveOrExpressionStmt '|' ExclusiveOrExpression +/.$putCase consumeBinaryExpression(OperatorIds.OR); $break ./ +/:$readableName Expression:/ + +ConditionalAndExpressionStmt -> InclusiveOrExpressionStmt +ConditionalAndExpressionStmt ::= ConditionalAndExpressionStmt '&&' InclusiveOrExpression +/.$putCase consumeBinaryExpression(OperatorIds.AND_AND); $break ./ +/:$readableName Expression:/ + +ConditionalOrExpressionStmt -> ConditionalAndExpressionStmt +ConditionalOrExpressionStmt ::= ConditionalOrExpressionStmt '||' ConditionalAndExpression +/.$putCase consumeBinaryExpression(OperatorIds.OR_OR); $break ./ +/:$readableName Expression:/ + +ConditionalExpressionStmt -> ConditionalOrExpressionStmt +ConditionalExpressionStmt ::= ConditionalOrExpressionStmt '?' AssignmentExpression ':' AssignmentExpression +/.$putCase consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ; $break ./ +/:$readableName Expression:/ + +AssignmentExpressionStmt -> ConditionalExpressionStmt +AssignmentExpressionStmt -> AssignmentStmt +/:$readableName Expression:/ +/:$recovery_template Identifier:/ + +AssignmentStmt ::= PostfixExpressionStmt AssignmentOperator AssignmentExpression +/.$putCase consumeAssignment(); $break ./ +/:$readableName AssignmentStmt:/ + +Modifiersopt ::= $empty +/. $putCase consumeDefaultModifiers(); $break ./ +/:$readableName Modifiers:/ + +BlockStatementsopt ::= $empty +/.$putCase consumeEmptyBlockStatementsopt(); $break ./ +BlockStatementsopt -> BlockStatements +/:$readableName BlockStatements:/ + +ArgumentListopt ::= $empty +/. $putCase consumeEmptyArgumentListopt(); $break ./ +ArgumentListopt -> ArgumentList +/:$readableName ArgumentList:/ + +FormalParameterListopt ::= $empty +/.$putcase consumeFormalParameterListopt(); $break ./ +FormalParameterListopt -> FormalParameterList +/:$readableName FormalParameterList:/ + +ForInitopt ::= $empty +/. $putCase consumeEmptyForInitopt(); $break ./ +ForInitopt -> ForInit +/:$readableName ForInit:/ + +ForUpdateopt ::= $empty +/. $putCase consumeEmptyForUpdateopt(); $break ./ +ForUpdateopt -> ForUpdate +/:$readableName ForUpdate:/ + +Catchesopt ::= $empty +/. $putCase consumeEmptyCatchesopt(); $break ./ +Catchesopt -> Catches +/:$readableName Catches:/ + +----------------------------------- +-- 1.5 features : recovery rules -- +----------------------------------- +RecoveryMethodHeaderName ::= Modifiersopt 'function' 'Identifier' '(' +/.$putCase consumeRecoveryMethodHeaderName(); $break ./ +/:$readableName MethodHeaderName:/ + +RecoveryMethodHeader ::= RecoveryMethodHeaderName FormalParameterListopt MethodHeaderRightParen +/.$putCase consumeMethodHeader(); $break ./ +-- RecoveryMethodHeader ::= RecoveryMethodHeaderName FormalParameterListopt MethodHeaderRightParen MethodHeaderExtendedDims MethodHeaderThrowsClause +-- /.$putCase consumeMethodHeader(); $break ./ +/:$readableName MethodHeader:/ +----------------------------------- +-- 1.5 features : recovery rules -- +----------------------------------- + +/. } +}./ + +$names + +PLUS_PLUS ::= '++' +MINUS_MINUS ::= '--' +EQUAL_EQUAL ::= '==' +LESS_EQUAL ::= '<=' +GREATER_EQUAL ::= '>=' +NOT_EQUAL ::= '!=' +LEFT_SHIFT ::= '<<' +RIGHT_SHIFT ::= '>>' +UNSIGNED_RIGHT_SHIFT ::= '>>>' +PLUS_EQUAL ::= '+=' +MINUS_EQUAL ::= '-=' +MULTIPLY_EQUAL ::= '*=' +DIVIDE_EQUAL ::= '/=' +AND_EQUAL ::= '&=' +OR_EQUAL ::= '|=' +XOR_EQUAL ::= '^=' +REMAINDER_EQUAL ::= '%=' +LEFT_SHIFT_EQUAL ::= '<<=' +RIGHT_SHIFT_EQUAL ::= '>>=' +UNSIGNED_RIGHT_SHIFT_EQUAL ::= '>>>=' +OR_OR ::= '||' +AND_AND ::= '&&' +PLUS ::= '+' +MINUS ::= '-' +NOT ::= '!' +REMAINDER ::= '%' +XOR ::= '^' +AND ::= '&' +MULTIPLY ::= '*' +OR ::= '|' +TWIDDLE ::= '~' +DIVIDE ::= '/' +GREATER ::= '>' +LESS ::= '<' +LPAREN ::= '(' +RPAREN ::= ')' +LBRACE ::= '{' +RBRACE ::= '}' +LBRACKET ::= '[' +RBRACKET ::= ']' +SEMICOLON ::= ';' +QUESTION ::= '?' +COLON ::= ':' +COMMA ::= ',' +DOT ::= '.' +EQUAL ::= '=' + +$end +-- need a carriage return after the $end diff --git a/org.eclipse.wst.jsdt.core/grammar/js_original.g b/org.eclipse.wst.jsdt.core/grammar/js_original.g new file mode 100644 index 0000000..07c1f3e --- /dev/null +++ b/org.eclipse.wst.jsdt.core/grammar/js_original.g @@ -0,0 +1,1304 @@ +--main options +%options ACTION, AN=JavaAction.java, GP=java, +%options FILE-PREFIX=java, ESCAPE=$, PREFIX=TokenName, OUTPUT-SIZE=125 , +%options NOGOTO-DEFAULT, SINGLE-PRODUCTIONS, LALR=1 , TABLE, + +--error recovering options..... +%options ERROR_MAPS + +--grammar understanding options +%options first follow +%options TRACE=FULL , +%options VERBOSE + +%options DEFERRED +%options NAMES=MAX +%options SCOPES + +--Usefull macros helping reading/writing semantic actions +$Define +$putCase +/. case $rule_number : if (DEBUG) { System.out.println("$rule_text"); } //$NON-NLS-1$ + ./ + +$break +/. + break; +./ + + +$readableName +/.1#$rule_number#./ +$compliance +/.2#$rule_number#./ +$recovery +/.2#$rule_number# recovery./ +$recovery_template +/.3#$rule_number#./ +$no_statements_recovery +/.4#$rule_number# 1./ +$empty_statement +/.5#$rule_number# 1./ +-- here it starts really ------------------------------------------ +$Terminals + + Identifier + + abstract boolean break byte case catch char class + continue const default delete debugger do double else enum export extends false final finally float + for function goto if in infinity implements import instanceof int + interface long native new null package private + protected public return short static strictfp super switch + synchronized this throw throws transient true try typeof undefined var void + volatile with while + + IntegerLiteral + LongLiteral + FloatingPointLiteral + DoubleLiteral + CharacterLiteral + StringLiteral + RegExLiteral + + PLUS_PLUS + MINUS_MINUS + EQUAL_EQUAL + EQUAL_EQUAL_EQUAL + NOT_EQUAL_EQUAL + LESS_EQUAL + GREATER_EQUAL + NOT_EQUAL + LEFT_SHIFT + RIGHT_SHIFT + UNSIGNED_RIGHT_SHIFT + PLUS_EQUAL + MINUS_EQUAL + MULTIPLY_EQUAL + DIVIDE_EQUAL + AND_EQUAL + OR_EQUAL + XOR_EQUAL + REMAINDER_EQUAL + LEFT_SHIFT_EQUAL + RIGHT_SHIFT_EQUAL + UNSIGNED_RIGHT_SHIFT_EQUAL + OR_OR + AND_AND + PLUS + MINUS + NOT + REMAINDER + XOR + AND + MULTIPLY + OR + TWIDDLE + DIVIDE + GREATER + LESS + LPAREN + RPAREN + LBRACE + RBRACE + LBRACKET + RBRACKET + SEMICOLON + QUESTION + COLON + COMMA + DOT + EQUAL + AT + +-- BodyMarker + +$Alias + + '++' ::= PLUS_PLUS + '--' ::= MINUS_MINUS + '==' ::= EQUAL_EQUAL + '===' ::= EQUAL_EQUAL_EQUAL + '<=' ::= LESS_EQUAL + '>=' ::= GREATER_EQUAL + '!=' ::= NOT_EQUAL + '!==' ::= NOT_EQUAL_EQUAL + '<<' ::= LEFT_SHIFT + '>>' ::= RIGHT_SHIFT + '>>>' ::= UNSIGNED_RIGHT_SHIFT + '+=' ::= PLUS_EQUAL + '-=' ::= MINUS_EQUAL + '*=' ::= MULTIPLY_EQUAL + '/=' ::= DIVIDE_EQUAL + '&=' ::= AND_EQUAL + '|=' ::= OR_EQUAL + '^=' ::= XOR_EQUAL + '%=' ::= REMAINDER_EQUAL + '<<=' ::= LEFT_SHIFT_EQUAL + '>>=' ::= RIGHT_SHIFT_EQUAL + '>>>=' ::= UNSIGNED_RIGHT_SHIFT_EQUAL + '||' ::= OR_OR + '&&' ::= AND_AND + '+' ::= PLUS + '-' ::= MINUS + '!' ::= NOT + '%' ::= REMAINDER + '^' ::= XOR + '&' ::= AND + '*' ::= MULTIPLY + '|' ::= OR + '~' ::= TWIDDLE + '/' ::= DIVIDE + '>' ::= GREATER + '<' ::= LESS + '(' ::= LPAREN + ')' ::= RPAREN + '{' ::= LBRACE + '}' ::= RBRACE + '[' ::= LBRACKET + ']' ::= RBRACKET + ';' ::= SEMICOLON + '?' ::= QUESTION + ':' ::= COLON + ',' ::= COMMA + '.' ::= DOT + '=' ::= EQUAL + '@' ::= AT + +$Start + Goal + +$Rules + +/.// This method is part of an automatic generation : do NOT edit-modify +protected void consumeRule(int act) { + switch ( act ) { +./ + + + +Goal ::= '++' CompilationUnit +Goal ::= '--' MethodBody +-- error recovery +-- Modifiersopt is used to properly consume a header and exit the rule reduction at the end of the parse() method +Goal ::= '>>>' Header1 Modifiersopt +Goal ::= '*' BlockStatements +Goal ::= '*' CatchHeader +-- JDOM +Goal ::= '&&' LocalVariableDeclaration +-- code snippet +Goal ::= '%' Expression +-- completion parser +Goal ::= '~' BlockStatementsopt +Goal ::= '+' ProgramElement +/:$readableName Goal:/ + +Literal -> IntegerLiteral +Literal -> LongLiteral +Literal -> FloatingPointLiteral +Literal -> DoubleLiteral +Literal -> CharacterLiteral +Literal -> StringLiteral +Literal -> RegExLiteral +Literal -> null +Literal -> undefined +Literal -> BooleanLiteral +/:$readableName Literal:/ +BooleanLiteral -> true +BooleanLiteral -> false +/:$readableName BooleanLiteral:/ + +-------------------------------------------------------------- +SimpleName -> 'Identifier' +/:$readableName SimpleName:/ + +CompilationUnit ::= EnterCompilationUnit InternalCompilationUnit +/.$putCase consumeCompilationUnit(); $break ./ +/:$readableName CompilationUnit:/ + +InternalCompilationUnit ::= ProgramElements +/.$putCase consumeInternalCompilationUnitWithTypes(); $break ./ +InternalCompilationUnit ::= $empty +/.$putCase consumeEmptyInternalCompilationUnit(); $break ./ +/:$readableName CompilationUnit:/ + +EnterCompilationUnit ::= $empty +/.$putCase consumeEnterCompilationUnit(); $break ./ +/:$readableName EnterCompilationUnit:/ + +Header -> RecoveryMethodHeader +Header -> LocalVariableDeclaration +/:$readableName Header:/ + +Header1 -> Header +/:$readableName Header1:/ + +CatchHeader ::= 'catch' '(' FormalParameter ')' '{' +/.$putCase consumeCatchHeader(); $break ./ +/:$readableName CatchHeader:/ + +VariableDeclarators -> VariableDeclarator +VariableDeclarators ::= VariableDeclarators ',' VariableDeclarator +/.$putCase consumeVariableDeclarators(); $break ./ +/:$readableName VariableDeclarators:/ + +VariableDeclaratorsNoIn -> VariableDeclaratorNoIn +VariableDeclaratorsNoIn ::= VariableDeclaratorsNoIn ',' VariableDeclaratorNoIn +/.$putCase consumeVariableDeclarators(); $break ./ +/:$readableName VariableDeclarators:/ + +VariableDeclarator ::= VariableDeclaratorId EnterVariable ExitVariableWithoutInitialization +VariableDeclarator ::= VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization +/:$readableName VariableDeclarator:/ +/:$recovery_template Identifier:/ + +VariableDeclaratorNoIn ::= VariableDeclaratorId EnterVariable ExitVariableWithoutInitialization +VariableDeclaratorNoIn ::= VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializerNoIn RestoreDiet ExitVariableWithInitialization +/:$readableName VariableDeclarator:/ +/:$recovery_template Identifier:/ + +EnterVariable ::= $empty +/.$putCase consumeEnterVariable(); $break ./ +/:$readableName EnterVariable:/ + +ExitVariableWithInitialization ::= $empty +/.$putCase consumeExitVariableWithInitialization(); $break ./ +/:$readableName ExitVariableWithInitialization:/ + +ExitVariableWithoutInitialization ::= $empty +/.$putCase consumeExitVariableWithoutInitialization(); $break ./ +/:$readableName ExitVariableWithoutInitialization:/ + +ForceNoDiet ::= $empty +/.$putCase consumeForceNoDiet(); $break ./ +/:$readableName ForceNoDiet:/ +RestoreDiet ::= $empty +/.$putCase consumeRestoreDiet(); $break ./ +/:$readableName RestoreDiet:/ + +VariableDeclaratorId ::= 'Identifier' +/:$readableName VariableDeclaratorId:/ +/:$recovery_template Identifier:/ + +VariableInitializer -> AssignmentExpression +/:$readableName VariableInitializer:/ +/:$recovery_template Identifier:/ + +VariableInitializerNoIn -> AssignmentExpressionNoIn +/:$readableName VariableInitializer:/ +/:$recovery_template Identifier:/ + +FunctionExpression ::= FunctionExpressionHeader MethodBody +/.$putCase // set to true to consume a method with a body + consumeFunctionExpression(); $break ./ +/:$readableName FunctionExpression:/ + +FunctionExpressionHeader ::= FunctionExpressionHeaderName FormalParameterListopt MethodHeaderRightParen +/.$putCase consumeMethodHeader(); $break ./ +/:$readableName FunctionExpressionHeader :/ + +FunctionExpressionHeaderName ::= Modifiersopt 'function' 'Identifier' '(' +/.$putCase consumeMethodHeaderName(false); $break ./ +FunctionExpressionHeaderName ::= Modifiersopt 'function' '(' +/.$putCase consumeMethodHeaderName(true); $break ./ +/:$readableName FunctionExpressionHeaderName :/ + +MethodDeclaration -> AbstractMethodDeclaration +MethodDeclaration ::= MethodHeader MethodBody +/.$putCase // set to true to consume a method with a body + consumeMethodDeclaration(true); $break ./ +/:$readableName MethodDeclaration:/ + +AbstractMethodDeclaration ::= MethodHeader ';' +/.$putCase // set to false to consume a method without body + consumeMethodDeclaration(false); $break ./ +/:$readableName MethodDeclaration:/ + +MethodHeader ::= MethodHeaderName FormalParameterListopt MethodHeaderRightParen +/.$putCase consumeMethodHeader(); $break ./ +/:$readableName MethodDeclaration:/ + +MethodHeaderName ::= Modifiersopt 'function' 'Identifier' '(' +/.$putCase consumeMethodHeaderName(false); $break ./ +/:$readableName MethodHeaderName:/ + +MethodHeaderRightParen ::= ')' +/.$putCase consumeMethodHeaderRightParen(); $break ./ +/:$readableName ):/ +/:$recovery_template ):/ + +FormalParameterList -> FormalParameter +FormalParameterList ::= FormalParameterList ',' FormalParameter +/.$putCase consumeFormalParameterList(); $break ./ +/:$readableName FormalParameterList:/ + +--1.1 feature +FormalParameter ::= VariableDeclaratorId +/.$putCase consumeFormalParameter(false); $break ./ + +MethodBody ::= NestedMethod '{' PostDoc BlockStatementsopt '}' +/.$putCase consumeMethodBody(); $break ./ +/:$readableName MethodBody:/ +-- /:$no_statements_recovery:/ + +NestedMethod ::= $empty +/.$putCase consumeNestedMethod(); $break ./ +/:$readableName NestedMethod:/ + +PostDoc ::= $empty +/.$putCase consumePostDoc(); $break ./ +/:$readableName PostDoc:/ + +PushLeftBraceObjLit ::= $empty +/.$putCase consumePushLeftBrace(); $break ./ +/:$readableName PushLeftBrace:/ + +Block ::= OpenBlock '{' BlockStatementsopt '}' +/.$putCase consumeBlock(); $break ./ +/:$readableName Block:/ + +OpenBlock ::= $empty +/.$putCase consumeOpenBlock() ; $break ./ +/:$readableName OpenBlock:/ + +ProgramElements -> ProgramElement +ProgramElements ::= ProgramElements ProgramElement +/.$putCase consumeProgramElements() ; $break ./ +/:$readableName ProgramElements:/ + +ProgramElement -> BlockStatement +/:$readableName ProgramElement:/ + +BlockStatements -> BlockStatement +BlockStatements ::= BlockStatements BlockStatement +/.$putCase consumeBlockStatements() ; $break ./ +/:$readableName BlockStatements:/ + +BlockStatement -> LocalVariableDeclarationStatement +BlockStatement -> MethodDeclaration +BlockStatement -> Statement + +LocalVariableDeclarationStatement ::= LocalVariableDeclaration ';' +/.$putCase consumeLocalVariableDeclarationStatement(); $break ./ +/:$readableName LocalVariableDeclarationStatement:/ + +LocalVariableDeclaration ::= 'var' PushModifiers VariableDeclarators +/.$putCase consumeLocalVariableDeclaration(); $break ./ +/:$readableName LocalVariableDeclaration:/ + +LocalVariableDeclarationNoIn ::= 'var' PushModifiers VariableDeclaratorsNoIn +/.$putCase consumeLocalVariableDeclaration(); $break ./ +/:$readableName LocalVariableDeclaration:/ + +PushModifiers ::= $empty +/.$putCase consumePushModifiers(); $break ./ +/:$readableName PushModifiers:/ + +Statement -> StatementWithoutTrailingSubstatement +Statement -> LabeledStatement +Statement -> IfThenStatement +Statement -> IfThenElseStatement +Statement -> WhileStatement +Statement -> WithStatement +Statement -> ForStatement +/:$readableName Statement:/ +/:$recovery_template ;:/ + +StatementNoShortIf -> StatementWithoutTrailingSubstatement +StatementNoShortIf -> LabeledStatementNoShortIf +StatementNoShortIf -> IfThenElseStatementNoShortIf +StatementNoShortIf -> WhileStatementNoShortIf +StatementNoShortIf -> WithStatementNoShortIf +StatementNoShortIf -> ForStatementNoShortIf +/:$readableName Statement:/ + +StatementWithoutTrailingSubstatement -> Block +StatementWithoutTrailingSubstatement -> EmptyStatement +StatementWithoutTrailingSubstatement -> ExpressionStatement +StatementWithoutTrailingSubstatement -> SwitchStatement +StatementWithoutTrailingSubstatement -> DoStatement +StatementWithoutTrailingSubstatement -> BreakStatement +StatementWithoutTrailingSubstatement -> ContinueStatement +StatementWithoutTrailingSubstatement -> ReturnStatement +StatementWithoutTrailingSubstatement -> ThrowStatement +StatementWithoutTrailingSubstatement -> TryStatement +/:$readableName Statement:/ + +EmptyStatement ::= ';' +/.$putCase consumeEmptyStatement(); $break ./ +/:$readableName EmptyStatement:/ +/:$empty_statement:/ + +LabeledStatement ::= Label ':' Statement +/.$putCase consumeStatementLabel() ; $break ./ +/:$readableName LabeledStatement:/ + +LabeledStatementNoShortIf ::= Label ':' StatementNoShortIf +/.$putCase consumeStatementLabel() ; $break ./ +/:$readableName LabeledStatement:/ + +Label ::= 'Identifier' +/.$putCase consumeLabel() ; $break ./ +/:$readableName Label:/ + +ExpressionStatement ::= StatementExpression ';' +/. $putCase consumeExpressionStatement(); $break ./ +-- /:$readableName Statement:/ + +StatementExpression ::= ListExpressionStmt +/:$readableName Expression:/ + +IfThenStatement ::= 'if' '(' Expression ')' BlockStatement +/.$putCase consumeStatementIfNoElse(); $break ./ +/:$readableName IfStatement:/ + +IfThenElseStatement ::= 'if' '(' Expression ')' StatementNoShortIf 'else' BlockStatement +/.$putCase consumeStatementIfWithElse(); $break ./ +/:$readableName IfStatement:/ + +IfThenElseStatementNoShortIf ::= 'if' '(' Expression ')' StatementNoShortIf 'else' StatementNoShortIf +/.$putCase consumeStatementIfWithElse(); $break ./ +/:$readableName IfStatement:/ + +IfThenElseStatement ::= 'if' '(' Expression ')' LocalVariableDeclarationStatement 'else' BlockStatement +/.$putCase consumeStatementIfWithElse(); $break ./ +/:$readableName IfStatement:/ + +IfThenElseStatementNoShortIf ::= 'if' '(' Expression ')' LocalVariableDeclarationStatement 'else' LocalVariableDeclarationStatement +/.$putCase consumeStatementIfWithElse(); $break ./ +/:$readableName IfStatement:/ + +SwitchStatement ::= 'switch' '(' Expression ')' OpenBlock SwitchBlock +/.$putCase consumeStatementSwitch() ; $break ./ +/:$readableName SwitchStatement:/ + +SwitchBlock ::= '{' '}' +/.$putCase consumeEmptySwitchBlock() ; $break ./ + +SwitchBlock ::= '{' SwitchBlockStatements '}' +SwitchBlock ::= '{' SwitchLabels '}' +SwitchBlock ::= '{' SwitchBlockStatements SwitchLabels '}' +/.$putCase consumeSwitchBlock() ; $break ./ +/:$readableName SwitchBlock:/ + +SwitchBlockStatements -> SwitchBlockStatement +SwitchBlockStatements ::= SwitchBlockStatements SwitchBlockStatement +/.$putCase consumeSwitchBlockStatements() ; $break ./ +/:$readableName SwitchBlockStatements:/ + +SwitchBlockStatement ::= SwitchLabels BlockStatements +/.$putCase consumeSwitchBlockStatement() ; $break ./ +/:$readableName SwitchBlockStatement:/ + +SwitchLabels -> SwitchLabel +SwitchLabels ::= SwitchLabels SwitchLabel +/.$putCase consumeSwitchLabels() ; $break ./ +/:$readableName SwitchLabels:/ + +SwitchLabel ::= 'case' ConstantExpression ':' +/. $putCase consumeCaseLabel(); $break ./ + +SwitchLabel ::= 'default' ':' +/. $putCase consumeDefaultLabel(); $break ./ +/:$readableName SwitchLabel:/ + +WhileStatement ::= 'while' '(' Expression ')' Statement +/.$putCase consumeStatementWhile() ; $break ./ +/:$readableName WhileStatement:/ + +WhileStatementNoShortIf ::= 'while' '(' Expression ')' StatementNoShortIf +/.$putCase consumeStatementWhile() ; $break ./ +/:$readableName WhileStatement:/ + +WithStatement ::= 'with' '(' Expression ')' Statement +/.$putCase consumeStatementWith() ; $break ./ +/:$readableName WithStatement:/ + +WithStatementNoShortIf ::= 'with' '(' Expression ')' StatementNoShortIf +/.$putCase consumeStatementWith() ; $break ./ +/:$readableName WithStatementNoShortIf:/ + +DoStatement ::= 'do' Statement 'while' '(' Expression ')' ';' +/.$putCase consumeStatementDo() ; $break ./ +/:$readableName DoStatement:/ + +ForStatement ::= 'for' '(' ForInitopt ';' Expressionopt ';' ForUpdateopt ')' Statement +/.$putCase consumeStatementFor() ; $break ./ +/:$readableName ForStatement:/ + +ForStatement ::= 'for' '(' ForInInit 'in' Expression ')' Statement +/.$putCase consumeStatementForIn() ; $break ./ +/:$readableName ForStatement:/ + +ForStatementNoShortIf ::= 'for' '(' ForInitopt ';' Expressionopt ';' ForUpdateopt ')' StatementNoShortIf +/.$putCase consumeStatementFor() ; $break ./ +/:$readableName ForStatement:/ + +ForStatementNoShortIf ::= 'for' '(' ForInInit 'in' Expression ')' StatementNoShortIf +/.$putCase consumeStatementForIn() ; $break ./ +/:$readableName ForStatement:/ + + +-- SHOULD BE 'FullPostfixExpression', but that causes shift/reduce conflict +ForInInit ::= SimpleName +/.$putCase consumeForInInit() ; $break ./ +ForInInit -> LocalVariableDeclarationNoIn +/:$readableName ForInit:/ + +--the minus one allows to avoid a stack-to-stack transfer +ForInit ::= StatementExpressionListNoIn +/.$putCase consumeForInit() ; $break ./ +ForInit -> LocalVariableDeclarationNoIn +/:$readableName ForInit:/ + +ForUpdate -> StatementExpressionList +/:$readableName ForUpdate:/ + +StatementExpressionList -> AssignmentExpression +StatementExpressionList ::= StatementExpressionList ',' AssignmentExpression +/.$putCase consumeStatementExpressionList() ; $break ./ +/:$readableName StatementExpressionList:/ + +StatementExpressionListNoIn -> AssignmentExpressionNoIn +StatementExpressionListNoIn ::= StatementExpressionListNoIn ',' AssignmentExpressionNoIn +/.$putCase consumeStatementExpressionList() ; $break ./ +/:$readableName StatementExpressionList:/ + +BreakStatement ::= 'break' ';' +/.$putCase consumeStatementBreak() ; $break ./ + +BreakStatement ::= 'break' Identifier ';' +/.$putCase consumeStatementBreakWithLabel() ; $break ./ +/:$readableName BreakStatement:/ + +ContinueStatement ::= 'continue' ';' +/.$putCase consumeStatementContinue() ; $break ./ + +ContinueStatement ::= 'continue' Identifier ';' +/.$putCase consumeStatementContinueWithLabel() ; $break ./ +/:$readableName ContinueStatement:/ + +ReturnStatement ::= 'return' Expressionopt ';' +/.$putCase consumeStatementReturn() ; $break ./ +/:$readableName ReturnStatement:/ + +ThrowStatement ::= 'throw' Expression ';' +/.$putCase consumeStatementThrow(); $break ./ +/:$readableName ThrowStatement:/ + +TryStatement ::= 'try' TryBlock Catches +/.$putCase consumeStatementTry(false); $break ./ +TryStatement ::= 'try' TryBlock Catchesopt Finally +/.$putCase consumeStatementTry(true); $break ./ +/:$readableName TryStatement:/ + +TryBlock ::= Block ExitTryBlock +/:$readableName Block:/ + +ExitTryBlock ::= $empty +/.$putCase consumeExitTryBlock(); $break ./ +/:$readableName ExitTryBlock:/ + +Catches -> CatchClause +Catches ::= Catches CatchClause +/.$putCase consumeCatches(); $break ./ +/:$readableName Catches:/ + +CatchClause ::= 'catch' '(' FormalParameter ')' Block +/.$putCase consumeStatementCatch() ; $break ./ +/:$readableName CatchClause:/ + +Finally ::= 'finally' Block +/:$readableName Finally:/ + +--18.12 Productions from 14: Expressions + +--for source positionning purpose +PushLPAREN ::= '(' +/.$putCase consumeLeftParen(); $break ./ +/:$readableName (:/ +/:$recovery_template (:/ +PushRPAREN ::= ')' +/.$putCase consumeRightParen(); $break ./ +/:$readableName ):/ +/:$recovery_template ):/ + +Primary -> PrimaryNoNewArray +Primary -> ArrayLiteral +Primary -> ObjectLiteral +Primary -> FunctionExpression +/:$readableName Primary:/ + +PrimaryNoNewArray -> Literal +PrimaryNoNewArray ::= 'this' +/.$putCase consumePrimaryNoNewArrayThis(); $break ./ + +PrimaryNoNewArray ::= PushLPAREN AssignmentExpression PushRPAREN +/.$putCase consumePrimaryNoNewArray(); $break ./ + +ObjectLiteral ::= '{'PushLeftBraceObjLit FieldList '}' +/.$putCase consumeObjectLiteral(); $break ./ +/:$readableName ObjectLiteral:/ + +FieldList ::= $empty +/.$putCase consumeEmptyFieldList(); $break ./ +FieldList -> NonemptyFieldList +/:$readableName FieldList:/ + +NonemptyFieldList -> LiteralField +NonemptyFieldList ::= NonemptyFieldList ',' LiteralField +/.$putCase consumeFieldList(); $break ./ +/:$readableName NonemptyFieldList:/ + +LiteralField ::= FieldName ':' AssignmentExpression +/.$putCase consumeLiteralField(); $break ./ +/:$readableName LiteralField:/ + +FieldName ::= SimpleName +/.$putCase consumeFieldNameSimple(); $break ./ +FieldName -> StringLiteral +FieldName -> CharacterLiteral +FieldName -> IntegerLiteral +/:$readableName FieldName:/ + +ArrayLiteral ::= ArrayLiteralHeader ElisionOpt ']' +/.$putCase comsumeArrayLiteral(false); $break ./ + +ArrayLiteral ::= ArrayLiteralHeader ArrayLiteralElementList ']' +/.$putCase comsumeArrayLiteral(false); $break ./ +/:$readableName ArrayLiteral:/ + +ArrayLiteral ::= ArrayLiteralHeader ArrayLiteralElementList ',' ElisionOpt ']' +/.$putCase comsumeArrayLiteral(true); $break ./ +/:$readableName ArrayLiteral:/ + +ArrayLiteralHeader ::= '[' +/.$putCase comsumeArrayLiteralHeader(); $break ./ + +ElisionOpt ::= $empty +/.$putCase comsumeElisionEmpty(); $break ./ +ElisionOpt -> Elision + +Elision ::= ',' +/.$putCase comsumeElisionOne(); $break ./ +Elision ::= Elision ',' +/.$putCase comsumeElisionList(); $break ./ + +ArrayLiteralElementList ::= ElisionOpt ArrayLiteralElement +/.$putCase comsumeArrayLiteralListOne(); $break ./ +ArrayLiteralElementList ::= ArrayLiteralElementList ',' ElisionOpt ArrayLiteralElement +/.$putCase comsumeArrayLiteralList(); $break ./ + +ArrayLiteralElement ::= AssignmentExpression +/.$putCase comsumeArrayLiteralElement(); $break ./ +/:$readableName ArrayLiteralElement:/ + +FullNewExpression ::= 'new' FullNewSubexpression '(' ArgumentListopt ')' +/.$putCase consumeFullNewExpression(); $break ./ +/:$readableName FullNewExpression:/ + +FullNewSubexpression -> Primary +FullNewSubexpression ::= SimpleName +/.$putCase consumeFullNewSubexpressionSimpleName (); $break ./ +FullNewSubexpression -> FullNewExpression +FullNewSubexpression ::= FullNewSubexpression PropertyOperator +/.$putCase consumeFullNewSubexpressionPropertyOperator(); $break ./ +/:$readableName FullNewSubexpression:/ + +ShortNewExpression ::= 'new' ShortNewSubexpression +/.$putCase comsumeShortNewSubexpression(); $break ./ +/:$readableName ShortNewExpression:/ + + +ShortNewSubexpression -> FullNewSubexpression +ShortNewSubexpression -> ShortNewExpression +/:$readableName ShortNewSubexpression:/ + +PropertyOperator ::= '.' SimpleName +/.$putCase consumePropertyOperator() ; $break ./ +PropertyOperator -> Brackets +/.$putCase consumePropertyOperatorBrackets() ; $break ./ +/:$readableName PropertyOperator:/ + +Brackets ::= '[' Expression ']' +/.$putCase consumeListExpressionBrackets() ; $break ./ +/:$readableName Brackets:/ + + +ListExpression -> AssignmentExpression +ListExpression ::= ListExpression ',' AssignmentExpression +/.$putCase consumeListExpression(); $break ./ +/:$readableName ListExpression:/ + +ListExpressionStmt -> AssignmentExpressionStmt +ListExpressionStmt ::= ListExpressionStmt ',' AssignmentExpressionStmt +/.$putCase consumeListExpression(); $break ./ +/:$readableName ListExpression:/ + + +ArgumentList ::= AssignmentExpression +ArgumentList ::= ArgumentList ',' AssignmentExpression +/.$putCase consumeArgumentList(); $break ./ +/:$readableName ArgumentList:/ + +MethodInvocation ::= FullPostfixExpression '(' ArgumentListopt ')' +/.$putCase consumeMethodInvocationPrimary(); $break ./ +/:$readableName MethodInvocation:/ + +PostfixExpression -> FullPostfixExpression +PostfixExpression -> ShortNewExpression + +FullPostfixExpression -> Primary +-- used identifier instead FullPostfixExpression -> ExpressionQualifiedIdentifier +FullPostfixExpression ::= SimpleName +/.$putCase consumePostfixExpression(); $break ./ +FullPostfixExpression -> FullNewExpression +FullPostfixExpression ::= FullPostfixExpression PropertyOperator +/.$putCase consumeFullPropertyOperator(); $break ./ +FullPostfixExpression ::= MethodInvocation +/.$putCase consumeMethodInvocation(); $break ./ +FullPostfixExpression -> PostIncrementExpression +FullPostfixExpression -> PostDecrementExpression +-- /:$readableName FullPostfixExpression:/ + +PostIncrementExpression ::= PostfixExpression '++' +/.$putCase consumeUnaryExpression(OperatorIds.PLUS,true); $break ./ +/:$readableName PostIncrementExpression:/ + +PostDecrementExpression ::= PostfixExpression '--' +/.$putCase consumeUnaryExpression(OperatorIds.MINUS,true); $break ./ +/:$readableName PostDecrementExpression:/ + +--for source managment purpose +PushPosition ::= $empty + /.$putCase consumePushPosition(); $break ./ +/:$readableName PushPosition:/ + +UnaryExpression -> PreIncrementExpression +UnaryExpression -> PreDecrementExpression +UnaryExpression ::= '+' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.PLUS); $break ./ +UnaryExpression ::= '-' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.MINUS); $break ./ +UnaryExpression -> UnaryExpressionNotPlusMinus +/:$readableName Expression:/ + +PreIncrementExpression ::= '++' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.PLUS,false); $break ./ +/:$readableName PreIncrementExpression:/ + +PreDecrementExpression ::= '--' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.MINUS,false); $break ./ +/:$readableName PreDecrementExpression:/ + +UnaryExpressionNotPlusMinus -> PostfixExpression +UnaryExpressionNotPlusMinus ::= '~' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.TWIDDLE); $break ./ +UnaryExpressionNotPlusMinus ::= '!' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.NOT); $break ./ +UnaryExpressionNotPlusMinus ::= 'delete' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.DELETE); $break ./ +UnaryExpressionNotPlusMinus ::= 'void' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.VOID); $break ./ +UnaryExpressionNotPlusMinus ::= 'typeof' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.TYPEOF); $break ./ +/:$readableName Expression:/ + +MultiplicativeExpression -> UnaryExpression +MultiplicativeExpression ::= MultiplicativeExpression '*' UnaryExpression +/.$putCase consumeBinaryExpression(OperatorIds.MULTIPLY); $break ./ +MultiplicativeExpression ::= MultiplicativeExpression '/' UnaryExpression +/.$putCase consumeBinaryExpression(OperatorIds.DIVIDE); $break ./ +MultiplicativeExpression ::= MultiplicativeExpression '%' UnaryExpression +/.$putCase consumeBinaryExpression(OperatorIds.REMAINDER); $break ./ +/:$readableName Expression:/ + +AdditiveExpression -> MultiplicativeExpression +AdditiveExpression ::= AdditiveExpression '+' MultiplicativeExpression +/.$putCase consumeBinaryExpression(OperatorIds.PLUS); $break ./ +AdditiveExpression ::= AdditiveExpression '-' MultiplicativeExpression +/.$putCase consumeBinaryExpression(OperatorIds.MINUS); $break ./ +/:$readableName Expression:/ + +ShiftExpression -> AdditiveExpression +ShiftExpression ::= ShiftExpression '<<' AdditiveExpression +/.$putCase consumeBinaryExpression(OperatorIds.LEFT_SHIFT); $break ./ +ShiftExpression ::= ShiftExpression '>>' AdditiveExpression +/.$putCase consumeBinaryExpression(OperatorIds.RIGHT_SHIFT); $break ./ +ShiftExpression ::= ShiftExpression '>>>' AdditiveExpression +/.$putCase consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT); $break ./ +/:$readableName Expression:/ + +-- +--RelationalExpression +-- +RelationalExpression -> ShiftExpression +RelationalExpression ::= RelationalExpression '<' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.LESS); $break ./ +RelationalExpression ::= RelationalExpression '>' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.GREATER); $break ./ +RelationalExpression ::= RelationalExpression '<=' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.LESS_EQUAL); $break ./ +RelationalExpression ::= RelationalExpression '>=' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.GREATER_EQUAL); $break ./ +RelationalExpression ::= RelationalExpression 'instanceof' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.INSTANCEOF); $break ./ +RelationalExpression ::= RelationalExpression 'in' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.IN); $break ./ +/:$readableName Expression:/ + +RelationalExpressionNoIn -> ShiftExpression +RelationalExpressionNoIn ::= RelationalExpressionNoIn '<' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.LESS); $break ./ +RelationalExpressionNoIn ::= RelationalExpressionNoIn '>' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.GREATER); $break ./ +RelationalExpressionNoIn ::= RelationalExpressionNoIn '<=' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.LESS_EQUAL); $break ./ +RelationalExpressionNoIn ::= RelationalExpressionNoIn '>=' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.GREATER_EQUAL); $break ./ +RelationalExpressionNoIn ::= RelationalExpressionNoIn 'instanceof' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.INSTANCEOF); $break ./ +/:$readableName Expression:/ + +-- +--EqualityExpression +-- +EqualityExpression -> RelationalExpression +EqualityExpression ::= EqualityExpression '==' RelationalExpression +/.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); $break ./ +EqualityExpression ::= EqualityExpression '!=' RelationalExpression +/.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL); $break ./ +EqualityExpression ::= EqualityExpression '===' RelationalExpression +/.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL_EQUAL); $break ./ +EqualityExpression ::= EqualityExpression '!==' RelationalExpression +/.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL_EQUAL); $break ./ +/:$readableName Expression:/ + +EqualityExpressionNoIn -> RelationalExpressionNoIn +EqualityExpressionNoIn ::= EqualityExpressionNoIn '==' RelationalExpressionNoIn +/.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); $break ./ +EqualityExpressionNoIn ::= EqualityExpressionNoIn '!=' RelationalExpressionNoIn +/.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL); $break ./ +EqualityExpressionNoIn ::= EqualityExpressionNoIn '===' RelationalExpressionNoIn +/.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL_EQUAL); $break ./ +EqualityExpressionNoIn ::= EqualityExpressionNoIn '!==' RelationalExpressionNoIn +/.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL_EQUAL); $break ./ +/:$readableName Expression:/ + +-- +--AndExpression +-- +AndExpression -> EqualityExpression +AndExpression ::= AndExpression '&' EqualityExpression +/.$putCase consumeBinaryExpression(OperatorIds.AND); $break ./ +/:$readableName Expression:/ + +AndExpressionNoIn -> EqualityExpressionNoIn +AndExpressionNoIn ::= AndExpressionNoIn '&' EqualityExpressionNoIn +/.$putCase consumeBinaryExpression(OperatorIds.AND); $break ./ +/:$readableName Expression:/ + +-- +--ExclusiveOrExpression +-- +ExclusiveOrExpression -> AndExpression +ExclusiveOrExpression ::= ExclusiveOrExpression '^' AndExpression +/.$putCase consumeBinaryExpression(OperatorIds.XOR); $break ./ +/:$readableName Expression:/ + +ExclusiveOrExpressionNoIn -> AndExpressionNoIn +ExclusiveOrExpressionNoIn ::= ExclusiveOrExpressionNoIn '^' AndExpressionNoIn +/.$putCase consumeBinaryExpression(OperatorIds.XOR); $break ./ +/:$readableName Expression:/ + +-- +--InclusiveOrExpression +-- +InclusiveOrExpression -> ExclusiveOrExpression +InclusiveOrExpression ::= InclusiveOrExpression '|' ExclusiveOrExpression +/.$putCase consumeBinaryExpression(OperatorIds.OR); $break ./ +/:$readableName Expression:/ + +InclusiveOrExpressionNoIn -> ExclusiveOrExpressionNoIn +InclusiveOrExpressionNoIn ::= InclusiveOrExpressionNoIn '|' ExclusiveOrExpressionNoIn +/.$putCase consumeBinaryExpression(OperatorIds.OR); $break ./ +/:$readableName Expression:/ + +-- +--ConditionalAndExpression +-- +ConditionalAndExpression -> InclusiveOrExpression +ConditionalAndExpression ::= ConditionalAndExpression '&&' InclusiveOrExpression +/.$putCase consumeBinaryExpression(OperatorIds.AND_AND); $break ./ +/:$readableName Expression:/ + +ConditionalAndExpressionNoIn -> InclusiveOrExpressionNoIn +ConditionalAndExpressionNoIn ::= ConditionalAndExpressionNoIn '&&' InclusiveOrExpressionNoIn +/.$putCase consumeBinaryExpression(OperatorIds.AND_AND); $break ./ +/:$readableName Expression:/ + +-- +--ConditionalOrExpression +-- +ConditionalOrExpression -> ConditionalAndExpression +ConditionalOrExpression ::= ConditionalOrExpression '||' ConditionalAndExpression +/.$putCase consumeBinaryExpression(OperatorIds.OR_OR); $break ./ +/:$readableName Expression:/ + +ConditionalOrExpressionNoIn -> ConditionalAndExpressionNoIn +ConditionalOrExpressionNoIn ::= ConditionalOrExpressionNoIn '||' ConditionalAndExpressionNoIn +/.$putCase consumeBinaryExpression(OperatorIds.OR_OR); $break ./ +/:$readableName Expression:/ + +-- +--ConditionalExpression +-- +ConditionalExpression -> ConditionalOrExpression +ConditionalExpression ::= ConditionalOrExpression '?' AssignmentExpression ':' AssignmentExpression +/.$putCase consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ; $break ./ +/:$readableName Expression:/ + +ConditionalExpressionNoIn -> ConditionalOrExpressionNoIn +ConditionalExpressionNoIn ::= ConditionalOrExpressionNoIn '?' AssignmentExpressionNoIn ':' AssignmentExpressionNoIn +/.$putCase consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ; $break ./ +/:$readableName Expression:/ + +-- +--AssignmentExpression +-- +AssignmentExpression -> ConditionalExpression +AssignmentExpression -> Assignment +/:$readableName Expression:/ +/:$recovery_template Identifier:/ + +AssignmentExpressionNoIn -> ConditionalExpressionNoIn +AssignmentExpressionNoIn -> AssignmentNoIn +/:$readableName Expression:/ +/:$recovery_template Identifier:/ + +-- +--Assignment +-- +Assignment ::= PostfixExpression AssignmentOperator AssignmentExpression +/.$putCase consumeAssignment(); $break ./ +/:$readableName Assignment:/ + +AssignmentNoIn ::= PostfixExpression AssignmentOperator AssignmentExpressionNoIn +/.$putCase consumeAssignment(); $break ./ +/:$readableName Assignment:/ + +AssignmentOperator ::= '=' +/.$putCase consumeAssignmentOperator(EQUAL); $break ./ +AssignmentOperator ::= '*=' +/.$putCase consumeAssignmentOperator(MULTIPLY); $break ./ +AssignmentOperator ::= '/=' +/.$putCase consumeAssignmentOperator(DIVIDE); $break ./ +AssignmentOperator ::= '%=' +/.$putCase consumeAssignmentOperator(REMAINDER); $break ./ +AssignmentOperator ::= '+=' +/.$putCase consumeAssignmentOperator(PLUS); $break ./ +AssignmentOperator ::= '-=' +/.$putCase consumeAssignmentOperator(MINUS); $break ./ +AssignmentOperator ::= '<<=' +/.$putCase consumeAssignmentOperator(LEFT_SHIFT); $break ./ +AssignmentOperator ::= '>>=' +/.$putCase consumeAssignmentOperator(RIGHT_SHIFT); $break ./ +AssignmentOperator ::= '>>>=' +/.$putCase consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT); $break ./ +AssignmentOperator ::= '&=' +/.$putCase consumeAssignmentOperator(AND); $break ./ +AssignmentOperator ::= '^=' +/.$putCase consumeAssignmentOperator(XOR); $break ./ +AssignmentOperator ::= '|=' +/.$putCase consumeAssignmentOperator(OR); $break ./ +/:$readableName AssignmentOperator:/ +/:$recovery_template =:/ + +Expression -> ListExpression +/:$readableName Expression:/ +/:$recovery_template Identifier:/ + +-- The following rules are for optional nonterminals. +Expressionopt ::= $empty +/.$putCase consumeEmptyExpression(); $break ./ +Expressionopt -> Expression +/:$readableName Expression:/ + +ConstantExpression -> Expression +/:$readableName ConstantExpression:/ + +-- +-- Disambigate OpenBlock and ObjectLiteral +-- +PrimaryStmt -> PrimaryNoNewArrayStmt +PrimaryStmt -> ArrayLiteral +/:$readableName PrimaryStmt:/ + +PrimaryNoNewArrayStmt -> Literal +PrimaryNoNewArrayStmt ::= 'this' +/.$putCase consumePrimaryNoNewArrayThis(); $break ./ + +PrimaryNoNewArrayStmt ::= PushLPAREN AssignmentExpression PushRPAREN +/.$putCase consumePrimaryNoNewArray(); $break ./ + + + + +FullNewExpressionStmt ::= 'new' FullNewSubexpression '(' ArgumentListopt ')' +/.$putCase consumeFullNewExpression(); $break ./ +/:$readableName FullNewExpression:/ + +ShortNewExpressionStmt ::= 'new' ShortNewSubexpression +/.$putCase comsumeShortNewSubexpression(); $break ./ +/:$readableName ShortNewExpression:/ + +MethodInvocationStmt ::= FullPostfixExpressionStmt '(' ArgumentListopt ')' +/.$putCase consumeMethodInvocationPrimary(); $break ./ +/:$readableName MethodInvocation:/ + +PostfixExpressionStmt -> FullPostfixExpressionStmt +PostfixExpressionStmt -> ShortNewExpressionStmt + + + +FullPostfixExpressionStmt -> PrimaryStmt +-- used identifier instead FullPostfixExpression -> ExpressionQualifiedIdentifier +FullPostfixExpressionStmt ::= SimpleName +/.$putCase consumePostfixExpression(); $break ./ +FullPostfixExpressionStmt -> FullNewExpressionStmt +FullPostfixExpressionStmt ::= FullPostfixExpressionStmt PropertyOperator +/.$putCase consumeFullPropertyOperator(); $break ./ +FullPostfixExpressionStmt ::= MethodInvocationStmt +/.$putCase consumeMethodInvocation(); $break ./ +FullPostfixExpressionStmt -> PostIncrementExpressionStmt +FullPostfixExpressionStmt -> PostDecrementExpressionStmt +-- /:$readableName FullPostfixExpression:/ + + + +PostIncrementExpressionStmt ::= PostfixExpressionStmt '++' +/.$putCase consumeUnaryExpression(OperatorIds.PLUS,true); $break ./ +/:$readableName PostIncrementExpression:/ + +PostDecrementExpressionStmt ::= PostfixExpressionStmt '--' +/.$putCase consumeUnaryExpression(OperatorIds.MINUS,true); $break ./ +/:$readableName PostDecrementExpression:/ + +UnaryExpressionStmt -> PreIncrementExpression +UnaryExpressionStmt -> PreDecrementExpression +UnaryExpressionStmt ::= '+' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.PLUS); $break ./ +UnaryExpressionStmt ::= '-' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.MINUS); $break ./ +UnaryExpressionStmt -> UnaryExpressionNotPlusMinusStmt +/:$readableName Expression:/ + +UnaryExpressionNotPlusMinusStmt -> PostfixExpressionStmt +UnaryExpressionNotPlusMinusStmt ::= '~' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.TWIDDLE); $break ./ +UnaryExpressionNotPlusMinusStmt ::= '!' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.NOT); $break ./ +UnaryExpressionNotPlusMinusStmt ::= 'delete' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.DELETE); $break ./ +UnaryExpressionNotPlusMinusStmt ::= 'void' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.VOID); $break ./ +UnaryExpressionNotPlusMinusStmt ::= 'typeof' PushPosition UnaryExpression +/.$putCase consumeUnaryExpression(OperatorIds.TYPEOF); $break ./ +-- UnaryExpressionNotPlusMinus -> CastExpression +/:$readableName Expression:/ + + +MultiplicativeExpressionStmt -> UnaryExpressionStmt +MultiplicativeExpressionStmt ::= MultiplicativeExpressionStmt '*' UnaryExpression +/.$putCase consumeBinaryExpression(OperatorIds.MULTIPLY); $break ./ +MultiplicativeExpressionStmt ::= MultiplicativeExpressionStmt '/' UnaryExpression +/.$putCase consumeBinaryExpression(OperatorIds.DIVIDE); $break ./ +MultiplicativeExpressionStmt ::= MultiplicativeExpressionStmt '%' UnaryExpression +/.$putCase consumeBinaryExpression(OperatorIds.REMAINDER); $break ./ +/:$readableName Expression:/ + +AdditiveExpressionStmt -> MultiplicativeExpressionStmt +AdditiveExpressionStmt ::= AdditiveExpressionStmt '+' MultiplicativeExpression +/.$putCase consumeBinaryExpression(OperatorIds.PLUS); $break ./ +AdditiveExpressionStmt ::= AdditiveExpressionStmt '-' MultiplicativeExpression +/.$putCase consumeBinaryExpression(OperatorIds.MINUS); $break ./ +/:$readableName Expression:/ + +ShiftExpressionStmt -> AdditiveExpressionStmt +ShiftExpressionStmt ::= ShiftExpressionStmt '<<' AdditiveExpression +/.$putCase consumeBinaryExpression(OperatorIds.LEFT_SHIFT); $break ./ +ShiftExpressionStmt ::= ShiftExpressionStmt '>>' AdditiveExpression +/.$putCase consumeBinaryExpression(OperatorIds.RIGHT_SHIFT); $break ./ +ShiftExpressionStmt ::= ShiftExpressionStmt '>>>' AdditiveExpression +/.$putCase consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT); $break ./ +/:$readableName Expression:/ + +RelationalExpressionStmt -> ShiftExpressionStmt +RelationalExpressionStmt ::= RelationalExpressionStmt '<' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.LESS); $break ./ +RelationalExpressionStmt ::= RelationalExpressionStmt '>' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.GREATER); $break ./ +RelationalExpressionStmt ::= RelationalExpressionStmt '<=' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.LESS_EQUAL); $break ./ +RelationalExpressionStmt ::= RelationalExpressionStmt '>=' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.GREATER_EQUAL); $break ./ +RelationalExpressionStmt ::= RelationalExpressionStmt 'instanceof' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.INSTANCEOF); $break ./ +RelationalExpressionStmt ::= RelationalExpressionStmt 'in' ShiftExpression +/.$putCase consumeBinaryExpression(OperatorIds.IN); $break ./ +/:$readableName Expression:/ + +EqualityExpressionStmt -> RelationalExpressionStmt +EqualityExpressionStmt ::= EqualityExpressionStmt '==' RelationalExpression +/.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); $break ./ +EqualityExpressionStmt ::= EqualityExpressionStmt '!=' RelationalExpression +/.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL); $break ./ +EqualityExpressionStmt ::= EqualityExpressionStmt '===' RelationalExpression +/.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL_EQUAL); $break ./ +EqualityExpressionStmt ::= EqualityExpressionStmt '!==' RelationalExpression +/.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL_EQUAL); $break ./ +/:$readableName Expression:/ + +AndExpressionStmt -> EqualityExpressionStmt +AndExpressionStmt ::= AndExpressionStmt '&' EqualityExpression +/.$putCase consumeBinaryExpression(OperatorIds.AND); $break ./ +/:$readableName Expression:/ + +ExclusiveOrExpressionStmt -> AndExpressionStmt +ExclusiveOrExpressionStmt ::= ExclusiveOrExpressionStmt '^' AndExpression +/.$putCase consumeBinaryExpression(OperatorIds.XOR); $break ./ +/:$readableName Expression:/ + +InclusiveOrExpressionStmt -> ExclusiveOrExpressionStmt +InclusiveOrExpressionStmt ::= InclusiveOrExpressionStmt '|' ExclusiveOrExpression +/.$putCase consumeBinaryExpression(OperatorIds.OR); $break ./ +/:$readableName Expression:/ + +ConditionalAndExpressionStmt -> InclusiveOrExpressionStmt +ConditionalAndExpressionStmt ::= ConditionalAndExpressionStmt '&&' InclusiveOrExpression +/.$putCase consumeBinaryExpression(OperatorIds.AND_AND); $break ./ +/:$readableName Expression:/ + +ConditionalOrExpressionStmt -> ConditionalAndExpressionStmt +ConditionalOrExpressionStmt ::= ConditionalOrExpressionStmt '||' ConditionalAndExpression +/.$putCase consumeBinaryExpression(OperatorIds.OR_OR); $break ./ +/:$readableName Expression:/ + +ConditionalExpressionStmt -> ConditionalOrExpressionStmt +ConditionalExpressionStmt ::= ConditionalOrExpressionStmt '?' AssignmentExpressionStmt ':' AssignmentExpressionStmt +/.$putCase consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ; $break ./ +/:$readableName Expression:/ + +AssignmentExpressionStmt -> ConditionalExpressionStmt +AssignmentExpressionStmt -> AssignmentStmt +/:$readableName Expression:/ +/:$recovery_template Identifier:/ + +AssignmentStmt ::= PostfixExpressionStmt AssignmentOperator AssignmentExpression +/.$putCase consumeAssignment(); $break ./ +/:$readableName AssignmentStmt:/ + +Modifiersopt ::= $empty +/. $putCase consumeDefaultModifiers(); $break ./ +/:$readableName Modifiers:/ + +BlockStatementsopt ::= $empty +/.$putCase consumeEmptyBlockStatementsopt(); $break ./ +BlockStatementsopt -> BlockStatements +/:$readableName BlockStatements:/ + +ArgumentListopt ::= $empty +/. $putCase consumeEmptyArgumentListopt(); $break ./ +ArgumentListopt -> ArgumentList +/:$readableName ArgumentList:/ + +FormalParameterListopt ::= $empty +/.$putcase consumeFormalParameterListopt(); $break ./ +FormalParameterListopt -> FormalParameterList +/:$readableName FormalParameterList:/ + +ForInitopt ::= $empty +/. $putCase consumeEmptyForInitopt(); $break ./ +ForInitopt -> ForInit +/:$readableName ForInit:/ + +ForUpdateopt ::= $empty +/. $putCase consumeEmptyForUpdateopt(); $break ./ +ForUpdateopt -> ForUpdate +/:$readableName ForUpdate:/ + +Catchesopt ::= $empty +/. $putCase consumeEmptyCatchesopt(); $break ./ +Catchesopt -> Catches +/:$readableName Catches:/ + +----------------------------------- +-- 1.5 features : recovery rules -- +----------------------------------- +RecoveryMethodHeaderName ::= Modifiersopt 'function' 'Identifier' '(' +/.$putCase consumeRecoveryMethodHeaderName(); $break ./ +/:$readableName MethodHeaderName:/ + +RecoveryMethodHeader ::= RecoveryMethodHeaderName FormalParameterListopt MethodHeaderRightParen +/.$putCase consumeMethodHeader(); $break ./ +-- RecoveryMethodHeader ::= RecoveryMethodHeaderName FormalParameterListopt MethodHeaderRightParen MethodHeaderExtendedDims MethodHeaderThrowsClause +-- /.$putCase consumeMethodHeader(); $break ./ +/:$readableName MethodHeader:/ +----------------------------------- +-- 1.5 features : recovery rules -- +----------------------------------- + +/. } +}./ + +$names + +PLUS_PLUS ::= '++' +MINUS_MINUS ::= '--' +EQUAL_EQUAL ::= '==' +LESS_EQUAL ::= '<=' +GREATER_EQUAL ::= '>=' +NOT_EQUAL ::= '!=' +LEFT_SHIFT ::= '<<' +RIGHT_SHIFT ::= '>>' +UNSIGNED_RIGHT_SHIFT ::= '>>>' +PLUS_EQUAL ::= '+=' +MINUS_EQUAL ::= '-=' +MULTIPLY_EQUAL ::= '*=' +DIVIDE_EQUAL ::= '/=' +AND_EQUAL ::= '&=' +OR_EQUAL ::= '|=' +XOR_EQUAL ::= '^=' +REMAINDER_EQUAL ::= '%=' +LEFT_SHIFT_EQUAL ::= '<<=' +RIGHT_SHIFT_EQUAL ::= '>>=' +UNSIGNED_RIGHT_SHIFT_EQUAL ::= '>>>=' +OR_OR ::= '||' +AND_AND ::= '&&' +PLUS ::= '+' +MINUS ::= '-' +NOT ::= '!' +REMAINDER ::= '%' +XOR ::= '^' +AND ::= '&' +MULTIPLY ::= '*' +OR ::= '|' +TWIDDLE ::= '~' +DIVIDE ::= '/' +GREATER ::= '>' +LESS ::= '<' +LPAREN ::= '(' +RPAREN ::= ')' +LBRACE ::= '{' +RBRACE ::= '}' +LBRACKET ::= '[' +RBRACKET ::= ']' +SEMICOLON ::= ';' +QUESTION ::= '?' +COLON ::= ':' +COMMA ::= ',' +DOT ::= '.' +EQUAL ::= '=' +AT ::= '@' + +$end +-- need a carriage return after the $end diff --git a/org.eclipse.wst.jsdt.core/libraries/baseBrowserLibrary--WrapperObjects.js b/org.eclipse.wst.jsdt.core/libraries/baseBrowserLibrary--WrapperObjects.js new file mode 100644 index 0000000..8d8eb4f --- /dev/null +++ b/org.eclipse.wst.jsdt.core/libraries/baseBrowserLibrary--WrapperObjects.js @@ -0,0 +1,1814 @@ +/******************************************************************************* + * Copyright (c) 2008, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +/** + * Object DOMException() + * @super Object + * @type constructor + * @memberOf DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +function DOMException(){}; +DOMException.prototype = new Object(); +/** + * Constant DOMException.INDEX_SIZE_ERR=1 + * @type Number + * @memberOf DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see DOMException() + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DOMException.INDEX_SIZE_ERR=1; +/** + * Constant DOMException.DOMSTRING_SIZE_ERR=2 + * @type Number + * @memberOf DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see DOMException() + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DOMException.DOMSTRING_SIZE_ERR=2; +/** + * Constant DOMException.HIERARCHY_REQUEST_ERR=3 + * @type Mi,ber + * @memberOf DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see DOMException() + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DOMException.HIERARCHY_REQUEST_ERR=3; +/** + * Constant DOMException.WRONG_DOCUMENT_ERR=4 + * @type Number + * @see DOMException() + * @memberOf DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DOMException.WRONG_DOCUMENT_ERR=4; +/** + * Constant DOMException.INVALID_CHARACTER_ERR=5 + * @memberOf DOMException + * @type Number + * @see DOMException() + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DOMException.INVALID_CHARACTER_ERR=5; +/** + * Constant DOMException.NO_DATA_ALLOWED_ER=6 + * @type Number + * @memberOf DOMException + * @see DOMException() + * @since Level 2 Document Object Model Core Definition. + * @since Standard ECMA-262 3rd. Edition + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DOMException.NO_DATA_ALLOWED_ER=6; +/** + * Constant DOMException.NO_MODIFICATION_ALLOWED_ERR=7 + * @type Number + * @memberOf DOMException + * @see DOMException() + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DOMException.NO_MODIFICATION_ALLOWED_ERR=7; +/** + * Constant DOMException.NOT_FOUND_ERR=8 + * @type Number + * @memberOf DOMException + * @see DOMException() + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DOMException.NOT_FOUND_ERR=8; +/** + * Constant DOMException.NOT_SUPPORTED_ERR=9 + * @type Number + * @memberOf DOMException + * @see DOMException() + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DOMException.NOT_SUPPORTED_ERR=9; +/** + * Constant DOMException.INUSE_ATTRIBUTE_ERR=10 + * @type Number + * @memberOf DOMException + * @see DOMException() + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DOMException.INUSE_ATTRIBUTE_ERR=10; +/** + * Constant DOMException.INVALID_STATE_ERR=11 + * @type Number + * @memberOf DOMException + * @see DOMException() + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DOMException.INVALID_STATE_ERR=11; +/** + * Constant DOMException.SYNTAX_ERR=12 + * @type Number + * @memberOf DOMException + * @see DOMException() + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DOMException.SYNTAX_ERR=12; +/** + * Constant DOMException.INVALID_MODIFICATION_ER=13 + * @type Number + * @memberOf DOMException + * @see DOMException() + + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DOMException.INVALID_MODIFICATION_ER=13; +/** + * Constant DOMException.NAMESPACE_ERR=14 + * @type Number + * @memberOf DOMException + * @see DOMException() + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DOMException.NAMESPACE_ERR=14; +/** + * Constant DOMException.NVALID_ACCESS_ERR=15 + * @type Number + * @memberOf DOMException + * @see DOMException() + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DOMException.INVALID_ACCESS_ERR=15; +/** + * Property code + * @type Number + * @memberOf DOMException + * @see DOMException() + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DOMException.prototype.code=new Number(); + + +/** + * Object DOMImplementation() + * @super Object + * @type constructor + * @memberOf DOMImplementation + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +function DOMImplementation(); +DOMImplementation.prototype = new Object(); + +/** + * function hasFeature() + * @type method + * @memberOf DOMImplementation + * @param {String} feature + * @param {String} version + * @returns {boolean} + * @see DOMImplementation + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DOMImplementation.prototype.hasFeature = new function(feature, version){}; + +/** + * function createDocumentType() + * @type method + * @memberOf DOMImplementation + * @param {String} namespaceURI + * @param {String} qualifiedName + * @param {DocumentType} doctype + * @returns {Document} + * @throws DOMException + * @see DOMImplementation + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DOMImplementation.prototype.createDocument = function(namespaceURI, qualifiedName, doctype){}; +/** + * function createDocumentType() + * @type method + * @memberOf DOMImplementation + + * @param {String} qualifiedName + * @param {String} publicId + * @param {String} systemId + + * @returns {DocumentType} + * @throws DOMException + * @see DOMImplementation + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DOMImplementation.prototype.createDocumentType = function(qualifiedName, publicId, systemId){}; +/** + * Object Node() + * @super Object + * @type constructor + * @memberOf Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +function Node(){}; +Node.prototype=new Object(); +/** + * Constant Node.ELEMENT_NODE=1 + * @type Number + * @memberOf Node + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.ELEMENT_NODE=1; +/** + * Constant Node.ATTRIBUTE_NODE=2 + * @type Number + * @memberOf Node + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.ATTRIBUTE_NODE=2; +/** + * Constant Node.TEXT_NODE=3 + * @type Number + * @memberOf Node + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.TEXT_NODE=3; +/** + * Constant Node.CDATA_SECTION_NODE=4 + * @type Number + * @memberOf Node + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.CDATA_SECTION_NODE=4; +/** + * Constant Node.ENTITY_REFERENCE_NODE=5 + * @type Number + * @memberOf Node + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.ENTITY_REFERENCE_NODE=5; +/** + * Constant Node.ENTITY_NODE=6 + * @type Number + * @memberOf Node + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.ENTITY_NODE=6; +/** + * Constant Node.PROCESSING_INSTRUCTION_NODE=7 + * @type Number + * @memberOf Node + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.PROCESSING_INSTRUCTION_NODE=7; +/** + * Constant Node.COMMENT_NODE=8 + * @type Number + * @memberOf Node + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.COMMENT_NODE=8; +/** + * Constant Node.DOCUMENT_NODE=9 + * @type Number + * @memberOf Node + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.DOCUMENT_NODE=9; +/** + * Constant Node.DOCUMENT_TYPE_NODE=10 + * @type Number + * @memberOf Node + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.DOCUMENT_TYPE_NODE=10; +/** + * Constant Node.DOCUMENT_FRAGMENT_NODE=11 + * @type Number + * @memberOf Node + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.DOCUMENT_FRAGMENT_NODE=11; +/** + * Constant Node.NOTATION_NODE=12 + * @type Number + * @memberOf Node + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.NOTATION_NODE=12; + +/** + * Property nodeName + * @type String + * @memberOf Node + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.nodeName = new String(); +/** + * Property nodeName + * @type String + * @memberOf Node + * @see Node + * @throws DOMException when setting or getting the value. + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.nodeValue = new String(); +/** + * Property nodeType + * @type Number + * @memberOf Node + * @see Node + + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.nodeType = new Number(); +/** + * Property parentNode + * @type Node + * @memberOf Node + * @see Node + + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.parentNode=new Node(); +/** + * Property childNodes + * @type NodeList + * @memberOf Node + * @see Node + * @see NodeList + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.childNodes=new NodeList(); +/** + * Property firstChild + * @type Node + * @memberOf Node + * @see Node + + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.firstChild=new Node(); +/** + * Property lastChild + * @type Node + * @memberOf Node + * @see Node + + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.lastChild=new Node(); +/** + * Property previousSibling + * @type Node + * @memberOf Node + * @see Node + + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.previousSibling=new Node(); +/** + * Property nextSibling + * @type Node + * @memberOf Node + * @see Node + + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.nextSibling=new Node(); +/** + * Property attributes + * @type NamedNodeMap + * @memberOf Node + * @see Node + * @see NamedNodeMap + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.attributes=new NamedNodeMap(); +/** + * Property ownerDocument + * @type Document + * @memberOf Node + * @see Node + * @see Document + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.ownerDocument = new Document(); +/** + * Property namespaceURI + * @type String + * @memberOf Node + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.namespaceURI=new String(); +/** + * Property prefix + * @type String + * @memberOf Node + * @see Node + * @throws DOMException on setting. + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.prefix = new String(); +/** + * Property localName + * @type String + * @memberOf Node + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.localName= new String(); +/** + * function insertBefore(newChild, refChild) + * @type Method + * @memberOf Node + * @param {Node} newChilds + * @param {Node} refChild + * @returns {Node} + * @throws DOMException + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.insertBefore = new function(newChild, refChild){}; +/** + * function replaceChild(newChild, oldChild) + * @type Method + * @memberOf Node + * @param {Node} newChilds + * @param {Node} oldChild + * @returns {Node} + * @throws DOMException + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.replaceChild = function(newChild, oldChild){}; + /** + * function removeChild(oldChild) + * @type Method + * @memberOf Node + * @param {Node} oldChild + * @returns {Node} + * @throws DOMException + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.removeChild = function(oldChild){}; + /** + * function appendChild(newChild) + * @type Method + * @memberOf Node + * @param {Node} newChild + * @returns {Node} + * @throws DOMException + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.appendChild = function(newChild){}; + /** + * function hasChildNodes() + * @type Method + * @memberOf Node + * @returns {Boolean} + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.hasChildNodes=function(){}; + /** + * function hasChildNodes() + * @type Method + * @memberOf Node + * @param {Boolean} deep + * @returns {Node} + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.cloneNode=function(deep){}; + /** + * function normalize() + * @type Method + * @memberOf Node + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.normalize = function(){}; + /** + * function isSupported(feature, version) + * @type Method + * @memberOf Node + * @param {String} feature + * @param {String} version + * @returns {Boolean} + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.isSupported=function(feature, version){}; + /** + * function hasAttributes() + * @type Method + * @memberOf Node + * @returns {Boolean} + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Node.prototype.hasAttributes=function(){}; + /** + * Object NodeList + * @type constructor + * @memberOf NodeList + * @see NodeList + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +function NodeList(){}; +NodeList.prototype = new Object(); + /** + * property length + * @type Number + * @memberOf NodeList + * @see NodeList + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ + +NodeList.prototype.length=new Number(); + /** + * function item(index) + * Note: This object can also be dereferenced using square bracket notation (e.g. obj[1]). Dereferencing with an integer index is equivalent to invoking the item method with that index + * @type Method + * @memberOf NodeList + * @param {Number} index + * @returns {Node} + * @see NodeList + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +NodeList.prototype.item = function(index){}; +/** + * Object DocumentFragment() + * DocumentFragment inherits all of the methods and properties from Document and Node. + * @super Document + * @type constructor + * @see Document + * @memberOf DocumentFragment + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +function DocumentFragment(){}; +DocumentFragment.prototype=new Document(); +/** + * Object Document() + * Document inherits all of the methods and properties from Node. + * @super Node + * @type constructor + * @see Node + * @memberOf Document + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +function Document(){}; +Document.prototype = new Node(); +/** + * property doctype + * @type DocumentType + * @see Document + * @see DocumentType + * @memberOf Document + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Document.prototype.doctype = new DocumentType(); +/** + * property implementation + * @type DOMImplementation + * @see Document + * @see DOMImplementation + * @memberOf Document + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Document.prototype.implementation = new DOMImplementation(); +/** + * property documentElement + * @type Element + * @see Document + * @see Element + * @memberOf Document + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Document.prototype.documentElement= new Element(); + /** + * function createElement(tagName) + * @type Method + * @memberOf Document + * @param {String} tagName + * @returns {Element} + * @throws DOMException + * @see Document + * @see Element + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ + +Document.prototype.createElement=function(tagName){}; + /** + * function createDocumentFragment() + * @type Method + * @memberOf Document + * @returns {DocumentFragment} + * @see Document + * @see DocumentFragment + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Document.prototype.createDocumentFragment=function(){}; + /** + * function createTextNode(data) + * @type Method + * @memberOf Document + * @param {String} data + * @returns {Text} + * @see Document + * @see Text + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Document.prototype.createTextNode=function(data){}; + /** + * function createComment(data) + * @type Method + * @memberOf Document + * @param {String} data + * @returns {Comment} + * @see Document + * @see Comment + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Document.prototype.createComment=function(data){}; + /** + * function createCDATASection(data) + * @type Method + * @memberOf Document + * @param {String} data + * @returns {CDATASection} + * @throws DOMException + * @see Document + * @see CDATASection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Document.prototype.createCDATASection = function(data){}; + /** + * function createProcessingInstruction(target, data) + * @type Method + * @memberOf Document + * @param {String} target + * @param {String} data + * @returns {ProcessingInstruction} + * @throws DOMException + * @see Document + * @see ProcessingInstruction + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Document.prototype.createProcessingInstruction=function(target, data){}; + /** + * function createAttribute(name) + * @type Method + * @memberOf Document + * @param {String} name + * @returns {Attr} + * @throws DOMException + * @see Document + * @see Attr + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Document.prototype.createAttribute=function(name){}; + /** + * function createEntityReference(name) + * @type Method + * @memberOf Document + * @param {String} name + * @returns {EntityReference} + * @throws DOMException + * @see Document + * @see EntityReference + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Document.prototype.createEntityReference=function(name){}; + /** + * function getElementsByTagName(tagname) + * @type Method + * @memberOf Document + * @param {String} tagname + * @returns {NodeList} + * @see Document + * @see NodeList + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Document.prototype.getElementsByTagName=function(tagname){}; + /** + * function importNode(importedNode, deep) + * @type Method + * @memberOf Document + * @param {Node} importedNode + * @param {Boolean} deep + * @returns {Node} + * @throws DOMException + * @see Document + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Document.prototype.importNode=function(importedNode, deep){}; + /** + * function createElementNS(namespaceURI, qualifiedName) + * @type Method + * @memberOf Document + * @param {String} namespaceURI + * @param {String} qualifiedName + * @returns {Element} + * @throws DOMException + * @see Document + * @see Element + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Document.prototype.createElementNS=function(namespaceURI, qualifiedName){}; + /** + * function createAttributeNS(namespaceURI, qualifiedName) + * @type Method + * @memberOf Document + * @param {String} namespaceURI + * @param {String} qualifiedName + * @returns {Attr} + * @throws DOMException + * @see Document + * @see Attr + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Document.prototype.createAttributeNS=function(namespaceURI, qualifiedName){}; +/** + * function getElementsByTagNameNS(namespaceURI, localName) + * @type Method + * @memberOf Document + * @param {String} namespaceURI + * @param {String} qualifiedName + * @returns {NodeList} + * @see Document + * @see NodeList + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Document.prototype.getElementsByTagNameNS=function(namespaceURI, localName){}; +/** + * function getElementById(elementId) + * @type Method + * @memberOf Document + * @param {String} elementId + * @returns {Element} + * @see Document + * @see Element + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Document.prototype.getElementById=function(elementId){}; +/** + * Object NamedNodeMap() + * @super Object + * @type constructor + * @memberOf NamedNodeMap + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +function NamedNodeMap(){}; +NamedNodeMap.prototype = new Object(); +/** + * property length + * @type Number + * @memberOf NamedNodeMap; + * @see NamedNodeMap + + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +NamedNodeMap.prototype.length=new Number(); +/** + * function getNamedItem(name) + * @type Method + * @memberOf NamedNodeMap + * @param {String} Name + * @returns {Node} + * @see NamedNodeMap + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +NamedNodeMap.prototype.getNamedItem=function(name){}; +/** + * function setNamedItem(arg) + * @type Method + * @memberOf NamedNodeMap + * @param {Node} arg + * @returns {Node} + * @throws DOMException + * @see NamedNodeMap + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +NamedNodeMap.prototype.setNamedItem=function(arg){}; +/** + * function removeNamedItem(name) + * @type Method + * @memberOf NamedNodeMap + * @param {String} name + * @returns {Node} + * @throws DOMException + * @see NamedNodeMap + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +NamedNodeMap.prototype.removeNamedItem=function(name){}; +/** + * function item(index) + * Note: This object can also be dereferenced using square bracket notation (e.g. obj[1]). Dereferencing with an integer index is equivalent to invoking the item method with that index. + * @type Method + * @memberOf NamedNodeMap + * @param {Number} index + * @returns {Node} + * @see NamedNodeMap + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +NamedNodeMap.prototype.item=function(index){}; +/** + * function getNamedItemNS(namespaceURI, localName) + * @type Method + * @memberOf NamedNodeMap + * @param {String} namespaceURI + * @param {String} localName + * @returns {Node} + * @see NamedNodeMap + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +NamedNodeMap.prototype.getNamedItemNS=function(namespaceURI, localName){}; +/** + * function setNamedItemNS(arg) + * @type Method + * @memberOf NamedNodeMap + * @param {Node} arg + * @param {String} localName + * @returns {Node} + * @throws DOMException + * @see NamedNodeMap + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +NamedNodeMap.prototype.setNamedItemNS=function(arg){}; +/** + * function removeNamedItemNS(namespaceURI, localName) + * @type Method + * @memberOf NamedNodeMap + * @param {String} namespaceURI + * @param {String} localName + * @returns {Node} + * @throws DOMException + * @see NamedNodeMap + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +NamedNodeMap.prototype.removeNamedItemNS=function(namespaceURI, localName){}; +/** + * Object CharacterData() + * CharacterData inherits all of the methods and properties from Node. + * @super Node + * @type constructor + * @see Node + * @memberOf CharacterData + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +function CharacterData(){}; +CharacterData.prototype=new Node(); +/** + * property data + * @type String + * @memberOf CharacterData + * @throws DOMException on setting and can raise a DOMException object on retrieval. + * @see CharacterData + + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +CharacterData.prototype.data=new String(); +/** + * property length + * @type Number + * @memberOf CharacterData + * @see CharacterData + + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +CharacterData.prototype.length=new Number(); +/** + * function substringData(offset, count) + * @type Method + * @memberOf CharacterData + * @param {Number} parameter + * @param {Number} count + * @returns {String} + * @throws DOMException + * @see CharacterData + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +CharacterData.prototype.substringData=function(offset, count){}; +/** + * function appendData(arg) + * @type Method + * @memberOf CharacterData + * @param {String} arg + * @returns {String} + * @throws DOMException + * @see CharacterData + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +CharacterData.prototype.appendData=function(arg){}; +/** + * function insertData(offset, arg) + * @type Method + * @memberOf CharacterData + * @param {Number} offset + * @param {String} arg + * @throws DOMException + * @see CharacterData + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +CharacterData.prototype.insertData=function(offset, arg){}; +/** + * function deleteData(offset, count) + * @type Method + * @memberOf CharacterData + * @param {Number} offset + * @param {Number} count + * @throws DOMException + * @see CharacterData + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +CharacterData.prototype.deleteData=function(offset, count){}; +/** + * function replaceData(offset, count, arg) + * @type Method + * @memberOf CharacterData + * @param {Number} offset + * @param {Number} count + * @param {String} arg + * @throws DOMException + * @see CharacterData + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +CharacterData.prototype.replaceData=function(offset, count, arg){}; +/** + * Object Attr() + * Attr inherits all of the methods and properties from Node. + * @super Node + * @type constructor + * @see Node + * @memberOf Attr + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +function Attr(){}; +Attr.prototype=new Node(); +/** + * property name + * @type String + * @memberOf Attr + + * @see Attr + + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Attr.prototype.name=new String(); +/** + * property specified + * @type Boolean + * @memberOf Attr + + * @see Attr + + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Attr.prototype.specified=new Boolean(); +/** + * property value + * @type Boolean + * @memberOf Attr + * @throws DOMException on setting and can raise a DOMException object on retrieval. + * @see Attr + + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Attr.prototype.value=new String(); +/** + * property ownerElement + * @type Element + * @memberOf Attr + * @throws DOMException on setting and can raise a DOMException object on retrieval. + * @see Attr + * @see Element + + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Attr.prototype.ownerElement=new Element(); +/** + * Object Element() + * Element inherits all of the methods and properties from Node. + * @super Node + * @type constructor + * @see Node + * @memberOf Attr + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +function Element(){}; +Element.prototype=new Node(); +/** + * property tagName + * @type String + * @memberOf Element + * @throws DOMException on setting and can raise a DOMException object on retrieval. + * @see Attr + * @see Element + + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Element.prototype.tagName=new String(); +/** + * function getAttribute(name) + * @type Method + * @memberOf Element + * @param {String} name + * @returns {String} + * @see Element + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Element.prototype.getAttribute=function(name){}; +/** + * function setAttribute(name, value) + * @type Method + * @memberOf Element + * @param {String} name + * @param {String} value + * @throws DOMException + * @see Element + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Element.prototype.setAttribute=function(name, value){}; +/** + * function removeAttribute(name) + * @type Method + * @memberOf Element + * @param {String} name + * @throws DOMException + * @see Element + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Element.prototype.removeAttribute=function(name){}; +/** + * function getAttributeNode(name) + * @type Method + * @memberOf Element + * @param {String} name + * @returns {Attr} + * @see Element + * @see Attr + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Element.prototype.getAttributeNode=function(name){}; +/** + * function setAttributeNode(newAttr) + * @type Method + * @memberOf Element + * @param {Attr} newAttr + * @returns {Attr} + * @throws DOMException + * @see Element + * @see Attr + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Element.prototype.setAttributeNode=function(newAttr){}; +/** + * function removeAttributeNode(oldAttr) + * @type Method + * @memberOf Element + * @param {Attr} oldAttr + * @returns {Attr} + * @throws DOMException + * @see Element + * @see Attr; + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Element.prototype.removeAttributeNode=function(oldAttr){}; +/** + * function getElementsByTagName(name) + * @type Method + * @memberOf Element + * @param {String} name + * @returns {NodeList} + * @see NodeList + * @see Element; + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Element.prototype.getElementsByTagName=function(name){}; +/** + * function getAttributeNS(namespaceURI, localName) + * @type Method + * @memberOf Element + * @param {String} namespaceURI + * @param {String} localName + * @returns {String} + * @see Element + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Element.prototype.getAttributeNS=function(namespaceURI, localName){}; + /** + * function setAttributeNS(namespaceURI, qualifiedName, value) + * @type Method + * @memberOf Element + * @param {String} namespaceURI + * @param {String} qualifiedName + * @param {String} value + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Element.prototype.setAttributeNS=function(namespaceURI, qualifiedName, value){}; + /** + * function removeAttributeNS(namespaceURI, localName) + * @type Method + * @memberOf Element + * @param {String} namespaceURI + * @param {String} localName + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Element.prototype.removeAttributeNS=function(namespaceURI, localName){}; + /** + * function getAttributeNodeNS(namespaceURI, localName) + * @type Method + * @memberOf Element + * @param {String} namespaceURI + * @param {String} localName + * @returns {Attr} + * @throws DOMException + * @see Attr + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Element.prototype.getAttributeNodeNS=function(namespaceURI, localName){}; + /** + * function setAttributeNodeNS(newAttr) + * @type Method + * @memberOf Element + * @param {Attr} newAttr + + * @returns {Attr} + * @throws DOMException + * @see Attr + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Element.prototype.setAttributeNodeNS=function(newAttr){}; + /** + * function getElementsByTagNameNS(namespaceURI, localName) + * @type Method + * @memberOf Element + * @param {String} namespaceURI + * @param {String} localName + + * @returns {NodeList} + + * @see NodeList + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Element.prototype.getElementsByTagNameNS=function(namespaceURI, localName){}; + /** + * function hasAttribute(name) + * @type Method + * @memberOf Element + + * @param {String} name + + * @returns {Boolean} + + + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Element.prototype.hasAttribute=function(name){}; + /** + * function hasAttributeNS(namespaceURI, localName) + * @type Method + * @memberOf Element + * @param {String} namespaceURI + * @param {String} localName + + * @returns {Boolean} + + + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Element.prototype.hasAttributeNS=function(namespaceURI, localName){}; +/** + * Object Text() + * Text inherits all of the methods and properties from CharacterData. + * @super CharacterData + * @type constructor + + * @memberOf Text + * @see CharacterData + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +function Text(){}; +Text.prototype = new CharacterData(){}; + /** + * function splitText(offset) + * @type Method + * @memberOf Text + * @param {Number} offset + + + * @returns {Text} + * @throws DOMException + * @see Text + + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Text.prototype.splitText=function(offset){}; +/** + * Object Comment() + * Comment inherits all of the methods and properties from CharacterData. + * @super CharacterData + * @type constructor + + * @memberOf Comment + * @see CharacterData + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +function Comment(){}; +Comment.prototype = new CharacterData(){}; +/** + * Object CDATASection() + * Comment inherits all of the methods and properties from Text. + * @super Text + * @type constructor + + * @memberOf CDATASection + * @see Text + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +function CDATASection(){}; +CDATASection.prototype = new Text(); +/** + * Object DocumentType() + * DocumentType inherits all of the methods and properties from Node. + * @super Node + * @type constructor + + * @memberOf DocumenType + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +function DocumentType(){}; +DocumentType.prototype = new Node(); +/** + * read-only Property name + * @type String + * @memberOf DocumentType + * @see DocumentType(); + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DocumentType.prototype.name=new String(); +/** + * read-only Property entities + * @type NamedNodeMap + * @memberOf DocumentType + * @see DocumentType(); + * @see NamedNodeMap + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DocumentType.prototype.entities = new NamedNodeMap(); +/** + * Read-Only Property notations + * @type NamedNodeMap + * @memberOf DocumentType + * @see DocumentType(); + * @see NamedNodeMap + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DocumentType.prototype.notations=new NamedNodeMap(); +/** + * Read-Only Property publicId + * @type String + * @memberOf DocumentType + * @see DocumentType(); + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DocumentType.prototype.publicId=new String(); +/** + * Read-Only Property systemId + * @type String + * @memberOf DocumentType + * @see DocumentType(); + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DocumentType.prototype.systemId=new String(); +/** + * Read-Only Property internalSubset + * @type String + * @memberOf DocumentType + * @see DocumentType(); + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +DocumentType.prototype.internalSubset=new String(); +/** + * Object Notation() + * Notation inherits all of the methods and properties from Node. + * @super Node + * @type constructor + + * @memberOf Notation + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +function Notation(){}; +Notation.prototype=new Node(); +/** + * Read-Only Property publicId + * @type String + * @memberOf Notation + * @see Notation(); + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Notation.prototype.publicId=new String(); +/** + * Read-Only Property systemId + * @type String + * @memberOf Notation + * @see Notation(); + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Notation.prototype.systemId=new String(); +/** + * Object Entity() + * Entity inherits all of the methods and properties from Node. + * @super Node + * @type constructor + + * @memberOf Entity + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +function Entity(){}; +Entity.prototype=new Node(); +/** + * Read-Only Property publicId + * @type String + * @memberOf Entity + * @see Entity(); + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Entity.prototype.publicId=new String(); + /** + * Read-Only Property systemId + * @type String + * @memberOf Entity + * @see Entity(); + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Entity.prototype.systemId=new String(); + /** + * Read-Only Property notationName + * @type String + * @memberOf Entity + * @see Entity(); + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +Entity.prototype.notationName=new String(); +/** + * Object EntityReference() + * EntityReference inherits all of the methods and properties from Node. + * @super Node + * @type constructor + + * @memberOf EntityReference + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +function EntityReference(){}; +EntityReference.prototype=new Node(); + /** + * Object ProcessingInstruction() + * ProcessingInstruction inherits all of the methods and properties from Node. + * @super Node + * @type constructor + + * @memberOf ProcessingInstruction + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ + +function ProcessingInstruction(){}; +ProcessingInstruction.prototype=new Node(); + /** + * Read-Only Property target + * @type String + * @memberOf ProcessingInstruction + * @see ProcessingInstruction(); + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +ProcessingInstruction.prototype.target=new String(); + /** + * Read-Only Property target + * @type String + * @memberOf ProcessingInstruction + * @throws DOMException on setting. + * @see ProcessingInstruction(); + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ +ProcessingInstruction.prototype.data=new String(); + + + + diff --git a/org.eclipse.wst.jsdt.core/libraries/baseBrowserLibrary.js b/org.eclipse.wst.jsdt.core/libraries/baseBrowserLibrary.js new file mode 100644 index 0000000..aad16dc --- /dev/null +++ b/org.eclipse.wst.jsdt.core/libraries/baseBrowserLibrary.js @@ -0,0 +1,5393 @@ +/******************************************************************************* + * Copyright (c) 2008, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +/** + * Object DOMException() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Object + */ +function DOMException(){}; +DOMException.prototype = new Object(); +/** + * Constant DOMException.INDEX_SIZE_ERR=1 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.INDEX_SIZE_ERR=1; +/** + * Constant DOMException.DOMSTRING_SIZE_ERR=2 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.DOMSTRING_SIZE_ERR=2; +/** + * Constant DOMException.HIERARCHY_REQUEST_ERR=3 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.HIERARCHY_REQUEST_ERR=3; +/** + * Constant DOMException.WRONG_DOCUMENT_ERR=4 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.WRONG_DOCUMENT_ERR=4; +/** + * Constant DOMException.INVALID_CHARACTER_ERR=5 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.INVALID_CHARACTER_ERR=5; +/** + * Constant DOMException.NO_DATA_ALLOWED_ER=6 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.NO_DATA_ALLOWED_ER=6; +/** + * Constant DOMException.NO_MODIFICATION_ALLOWED_ERR=7 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.NO_MODIFICATION_ALLOWED_ERR=7; +/** + * Constant DOMException.NOT_FOUND_ERR=8 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.NOT_FOUND_ERR=8; +/** + * Constant DOMException.NOT_SUPPORTED_ERR=9 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.NOT_SUPPORTED_ERR=9; +/** + * Constant DOMException.INUSE_ATTRIBUTE_ERR=10 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.INUSE_ATTRIBUTE_ERR=10; +/** + * Constant DOMException.INVALID_STATE_ERR=11 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.INVALID_STATE_ERR=11; +/** + * Constant DOMException.SYNTAX_ERR=12 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.SYNTAX_ERR=12; +/** + * Constant DOMException.INVALID_MODIFICATION_ER=13 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.INVALID_MODIFICATION_ER=13; +/** + * Constant DOMException.NAMESPACE_ERR=14 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.NAMESPACE_ERR=14; +/** + * Constant DOMException.NVALID_ACCESS_ERR=15 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.INVALID_ACCESS_ERR=15; +/** + * Property code + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.prototype.code=0; + +/** + * Object DOMImplementation() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Object + */ +function DOMImplementation(){}; +DOMImplementation.prototype = new Object(); +/** + * function hasFeature(feature, version) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} feature + * @param {String} version + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMImplementation.prototype.hasFeature = function(feature, version){return false;}; +/** + * function createDocumentType(qualifiedName, publicId, systemId) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} qualifiedName + * @param {String} publicId + * @param {String} systemId + * @returns {DocumentType} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see DocumentType + */ +DOMImplementation.prototype.createDocumentType = function(qualifiedName, publicId, systemId){return new DocumentType();}; +/** + * function createDocument(namespaceURI, qualifiedName, doctype) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} qualifiedName + * @param {DocumentType} doctype + * @returns {Document} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Document + */ +DOMImplementation.prototype.createDocument = function(namespaceURI, qualifiedName, doctype){return new HTMLDocument();}; + +/** + * Object DocumentFragment() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function DocumentFragment(){}; +DocumentFragment.prototype=new Node(); + +/** + * Object Document() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function Document(){}; +Document.prototype = new Node(); +/** + * Property defaultView + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Window + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Window + */ +Document.prototype.defaultView = new Window(); +/** + * Property doctype + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type DocumentType + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see DocumentType + */ +Document.prototype.doctype = new DocumentType(); +/** + * Property implementation + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type DOMImplementation + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see DOMImplementation + */ +Document.prototype.implementation = new DOMImplementation(); +/** + * Property documentElement + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Element + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Element + */ +Document.prototype.documentElement= new HTMLElement(); +/** + * Property styleSheets + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Document.prototype.styleSheets= new Array(); +/** + * function createElement(tagName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} tagName + * @returns {Element} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Element + */ +Document.prototype.createElement=function(tagName){return new HTMLElement();}; +/** + * function createDocumentFragment() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @returns {DocumentFragment} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see DocumentFragment + */ +Document.prototype.createDocumentFragment=function(){return new DocumentFragment();}; +/** + * function createTextNode(data) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} data + * @returns {Text} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Text + */ +Document.prototype.createTextNode=function(data){return new Text();}; +/** + * function createComment(data) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} data + * @returns {Comment} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Comment + */ +Document.prototype.createComment=function(data){return new Comment();}; +/** + * function createCDATASection(data) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} data + * @returns {CDATASection} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see CDATASection + */ +Document.prototype.createCDATASection=function(data){}; +/** + * function createProcessingInstruction(target, data) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type ProcessingInstruction + * @param {String} target + * @param {String} data + * @returns {ProcessingInstruction} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see ProcessingInstruction +*/ +Document.prototype.createProcessingInstruction=function(target, data){return new ProcessingInstruction();}; +/** + * function createAttribute(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {Attr} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Attr + */ +Document.prototype.createAttribute=function(name){return new Attr();}; +/** + * function createEntityReference(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {EntityReference} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see EntityReference + */ +Document.prototype.createEntityReference=function(name){return new EntityReference();}; +/** + * function getElementsByTagName(tagname) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} tagname + * @returns {NodeList} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see NodeList + */ +Document.prototype.getElementsByTagName=function(tagname){return new NodeList();}; +/** + * function importNode(importedNode, deep) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} importedNode + * @param {Boolean} deep + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Document.prototype.importNode=function(importedNode, deep){return new Node();}; +/** + * function createElementNS(namespaceURI, qualifiedName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} qualifiedName + * @returns {Element} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Element + */ +Document.prototype.createElementNS=function(namespaceURI, qualifiedName){return new HTMLElement();}; +/** + * function createEvent(String eventType) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} eventType + * @returns {Object} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Element + */ +Document.prototype.createEvent=function(eventType){return new Object();}; +/** + * function createAttributeNS(namespaceURI, qualifiedName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} qualifiedName + * @returns {Attr} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Attr + */ +Document.prototype.createAttributeNS=function(namespaceURI, qualifiedName){return new Attr();}; +/** + * function getElementsByTagNameNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {NodeList} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see NodeList + */ +Document.prototype.getElementsByTagNameNS=function(namespaceURI, localName){return new NodeList();}; +/** + * function getElementById(elementId) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} elementId + * @returns {Element} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Element + */ +Document.prototype.getElementById=function(elementId){return new HTMLElement();}; + +/** + * Object Node() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Object + * @constructor + * @memberOf Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Object + */ +function Node(){}; +Node.prototype=new Object(); +/** + * Constant Node.ELEMENT_NODE=1 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.ELEMENT_NODE=1; +/** + * Constant Node.ATTRIBUTE_NODE=2 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.ATTRIBUTE_NODE=2; +/** + * Constant Node.TEXT_NODE=3 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.TEXT_NODE=3; +/** + * Constant Node.CDATA_SECTION_NODE=4 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.CDATA_SECTION_NODE=4; +/** + * Constant Node.ENTITY_REFERENCE_NODE=5 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.ENTITY_REFERENCE_NODE=5; +/** + * Constant Node.ENTITY_NODE=6 + * @type Number + * @memberOf Node + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html +*/ +Node.ENTITY_NODE=6; +/** + * Constant Node.PROCESSING_INSTRUCTION_NODE=7 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.PROCESSING_INSTRUCTION_NODE=7; +/** + * Constant Node.COMMENT_NODE=8 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.COMMENT_NODE=8; +/** + * Constant Node.DOCUMENT_NODE=9 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.DOCUMENT_NODE=9; +/** + * Constant Node.DOCUMENT_TYPE_NODE=10 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.DOCUMENT_TYPE_NODE=10; +/** + * Constant Node.DOCUMENT_FRAGMENT_NODE=11 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.DOCUMENT_FRAGMENT_NODE=11; +/** + * Constant Node.NOTATION_NODE=12 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.NOTATION_NODE=12; +/** + * Property nodeName + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.nodeName = ""; +/** + * Property nodeValue + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.nodeValue = ""; +/** + * Property nodeType + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.nodeType = 0; +/** + * Property parentNode + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.parentNode=new Node(); +/** + * Property childNodes + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type NodeList + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see NodeList +*/ +Node.prototype.childNodes=new NodeList(); +/** + * Property firstChild + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.firstChild=new Node(); +/** + * Property lastChild + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.lastChild=new Node(); +/** + * Property previousSibling + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.previousSibling=new Node(); +/** + * Property nextSibling + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.nextSibling=new Node(); +/** + * Property attributes + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type NamedNodeMap + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see NamedNodeMap + */ +Node.prototype.attributes=new NamedNodeMap(); +/** + * Property ownerDocument + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Document + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Document + */ +Node.prototype.ownerDocument = new HTMLDocument(); +/** + * Property namespaceURI + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.namespaceURI=""; +/** + * Property prefix + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.prefix = ""; +/** + * Property localName + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.localName= ""; +/** + * function insertBefore(newChild, refChild) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} newChild + * @param {Node} refChild + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.insertBefore = function(newChild, refChild){return new Node();}; +/** + * function replaceChild(newChild, oldChild) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} newChild + * @param {Node} oldChild + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.replaceChild = function(newChild, oldChild){return new Node();}; +/** + * function removeChild(oldChild) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} oldChild + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.removeChild = function(oldChild){return new Node();}; +/** + * function appendChild(newChild) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} newChild + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.appendChild = function(newChild){return new Node();}; +/** + * function hasChildNodes() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.hasChildNodes=function(){return false;}; +/** + * function cloneNode(deep) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Boolean} deep + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.cloneNode=function(deep){return new Node();}; +/** + * function normalize() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.normalize = function(){}; +/** + * function isSupported(feature, version) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} feature + * @param {String} version + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.isSupported=function(feature, version){return false;}; +/** + * function hasAttributes() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.hasAttributes=function(){return false;}; + +/** + * Object NodeList() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Object + */ +function NodeList(){}; +NodeList.prototype = new Object(); +/** + * Property length + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +NodeList.prototype.length=0; +/** + * function item(index) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * Note: This object can also be dereferenced using square bracket notation (e.g. obj[1]). Dereferencing with an integer index is equivalent to invoking the item method with that index + * + * @param {Number} index + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node +*/ +NodeList.prototype.item = function(index){return new Node();}; + +/** + * Object NamedNodeMap() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Object + */ +function NamedNodeMap(){}; +NamedNodeMap.prototype = new Object(); +/** + * Property length + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +NamedNodeMap.prototype.length=0; +/** + * function getNamedItem(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.getNamedItem=function(name){return new Node();}; +/** + * function setNamedItem(arg) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} arg + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.setNamedItem=function(arg){return new Node();}; +/** + * function removeNamedItem(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.removeNamedItem=function(name){return new Node();}; +/** + * function item(index) + * Note: This object can also be dereferenced using square bracket notation (e.g. obj[1]). Dereferencing with an integer index is equivalent to invoking the item method with that index. + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Number} index + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.item=function(index){return new Node();}; +/** + * function getNamedItemNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.getNamedItemNS=function(namespaceURI, localName){return new Node();}; +/** + * function setNamedItemNS(arg) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} arg + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.setNamedItemNS=function(arg){return new Node();}; +/** + * function removeNamedItemNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.removeNamedItemNS=function(namespaceURI, localName){return new Node();}; + +/** + * Object CharacterData() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function CharacterData(){}; +CharacterData.prototype=new Node(); +/** + * Property data + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.data=""; +/** + * Property length + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.length=0; +/** + * function substringData(offset, count) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Number} offset + * @param {Number} count + * @returns {String} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.substringData=function(offset, count){return "";}; +/** + * function appendData(arg) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} arg + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.appendData=function(arg){}; +/** + * function insertData(offset, arg) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Number} offset + * @param {String} arg + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.insertData=function(offset, arg){}; +/** + * function deleteData(offset, count) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Number} offset + * @param {Number} count + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.deleteData=function(offset, count){}; +/** + * function replaceData(offset, count, arg) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Number} offset + * @param {Number} count + * @param {String} arg + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.replaceData=function(offset, count, arg){}; + +/** + * Object Attr() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function Attr(){}; +Attr.prototype = new Node(); +/** + * Property name + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Attr.prototype.name = ""; +/** + * Property specified + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Attr.prototype.specified = false; +/** + * Property value + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Attr.prototype.value = ""; +/** + * Property ownerElement + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Element + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Element + */ +Attr.prototype.ownerElement = new Element(); + +/** + * Object Element() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function Element(){}; +Element.prototype=new Node(); +/** + * Property tagName + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.tagName=""; +/** + * function addEventListener(Stirng type, Function listener, Boolean useCapture) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} type + * @param {Function} listener + * @param {Boolean} useCapture + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.addEventListener=function(type, listener, useCapture){}; +/** + * function attachEvent(String type, Function listener) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} type + * @param {Function} listener + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.attachEvent=function(type, listener){}; +/** + * function detachEvent(String type, Function listener) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} type + * @param {Function} listener + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.detachEvent=function(type, listener){}; +/** + * function dispatchEvent(Object event) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Object} event + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.dispatchEvent=function(event){return false;}; +/** + * function getAttribute(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.getAttribute=function(name){return "";}; +/** + * function setAttribute(name, value) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @param {String} value + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.setAttribute=function(name, value){}; +/** + * function removeAttribute(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.removeAttribute=function(name){}; +/** + * function getAttributeNode(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {Attr} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.getAttributeNode=function(name){return new Attr();}; +/** + * function setAttributeNode(newAttr) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Attr} newAttr + * @returns {Attr} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.setAttributeNode=function(newAttr){return new Attr();}; +/** + * function removeAttributeNode(oldAttr) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Attr} oldAttr + * @returns {Attr} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.removeAttributeNode=function(oldAttr){return new Attr();}; +/** + * function getElementsByTagName(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {NodeList} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.getElementsByTagName=function(name){return new NodeList();}; +/** + * function getAttributeNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {String} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.getAttributeNS=function(namespaceURI, localName){return "";}; +/** + * function setAttributeNS(namespaceURI, qualifiedName, value) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} qualifiedName + * @param {String} value + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.setAttributeNS=function(namespaceURI, qualifiedName, value){}; +/** + * function removeAttributeNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.removeAttributeNS=function(namespaceURI, localName){}; +/** + * function getAttributeNodeNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {Attr} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.getAttributeNodeNS=function(namespaceURI, localName){return new Attr();}; +/** + * function setAttributeNodeNS(newAttr) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Attr} newAttr + * @returns {Attr} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.setAttributeNodeNS=function(newAttr){return new Attr();}; +/** + * function getElementsByTagNameNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {NodeList} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.getElementsByTagNameNS=function(namespaceURI, localName){return new NodeList();}; +/** + * function hasAttribute(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.hasAttribute=function(name){return false;}; +/** + * function hasAttributeNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.hasAttributeNS=function(namespaceURI, localName){return false;}; + +/** + * Object Text() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments CharacterData + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see CharacterData + */ +function Text(){}; +Text.prototype = new CharacterData(); +/** + * function splitText(offset) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Number} offset + * @returns {Text} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Text + */ +Text.prototype.splitText = function(offset) {return new Text();}; + +/** + * Object Comment() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments CharacterData + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see CharacterData + */ +function Comment(){}; +Comment.prototype = new CharacterData(); + +/** + * Object CDATASection() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Text + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Text + */ +function CDATASection(){}; +CDATASection.prototype = new Text(); + +/** + * Object DocumentType() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function DocumentType(){}; +DocumentType.prototype = new Node(); +/** + * Property name + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DocumentType.prototype.name=""; +/** + * Property entities + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type NamedNodeMap + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DocumentType.prototype.entities = new NamedNodeMap(); +/** + * Property notations + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type NamedNodeMap + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DocumentType.prototype.notations=new NamedNodeMap(); +/** + * Property publicId + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DocumentType.prototype.publicId=""; +/** + * Property systemId + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DocumentType.prototype.systemId=""; +/** + * Property internalSubset + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DocumentType.prototype.internalSubset=""; + +/** + * Object Notation() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function Notation(){}; +Notation.prototype=new Node(); +/** + * Property publicId + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Notation.prototype.publicId=""; +/** + * Property systemId + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Notation.prototype.systemId=""; + +/** + * Object Entity() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function Entity(){}; +Entity.prototype=new Node(); +/** + * Property publicId + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Entity.prototype.publicId=""; +/** + * Property systemId + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Entity.prototype.systemId=""; +/** + * Property notationName + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Entity.prototype.notationName=""; + +/** + * Object EntityReference() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function EntityReference(){}; +EntityReference.prototype=new Node(); + +/** + * Object ProcessingInstruction() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function ProcessingInstruction(){}; +ProcessingInstruction.prototype=new Node(); +/** + * Property target + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +ProcessingInstruction.prototype.target=""; +/** + * Property target + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +ProcessingInstruction.prototype.data=""; + + +/*HTML DOM Below this line*/ + +/** + * Object HTMLCollection() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +function HTMLCollection(){}; +HTMLCollection.prototype = new Object(); +/** + * Property length + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLCollection.prototype.length=0; +/** + * function item(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLCollection.prototype.item = function(index){return new Node();}; +/** + * function namedItem(name) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {String} name + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLCollection.prototype.namedItem = function(index){return new Node();}; + +/** + * Object HTMLOptionsCollection() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +function HTMLOptionsCollection(){}; +HTMLOptionsCollection.prototype = new Object(); +/** + * Property length + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionsCollection.prototype.length=0; +/** + * function item(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionsCollection.prototype.item = function(index){return new Node();}; +/** + * function namedItem(name) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {String} name + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionsCollection.prototype.namedItem = function(index){return new Node();}; + +/** + * Object HTMLDocument() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments Document + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see Document + */ +function HTMLDocument(){}; +HTMLDocument.prototype = new Document(); +/** + * Property title + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.title=""; +/** + * Property referrer + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.referrer=""; +/** + * Property domain + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.domain=""; +/** + * Property URL + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.URL=""; +/** + * Property body + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.body=new HTMLElement(); +/** + * Property images + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.images=new HTMLCollection(); +/** + * Property applets + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.applets=new HTMLCollection(); +/** + * Property links + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.links=new HTMLCollection(); +/** + * Property forms + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.forms=new HTMLCollection(); +/** + * Property anchors + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.anchors=new HTMLCollection(); +/** + * Property cookie + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.cookie=""; +/** + * Property lastModified + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.lastModified=""; +/** + * function open() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.open = function(){}; +/** + * function close() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.close = function(){}; +/** + * function write(text) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {String} text + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.write = function(text){}; +/** + * function writeln(text) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {String} text + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.writeln = function(text){}; +/** + * function getElementsByName(elementName) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {String} elementName + * @returns {NodeList} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.getElementsByName = function(elementName){return new NodeList();}; + +/** + * Object HTMLElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments Element + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see Element + */ +function HTMLElement(){}; +HTMLElement.prototype = new Element(); +/** + * Property id + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLElement.prototype.id=""; +/** + * Property title + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLElement.prototype.title=""; +/** + * Property lang + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLElement.prototype.lang=""; +/** + * Property dir + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLElement.prototype.dir=""; +/** + * Property className + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLElement.prototype.className=""; +/** + * Property innerHTML + * + * @type String + */ +HTMLElement.prototype.innerHTML=""; +/** + * Property offsetHeight + * + * @type Number + */ +HTMLElement.prototype.offsetHeight=0; +/** + * Property offsetWidth + * + * @type Number + */ +HTMLElement.prototype.offsetWidth=0; +/** + * Property offsetLeft + * + * @type Number + */ +HTMLElement.prototype.offsetLeft=0; +/** + * Property offsetTop + * + * @type Number + */ +HTMLElement.prototype.offsetTop=0; +/** + * Property offsetParent + * + * @type HTMLElement + */ +HTMLElement.prototype.offsetParent = new HTMLElement(); +/** + * Property scrollHeight + * + * @type Number + */ +HTMLElement.prototype.scrollHeight=0; +/** + * Property scrollWidth + * + * @type Number + */ +HTMLElement.prototype.scrollWidth=0; +/** + * Property scrollLeft + * + * @type Number + */ +HTMLElement.prototype.scrollLeft=0; +/** + * Property scrollTop + * + * @type Number + */ +HTMLElement.prototype.scrollTop=0; +/** + * Property style + * + * @type CSS2Properties + */ +HTMLElement.prototype.style = new CSS2Properties(); + +/** + * Object HTMLHtmlElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLHtmlElement(){}; +HTMLHtmlElement.prototype = new HTMLElement(); +/** + * Property version + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHtmlElement.prototype.version=""; + +/** + * Object HTMLHeadElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLHeadElement(){}; +HTMLHeadElement.prototype = new HTMLElement(); +/** + * Property profile + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHeadElement.prototype.profile=""; + +/** + * Object HTMLLinkElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLLinkElement(){}; +HTMLLinkElement.prototype = new HTMLElement(); +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.disabled=false; +/** + * Property charset + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.charset=""; +/** + * Property href + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.href=""; +/** + * Property hreflang + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.hreflang=""; +/** + * Property media + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.media=""; +/** + * Property rel + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.rel=""; +/** + * Property rev + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.rev=""; +/** + * Property target + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.target=""; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.type=""; + +/** + * Object HTMLTitleElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTitleElement(){}; +HTMLTitleElement.prototype = new HTMLElement(); +/** + * Property text + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTitleElement.prototype.text=""; + +/** + * Object HTMLMetaElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLMetaElement(){}; +HTMLMetaElement.prototype = new HTMLElement(); +/** + * Property content + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMetaElement.prototype.content=""; +/** + * Property httpEquiv + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMetaElement.prototype.httpEquiv=""; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMetaElement.prototype.name=""; +/** + * Property scheme + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMetaElement.prototype.scheme=""; + +/** + * Object HTMLBaseElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLBaseElement(){}; +HTMLBaseElement.prototype = new HTMLElement(); +/** + * Property href + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBaseElement.prototype.href=""; +/** + * Property target + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBaseElement.prototype.target=""; + +/** + * Object HTMLIsIndexElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLIsIndexElement(){}; +HTMLIsIndexElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIsIndexElement.prototype.form=new HTMLFormElement(); +/** + * Property prompt + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIsIndexElement.prototype.prompt=""; + +/** + * Object HTMLStyleElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLStyleElement(){}; +HTMLStyleElement.prototype = new HTMLElement(); +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLStyleElement.prototype.disabled=false; +/** + * Property media + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLStyleElement.prototype.media=""; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLStyleElement.prototype.type=""; + +/** + * Object HTMLBodyElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLBodyElement(){}; +HTMLBodyElement.prototype = new HTMLElement(); +/** + * Property aLink + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBodyElement.prototype.aLink=""; +/** + * Property background + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBodyElement.prototype.background=""; +/** + * Property bgColor + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBodyElement.prototype.bgColor=""; +/** + * Property link + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBodyElement.prototype.link=""; +/** + * Property text + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBodyElement.prototype.text=""; +/** + * Property vLink + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBodyElement.prototype.vLink=""; + +/** + * Object HTMLFormElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLFormElement(){}; +HTMLFormElement.prototype = new HTMLElement(); +/** + * Property elements + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.elements=new HTMLCollection(); +/** + * Property length + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.length=0; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.name=""; +/** + * Property acceptCharset + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.acceptCharset=""; +/** + * Property action + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.action=""; +/** + * Property enctype + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.enctype=""; +/** + * Property method + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.method=""; +/** + * Property target + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.target=""; +/** + * function submit() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.submit = function(){}; +/** + * function reset() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.reset = function(){}; + +/** + * Object HTMLSelectElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLSelectElement(){}; +HTMLSelectElement.prototype = new HTMLElement(); +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.type=""; +/** + * Property selectedIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.selectedIndex=0; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.value=""; +/** + * Property length + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.length=0; +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.form = new HTMLFormElement(); +/** + * Property options + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLOptionsCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.options= new HTMLOptionsCollection(); +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.disabled=false; +/** + * Property multiple + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.multiple=false; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.name=""; +/** + * Property size + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.size=0; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.tabIndex=0; +/** + * function add(element, before) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {HTMLElement} element + * @param {HTMLElement} before + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.add = function(element, before){}; +/** + * function remove(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.remove = function(index){}; +/** + * function blur() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.blur = function(){}; +/** + * function focus() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.focus = function(){}; + +/** + * Object HTMLOptGroupElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLOptGroupElement(){}; +HTMLOptGroupElement.prototype = new HTMLElement(); +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptGroupElement.prototype.disabled=false; +/** + * Property label + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptGroupElement.prototype.label=""; + +/** + * Object Option() + * @constructor + * @param {String} text + * @param {String} value + * @param {Boolean} defaultSelected + * @param {Boolean} selected + */ +function Option(text, value, defaultSelected, selected){}; +Option.prototype = new HTMLOptionElement(); +/** + * Object HTMLOptionElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLOptionElement(){}; +HTMLOptionElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.form = new HTMLFormElement(); +/** + * Property defaultSelected + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.defaultSelected=false; +/** + * Property text + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.text=""; +/** + * Property index + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.index=0; +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.disabled=false; +/** + * Property label + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.label=""; +/** + * Property selected + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.selected=false; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.value=""; + +/** + * Object HTMLInputElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLInputElement(){}; +HTMLInputElement.prototype = new HTMLElement(); +/** + * Property defaultValue + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.defaultValue=""; +/** + * Property defaultChecked + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.defaultChecked=false; +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.form = new HTMLFormElement(); +/** + * Property accept + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.accept=""; +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.accessKey=""; +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.align=""; +/** + * Property alt + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.alt=""; +/** + * Property checked + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.checked=false; +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.disabled=false; +/** + * Property masLength + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.maxLenght=0; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.name=""; +/** + * Property readOnly + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.readOnly=false; +/** + * Property size + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.size=0; +/** + * Property src + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.src=""; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.tabIndex=0; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.type=""; +/** + * Property useMap + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.useMap=""; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.value=""; +/** + * function blur() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.blur = function(){}; +/** + * function focus() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.focus = function(){}; +/** + * function select() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.select = function(){}; +/** + * function click() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.click = function(){}; + +/** + * Object HTMLTextAreaElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTextAreaElement(){}; +HTMLTextAreaElement.prototype = new HTMLElement(); +/** + * Property defaultValue + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.defaultValue=""; +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.form= new HTMLFormElement(); +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.accessKey=""; +/** + * Property cols + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.cols=0; +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.disabled=false; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.name=""; +/** + * Property readOnly + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.readOnly=false; +/** + * Property rows + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.rows=0; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.tabIndex=0; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.type=""; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.value=""; +/** + * function blur() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.blur = function(){}; +/** + * function focus() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.focus = function(){}; +/** + * function select() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.select = function(){}; + +/** + * Object HTMLButtonElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLButtonElement(){}; +HTMLButtonElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.form = new HTMLFormElement(); +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.accessKey = ""; +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.disabled=false; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.name=""; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.tabIndex=0; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.type=""; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.value=""; + +/** + * Object HTMLLabelElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLLabelElement(){}; +HTMLLabelElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLabelElement.prototype.form = new HTMLFormElement(); +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLabelElement.prototype.accessKey=""; +/** + * Property htmlFor + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLabelElement.prototype.htmlFor=""; + +/** + * Object HTMLFieldSetElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLFieldSetElement(){}; +HTMLFieldSetElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFieldSetElement.prototype.form = new HTMLFormElement(); + +/** + * Object HTMLLegendElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLLegendElement(){}; +HTMLLegendElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLegendElement.prototype.form = new HTMLFormElement(); +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLegendElement.prototype.accessKey=""; +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLegendElement.prototype.align=""; + +/** + * Object HTMLUListElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLUListElement(){}; +HTMLUListElement.prototype = new HTMLElement(); +/** + * Property compact + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLUListElement.prototype.compact=false; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLUListElement.prototype.type=""; + +/** + * Object HTMLOListElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLOListElement(){}; +HTMLOListElement.prototype = new HTMLElement(); +/** + * Property compact + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOListElement.prototype.compact=false; +/** + * Property start + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOListElement.prototype.start=0; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOListElement.prototype.type=""; + +/** + * Object HTMLDListElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLDListElement(){}; +HTMLDListElement.prototype = new HTMLElement(); +/** + * Property compact + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDListElement.prototype.compact=false; + +/** + * Object HTMLDirectoryElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLDirectoryElement(){}; +HTMLDirectoryElement.prototype = new HTMLElement(); +/** + * Property compact + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDirectoryElement.prototype.compact=false; + +/** + * Object HTMLMenuElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLMenuElement(){}; +HTMLMenuElement.prototype = new HTMLElement(); +/** + * Property compact + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMenuElement.prototype.compact=false; + +/** + * Object HTMLLIElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLLIElement(){}; +HTMLLIElement.prototype = new HTMLElement(); +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLIElement.prototype.type=""; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLIElement.prototype.value=0; + +/** + * Object HTMLDivElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLDivElement(){}; +HTMLDivElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDivElement.prototype.align=""; + +/** + * Object HTMLParagraphElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLParagraphElement(){}; +HTMLParagraphElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLParagraphElement.prototype.align=""; + +/** + * Object HTMLHeadingElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLHeadingElement(){}; +HTMLHeadingElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHeadingElement.prototype.align=""; + +/** + * Object HTMLQuoteElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLQuoteElement(){}; +HTMLQuoteElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLQuoteElement.prototype.align=""; + +/** + * Object HTMLPreElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLPreElement(){}; +HTMLPreElement.prototype = new HTMLElement(); +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLPreElement.prototype.width=0; + +/** + * Object HTMLBRElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLBRElement(){}; +HTMLBRElement.prototype = new HTMLElement(); +/** + * Property clear + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBRElement.prototype.clear=""; + +/** + * Object HTMLBaseFontElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLBaseFontElement(){}; +HTMLBaseFontElement.prototype = new HTMLElement(); +/** + * Property color + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBaseFontElement.prototype.color=""; +/** + * Property face + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBaseFontElement.prototype.face=""; +/** + * Property size + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBaseFontElement.prototype.size=0; + +/** + * Object HTMLBaseFontElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLFontElement(){}; +HTMLFontElement.prototype = new HTMLElement(); +/** + * Property color + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFontElement.prototype.color=""; +/** + * Property face + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFontElement.prototype.face=""; +/** + * Property size + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFontElement.prototype.size=0; + +/** + * Object HTMLHRElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLHRElement(){}; +HTMLHRElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHRElement.prototype.align=""; +/** + * Property noShade + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHRElement.prototype.noShade=false; +/** + * Property size + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHRElement.prototype.size=""; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHRElement.prototype.width=""; + +/** + * Object HTMLModElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLModElement(){}; +HTMLModElement.prototype = new HTMLElement(); +/** + * Property cite + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLModElement.prototype.cite=""; +/** + * Property dateTime + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLModElement.prototype.dateTime=""; + +/** + * Object HTMLAnchorElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLAnchorElement(){}; +HTMLAnchorElement.prototype = new HTMLElement(); +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.accessKey=""; +/** + * Property charset + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.charset=""; +/** + * Property coords + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.coords=""; +/** + * Property href + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.href=""; +/** + * Property hreflang + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.hreflang=""; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.name=""; +/** + * Property rel + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.rel=""; +/** + * Property rev + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.rev=""; +/** + * Property shape + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.shape=""; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.tabIndex=0; +/** + * Property target + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.target=""; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.type=""; +/** + * function blur() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.blur = function(){}; +/** + * function focus() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.focus = function(){}; + +/** + * Object Image() + * @constructor + * @param {Number} width + * @param {Number} height + */ +function Image(width, height){}; +Image.prototype = new HTMLImageElement(); +/** + * Object HTMLImageElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLImageElement(){}; +HTMLImageElement.prototype = new HTMLElement(); +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.name=""; +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.align=""; +/** + * Property alt + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.alt=""; +/** + * Property border + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.border=""; +/** + * Property height + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.height=0; +/** + * Property hspace + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.hspace=0; +/** + * Property isMap + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.isMap=false; +/** + * Property longDesc + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.longDesc=""; +/** + * Property src + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.src=""; +/** + * Property useMap + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.useMap=""; +/** + * Property vspace + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.vspace=0; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.width=0; + +/** + * Object HTMLObjectElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLObjectElement(){}; +HTMLObjectElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.form = new HTMLFormElement(); +/** + * Property code + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.code=""; +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.align=""; +/** + * Property archive + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.archive=""; +/** + * Property border + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.border=""; +/** + * Property codeBase + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.codeBase=""; +/** + * Property codeType + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.codeType=""; +/** + * Property data + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.data=""; +/** + * Property declare + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.declare=false; +/** + * Property height + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.height=""; +/** + * Property hspace + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.hspace=0; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.name=""; +/** + * Property standby + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.standby=""; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.tabIndex=0; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.type=""; +/** + * Property useMap + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.useMap=""; +/** + * Property vspace + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.vspace=0; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.width=""; +/** + * Property contentDocument + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Document + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.contentDocument= new HTMLDocument(); + +/** + * Object HTMLParamElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLParamElement(){}; +HTMLParamElement.prototype = new HTMLElement(); +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLParamElement.prototype.name=""; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLParamElement.prototype.type=""; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLParamElement.prototype.value=""; +/** + * Property valueType + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLParamElement.prototype.valueType=""; + +/** + * Object HTMLAppletElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLAppletElement(){}; +HTMLAppletElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.align=""; +/** + * Property alt + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.alt=""; +/** + * Property archive + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.archive=""; +/** + * Property code + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.code=""; +/** + * Property codeBase + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.codeBase=""; +/** + * Property height + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.hight=""; +/** + * Property hspace + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.hspace=0; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.name=""; +/** + * Property object + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.object=""; +/** + * Property vspace + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.vspace=0; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.width=""; + +/** + * Object HTMLMapElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLMapElement(){}; +HTMLMapElement.prototype = new HTMLElement(); +/** + * Property areas + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMapElement.prototype.areas = new HTMLCollection(); +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMapElement.prototype.name=""; + +/** + * Object HTMLAreaElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLAreaElement(){}; +HTMLAreaElement.prototype = new HTMLElement(); +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.accessKey=""; +/** + * Property alt + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.alt=""; +/** + * Property coords + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.coords=""; +/** + * Property href + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.href=""; +/** + * Property noHref + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.noHref=false; +/** + * Property shape + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.shape=""; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.tabIndex=0; +/** + * Property target + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.target=""; + +/** + * Object HTMLScriptElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLScriptElement(){}; +HTMLScriptElement.prototype = new HTMLElement(); +/** + * Property text + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.text=""; +/** + * Property htmlFor + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.htmlFor=""; +/** + * Property event + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.event=""; +/** + * Property charset + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.charset=""; +/** + * Property defer + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.defer=""; +/** + * Property src + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.src=""; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.type=""; + +/** + * Object HTMLTableElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTableElement(){}; +HTMLTableElement.prototype = new HTMLElement(); +/** + * Property caption + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLTableCaptionElement + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.caption = new HTMLTableCaptionElement(); +/** + * Property tHead + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLTableSectionElement + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.tHead = new HTMLTableSelectionElement(); +/** + * Property tFoot + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLTableSectionElement + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.tFoot = new HTMLTableSelectionElement(); +/** + * Property rows + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.rows = new HTMLCollection(); +/** + * Property tBodies + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.tBodies = new HTMLCollection(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.align=""; +/** + * Property bgColor + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.bgColor=""; +/** + * Property border + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.border=""; +/** + * Property cellPadding + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.cellPadding=""; +/** + * Property cellSpacing + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.cellSpacing=""; +/** + * Property frame + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.frame=""; +/** + * Property rules + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.rules=""; +/** + * Property summary + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.summary=""; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.width=""; +/** + * function createTHead(); + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @returns {HTMLElement} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.createTHead = function(){return new HTMLElement();}; +/** + * function deleteTHead(); + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.deleteTHead = function(){}; +/** + * function createTFoot(); + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @returns {HTMLElement} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.createTFoot = function(){return new HTMLElement();}; +/** + * function deleteTFoot(); + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.deleteTFoot = function(){}; +/** + * function createCaption(); + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @returns {HTMLElement} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.createCaption = function(){return new HTMLElement();}; +/** + * function deleteCaption(); + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.deleteCaption = function(){}; +/** + * function insertRow(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @returns {HTMLElement} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.insertRow = function(index){return new HTMLElement();}; +/** + * function deleteRow(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.deleteRow = function(index){}; + +/** + * Object HTMLTableCaptionElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTableCaptionElement(){}; +HTMLTableCaptionElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCaptionElement.prototype.align=""; + +/** + * Object HTMLTableColElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTableColElement(){}; +HTMLTableColElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableColElement.prototype.align=""; +/** + * Property ch + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableColElement.prototype.ch=""; +/** + * Property chOff + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableColElement.prototype.chOff=""; +/** + * Property span + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableColElement.prototype.span=0; +/** + * Property vAlign + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableColElement.prototype.vAlign=""; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableColElement.prototype.width=""; + +/** + * Object HTMLTableSelectionElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTableSelectionElement(){}; +HTMLTableSelectionElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.align=""; +/** + * Property ch + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.ch=""; +/** + * Property chOff + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.chOff=""; +/** + * Property vAlign + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.vAlign=""; +/** + * Property rows + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.rows=""; +/** + * function insertRow(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @returns {HTMLElement} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.insertRow = function(index){return new HTMLElement();}; +/** + * function deleteRow(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.deleteRow = function(index){}; + +/** + * Object HTMLTableRowElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTableRowElement(){}; +HTMLTableRowElement.prototype = new HTMLElement(); +/** + * Property rowIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.rowIndex=0; +/** + * Property sectionRowIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.sectionRowIndex=0; +/** + * Property cells + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.cells = new HTMLCollection(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.align=""; +/** + * Property bgColor + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.bgColor=""; +/** + * Property ch + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.ch=""; +/** + * Property chOff + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.chOff=""; +/** + * Property vAlign + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.vAlign=""; +/** + * function insertCell(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @returns {HTMLElement} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.insertCell = function(index){return new HTMLElement();}; +/** + * function insertCell(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.deleteCell = function(index){}; + +/** + * Object HTMLTableRowElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTableCellElement(){}; +HTMLTableCellElement.prototype = new HTMLElement(); +/** + * Property cellIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.cellIndex=0; +/** + * Property abbr + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.abbr=""; +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.align=""; +/** + * Property axis + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.axis=""; +/** + * Property bgColor + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.bgColor=""; +/** + * Property ch + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.ch=""; +/** + * Property chOff + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.chOff=""; +/** + * Property colSpan + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.colSpan=0; +/** + * Property headers + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.headers=""; +/** + * Property height + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.height=""; +/** + * Property noWrap + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.noWrap=false; +/** + * Property rowSpan + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.rowSpan=0; +/** + * Property scope + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.scope=""; +/** + * Property vAlign + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.vAlign=""; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.width=""; + +/** + * Object HTMLFrameSetElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLFrameSetElement(){}; +HTMLFrameSetElement.prototype = new HTMLElement(); +/** + * Property cols + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameSetElement.prototype.cols=""; +/** + * Property rows + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameSetElement.prototype.rows=""; + +/** + * Object HTMLFrameElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLFrameElement(){}; +HTMLFrameElement.prototype = new HTMLElement(); +/** + * Property frameBorder + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.frameBorder=""; +/** + * Property longDesc + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.longDesc=""; +/** + * Property marginHeight + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.marginHeight=""; +/** + * Property marginWidth + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.marginWidth=""; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.name=""; +/** + * Property noResize + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.noResize=false; +/** + * Property scrolling + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.scrolling=""; +/** + * Property src + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.src=""; +/** + * Property contentDocument + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Document + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.contentDocument= new HTMLDocument(); + +/** + * Object HTMLIFrameElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLIFrameElement(){}; +HTMLIFrameElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.align=""; +/** + * Property frameBorder + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.frameBorder=""; +/** + * Property height + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.height=""; +/** + * Property longDesc + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.longDesc=""; +/** + * Property marginHeight + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.marginHeight=""; +/** + * Property marginWidth + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.marginWidth=""; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.name=""; +/** + * Property scrolling + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.scrolling=""; +/** + * Property src + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.src=""; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.width=""; +/** + * Property contentDocument + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Document + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.contentDocument= new HTMLDocument(); + +/* Stylesheets */ +/** + * Object CSS2Properties() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/ecma-script-binding.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Style Specification. + */ +function CSS2Properties(){}; +CSS2Properties.prototype = new Object(); \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/libraries/browserWindow.js b/org.eclipse.wst.jsdt.core/libraries/browserWindow.js new file mode 100644 index 0000000..4342f17 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/libraries/browserWindow.js @@ -0,0 +1,561 @@ +/******************************************************************************* + * Copyright (c) 2008, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +function BarProp(){}; +BarProp.prototype = new Array(); + +/** + * Object Window() + * @super Global + * @constructor + * @since Common Usage, no standard +*/ +function Window(){}; +Window.prototype = new Global(); +Window.prototype.self = new Window(); +Window.prototype.window = new Window(); +Window.prototype.frames = new Array(); +/** + * Property closed + * @type Boolean + * @memberOf Window + */ +Window.prototype.closed = new Boolean(); +/** + * Property defaultStatus + * @type String + * @memberOf Window + */ +Window.prototype.defaultStatus = ""; +/** + * Property document + * @type Document + * @memberOf Window + */ +Window.prototype.document= new HTMLDocument(); +/** + * Property history + * @type History + * @memberOf Window + */ +Window.prototype.history= new History(); +/** + * Property location + * @type Location + * @memberOf Window + */ +Window.prototype.location=new Location(); +/** + * Property name + * @type String + * @memberOf Window + */ +Window.prototype.name = ""; +/** + * Property navigator + * @type Navigator + * @memberOf Window + */ +Window.prototype.navigator = new Navigator(); +/** + * Property opener + * @type Window + * @memberOf Window + */ +Window.prototype.opener = new Window(); +/** + * Property outerWidth + * @type Number + * @memberOf Window + */ +Window.prototype.outerWidth = 0; +/** + * Property outerHeight + * @type Number + * @memberOf Window + */ +Window.prototype.outerHeight = 0; +/** + * Property pageXOffset + * @type Number + * @memberOf Window + */ +Window.prototype.pageXOffset = 0; +/** + * Property pageYOffset + * @type Number + * @memberOf Window + */ +Window.prototype.pageYOffset = 0; +/** + * Property parent + * @type Window + * @memberOf Window + */ +Window.prototype.parent = new Window(); +/** + * Property screen + * @type Screen + * @memberOf Window + */ +Window.prototype.screen = new Screen(); +/** + * Property status + * @type String + * @memberOf Window + */ +Window.prototype.status = ""; +/** + * Property top + * @type Window + * @memberOf Window + */ +Window.prototype.top = new Window(); + + +/* + * These properties may need to be moved into a browswer specific library. + */ + + /** + * Property innerWidth + * @type Number + * @memberOf Window + */ +Window.prototype.innerWidth = 0; +/** + * Property innerHeight + * @type Number + * @memberOf Window + */ +Window.prototype.innerHeight = 0; +/** + * Property screenX + * @type Number + * @memberOf Window + */ +Window.prototype.screenX = 0; +/** + * Property screenY + * @type Number + * @memberOf Window + */ +Window.prototype.screenY = 0; +/** + * Property screenLeft + * @type Number + * @memberOf Window + */ +Window.prototype.screenLeft = 0; +/** + * Property screenTop + * @type Number + * @memberOf Window + */ +Window.prototype.screenTop = 0; +//Window.prototype.event = new Event(); +Window.prototype.length = 0; +Window.prototype.scrollbars= new BarProp(); +Window.prototype.scrollX=0; +Window.prototype.scrollY=0; +Window.prototype.content= new Window(); +Window.prototype.menubar= new BarProp(); +Window.prototype.toolbar= new BarProp(); +Window.prototype.locationbar= new BarProp(); +Window.prototype.personalbar= new BarProp(); +Window.prototype.statusbar= new BarProp(); +Window.prototype.directories= new BarProp(); +Window.prototype.scrollMaxX=0; +Window.prototype.scrollMaxY=0; +Window.prototype.fullScreen=""; +Window.prototype.frameElement=""; +Window.prototype.sessionStorage=""; +/* End properites */ + +/** + * function alert() + * @param {String} arg + * @memberOf Window + */ +Window.prototype.alert = function(arg){}; +/** + * function blur() + * @memberOf Window + */ +Window.prototype.blur = function(){}; +/** + * function clearInterval(arg) + * @param arg + * @memberOf Window + */ +Window.prototype.clearInterval = function(arg){}; +/** + * function clearTimeout(arg) + * @param arg + * @memberOf Window + */ +Window.prototype.clearTimeout = function(arg){}; +/** + * function close() + * @memberOf Window + */ +Window.prototype.close = function(){}; +/** + * function confirm() + * @param {String} arg + * @memberOf Window + * @returns {Boolean} + */ +Window.prototype.confirm = function(arg){return false;}; +/** + * function focus() + * @memberOf Window + */ +Window.prototype.focus = function(){}; +/** + * function getComputedStyle(arg1, arg2) + * @param {Element} arg1 + * @param {String} arg2 + * @memberOf Window + * @returns {Object} + */ +Window.prototype.getComputedStyle = function(arg1,arg2){return new Object();}; +/** + * function moveTo(arg1, arg2) + * @param {Number} arg1 + * @param {Number} arg2 + * @memberOf Window + */ +Window.prototype.moveTo = function(arg1,arg2){}; +/** + * function moveBy(arg1, arg2) + * @param {Number} arg1 + * @param {Number} arg2 + * @memberOf Window + */ +Window.prototype.moveBy = function(arg1,arg2){}; +/** + * function open(optionalArg1, optionalArg2, optionalArg3, optionalArg4) + * @param {String} optionalArg1 + * @param {String} optionalArg2 + * @param {String} optionalArg3 + * @param {Boolean} optionalArg4 + * @memberOf Window + * @returns {Window} + */ +Window.prototype.open = function(optionalArg1, optionalArg2, optionalArg3, optionalArg4){return new Window();}; +/** + * function print() + * @memberOf Window + */ +Window.prototype.print = function(){}; +/** + * function prompt(arg1, arg2) + * @param {String} arg1 + * @param {String} arg2 + * @memberOf Window + * @returns {String} + */ +Window.prototype.prompt = function(){return "";}; +/** + * function resizeTo(arg1, arg2) + * @param {Number} arg1 + * @param {Number} arg2 + * @memberOf Window + */ +Window.prototype.resizeTo=function(arg1,arg2){}; +/** + * function resizeBy(arg1, arg2) + * @param {Number} arg1 + * @param {Number} arg2 + * @memberOf Window + */ +Window.prototype.resizeBy=function(arg1,arg2){}; +/** + * function scrollTo(arg1, arg2) + * @param {Number} arg1 + * @param {Number} arg2 + * @memberOf Window + */ +Window.prototype.scrollTo=function(arg1,arg2){}; +/** + * function scrollBy(arg1, arg2) + * @param {Number} arg1 + * @param {Number} arg2 + * @memberOf Window + */ +Window.prototype.scrollBy=function(arg1,arg2){}; +/** + * function setInterval(arg1, arg2) + * @param {Object} arg1 + * @param {Number} arg2 + * @memberOf Window + * @returns {Number} + */ +Window.prototype.setInterval=function(arg1, arg2){return 0;}; +/** + * function setTimeout(arg1, arg2) + * @param {Object} arg1 + * @param {Number} arg2 + * @memberOf Window + * @returns {Number} + */ +Window.prototype.setTimeout=function(arg1, arg2){ return 0;}; +/** + * function atob(arg) + * @param {String} arg + * @memberOf Window + * @returns {String} + */ +Window.prototype.atob=function(arg){return "";}; +/** + * function btoa(arg) + * @param {String} arg + * @memberOf Window + * @returns {String} + */ +Window.prototype.btoa=function(arg){return "";}; +/** + * function setResizable(arg) + * @param {Boolean} arg + * @memberOf Window + */ +Window.prototype.setResizable=function(arg){}; + +Window.prototype.captureEvents=function(arg1){}; +Window.prototype.releaseEvents=function(arg1){}; +Window.prototype.routeEvent=function(arg1){}; +Window.prototype.enableExternalCapture=function(){}; +Window.prototype.disableExternalCapture=function(){}; +Window.prototype.find=function(){}; +Window.prototype.back=function(){}; +Window.prototype.forward=function(){}; +Window.prototype.home=function(){}; +Window.prototype.stop=function(){}; +Window.prototype.scroll=function(arg1,arg2){}; + +/* + * These functions may need to be moved into a browser specific library. + */ +Window.prototype.dispatchEvent=function(arg1){}; +Window.prototype.removeEventListener=function(arg1,arg2,arg3){}; +/* End functions */ + +/** + * Object History() + * @super Object + * @constructor + * @since Common Usage, no standard + */ +function History(){}; +History.prototype=new Object(); +History.prototype.history = new History(); +/** + * Property length + * @type Number + * @memberOf History + */ +History.prototype.length = 0; +/** + * function back() + * @memberOf History + */ +History.prototype.back = function(){}; +/** + * function forward() + * @memberOf History + */ +History.prototype.forward = function(){}; +/** + * function back() + * @param arg + * @memberOf History + */ +History.prototype.go = function(arg){}; + +/** + * Object Location() + * @super Object + * @constructor + * @since Common Usage, no standard + */ +function Location(){}; +Location.prototype = new Object(); +Location.prototype.location = new Location(); +/** + * Property hash + * @type String + * @memberOf Location + */ +Location.prototype.hash = ""; +/** + * Property host + * @type String + * @memberOf Location + */ +Location.prototype.host = ""; +/** + * Property hostname + * @type String + * @memberOf Location + */ +Location.prototype.hostname = ""; +/** + * Property href + * @type String + * @memberOf Location + */ +Location.prototype.href = ""; +/** + * Property pathname + * @type String + * @memberOf Location + */ +Location.prototype.pathname = ""; +/** + * Property port + * @type String + * @memberOf Location + */ +Location.prototype.port = ""; +/** + * Property protocol + * @type String + * @memberOf Location + */ +Location.prototype.protocol = ""; +/** + * Property search + * @type String + * @memberOf Location + */ +Location.prototype.search = ""; +/** + * function assign(arg) + * @param {String} arg + * @memberOf Location + */ +Location.prototype.assign = function(arg){}; +/** + * function reload(optionalArg) + * @param {Boolean} optionalArg + * @memberOf Location + */ +Location.prototype.reload = function(optionalArg){}; +/** + * function replace(arg) + * @param {String} arg + * @memberOf Location + */ +Location.prototype.replace = function(arg){}; + +/** + * Object Navigator() + * @super Object + * @constructor + * @since Common Usage, no standard +*/ +function Navigator(){}; +Navigator.prototype = new Object(); +Navigator.prototype.navigator = new Navigator(); +/** + * Property appCodeName + * @type String + * @memberOf Navigator + */ +Navigator.prototype.appCodeName = ""; +/** + * Property appName + * @type String + * @memberOf Navigator + */ +Navigator.prototype.appName = ""; +/** + * Property appVersion + * @type String + * @memberOf Navigator + */ +Navigator.prototype.appVersion = ""; +/** + * Property cookieEnabled + * @type Boolean + * @memberOf Navigator + */ +Navigator.prototype.cookieEnabled = new Boolean(); +/** + * Property mimeTypes + * @type Array + * @memberOf Navigator + */ +Navigator.prototype.mimeTypes = new Array(); +/** + * Property platform + * @type String + * @memberOf Navigator + */ +Navigator.prototype.platform = ""; +/** + * Property plugins + * @type Array + * @memberOf Navigator + */ +Navigator.prototype.plugins = new Array(); +/** + * Property userAgent + * @type String + * @memberOf Navigator + */ +Navigator.prototype.userAgent = ""; +/** + * function javaEnabled() + * @returns {Boolean} + * @memberOf Navigator + */ +Navigator.prototype.javaEnabled = function(){return false;}; + +/** + * Object Screen() + * @super Object + * @constructor + * @since Common Usage, no standard +*/ +function Screen(){}; +Screen.prototype = new Object(); +Screen.prototype.screen = new Screen(); +/** + * Property availHeight + * @type Number + * @memberOf Screen + */ +Navigator.prototype.availHeight = 0; +/** + * Property availWidth + * @type Number + * @memberOf Screen + */ +Navigator.prototype.availWidth = 0; +/** + * Property colorDepth + * @type Number + * @memberOf Screen + */ +Navigator.prototype.colorDepth = 0; +/** + * Property height + * @type Number + * @memberOf Screen + */ +Navigator.prototype.height = 0; +/** + * Property width + * @type Number + * @memberOf Screen + */ +Navigator.prototype.width = 0; \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/libraries/dom5.js b/org.eclipse.wst.jsdt.core/libraries/dom5.js new file mode 100644 index 0000000..aad16dc --- /dev/null +++ b/org.eclipse.wst.jsdt.core/libraries/dom5.js @@ -0,0 +1,5393 @@ +/******************************************************************************* + * Copyright (c) 2008, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +/** + * Object DOMException() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Object + */ +function DOMException(){}; +DOMException.prototype = new Object(); +/** + * Constant DOMException.INDEX_SIZE_ERR=1 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.INDEX_SIZE_ERR=1; +/** + * Constant DOMException.DOMSTRING_SIZE_ERR=2 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.DOMSTRING_SIZE_ERR=2; +/** + * Constant DOMException.HIERARCHY_REQUEST_ERR=3 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.HIERARCHY_REQUEST_ERR=3; +/** + * Constant DOMException.WRONG_DOCUMENT_ERR=4 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.WRONG_DOCUMENT_ERR=4; +/** + * Constant DOMException.INVALID_CHARACTER_ERR=5 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.INVALID_CHARACTER_ERR=5; +/** + * Constant DOMException.NO_DATA_ALLOWED_ER=6 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.NO_DATA_ALLOWED_ER=6; +/** + * Constant DOMException.NO_MODIFICATION_ALLOWED_ERR=7 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.NO_MODIFICATION_ALLOWED_ERR=7; +/** + * Constant DOMException.NOT_FOUND_ERR=8 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.NOT_FOUND_ERR=8; +/** + * Constant DOMException.NOT_SUPPORTED_ERR=9 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.NOT_SUPPORTED_ERR=9; +/** + * Constant DOMException.INUSE_ATTRIBUTE_ERR=10 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.INUSE_ATTRIBUTE_ERR=10; +/** + * Constant DOMException.INVALID_STATE_ERR=11 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.INVALID_STATE_ERR=11; +/** + * Constant DOMException.SYNTAX_ERR=12 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.SYNTAX_ERR=12; +/** + * Constant DOMException.INVALID_MODIFICATION_ER=13 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.INVALID_MODIFICATION_ER=13; +/** + * Constant DOMException.NAMESPACE_ERR=14 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.NAMESPACE_ERR=14; +/** + * Constant DOMException.NVALID_ACCESS_ERR=15 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.INVALID_ACCESS_ERR=15; +/** + * Property code + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.prototype.code=0; + +/** + * Object DOMImplementation() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Object + */ +function DOMImplementation(){}; +DOMImplementation.prototype = new Object(); +/** + * function hasFeature(feature, version) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} feature + * @param {String} version + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMImplementation.prototype.hasFeature = function(feature, version){return false;}; +/** + * function createDocumentType(qualifiedName, publicId, systemId) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} qualifiedName + * @param {String} publicId + * @param {String} systemId + * @returns {DocumentType} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see DocumentType + */ +DOMImplementation.prototype.createDocumentType = function(qualifiedName, publicId, systemId){return new DocumentType();}; +/** + * function createDocument(namespaceURI, qualifiedName, doctype) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} qualifiedName + * @param {DocumentType} doctype + * @returns {Document} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Document + */ +DOMImplementation.prototype.createDocument = function(namespaceURI, qualifiedName, doctype){return new HTMLDocument();}; + +/** + * Object DocumentFragment() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function DocumentFragment(){}; +DocumentFragment.prototype=new Node(); + +/** + * Object Document() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function Document(){}; +Document.prototype = new Node(); +/** + * Property defaultView + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Window + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Window + */ +Document.prototype.defaultView = new Window(); +/** + * Property doctype + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type DocumentType + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see DocumentType + */ +Document.prototype.doctype = new DocumentType(); +/** + * Property implementation + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type DOMImplementation + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see DOMImplementation + */ +Document.prototype.implementation = new DOMImplementation(); +/** + * Property documentElement + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Element + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Element + */ +Document.prototype.documentElement= new HTMLElement(); +/** + * Property styleSheets + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Document.prototype.styleSheets= new Array(); +/** + * function createElement(tagName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} tagName + * @returns {Element} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Element + */ +Document.prototype.createElement=function(tagName){return new HTMLElement();}; +/** + * function createDocumentFragment() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @returns {DocumentFragment} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see DocumentFragment + */ +Document.prototype.createDocumentFragment=function(){return new DocumentFragment();}; +/** + * function createTextNode(data) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} data + * @returns {Text} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Text + */ +Document.prototype.createTextNode=function(data){return new Text();}; +/** + * function createComment(data) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} data + * @returns {Comment} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Comment + */ +Document.prototype.createComment=function(data){return new Comment();}; +/** + * function createCDATASection(data) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} data + * @returns {CDATASection} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see CDATASection + */ +Document.prototype.createCDATASection=function(data){}; +/** + * function createProcessingInstruction(target, data) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type ProcessingInstruction + * @param {String} target + * @param {String} data + * @returns {ProcessingInstruction} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see ProcessingInstruction +*/ +Document.prototype.createProcessingInstruction=function(target, data){return new ProcessingInstruction();}; +/** + * function createAttribute(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {Attr} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Attr + */ +Document.prototype.createAttribute=function(name){return new Attr();}; +/** + * function createEntityReference(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {EntityReference} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see EntityReference + */ +Document.prototype.createEntityReference=function(name){return new EntityReference();}; +/** + * function getElementsByTagName(tagname) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} tagname + * @returns {NodeList} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see NodeList + */ +Document.prototype.getElementsByTagName=function(tagname){return new NodeList();}; +/** + * function importNode(importedNode, deep) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} importedNode + * @param {Boolean} deep + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Document.prototype.importNode=function(importedNode, deep){return new Node();}; +/** + * function createElementNS(namespaceURI, qualifiedName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} qualifiedName + * @returns {Element} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Element + */ +Document.prototype.createElementNS=function(namespaceURI, qualifiedName){return new HTMLElement();}; +/** + * function createEvent(String eventType) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} eventType + * @returns {Object} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Element + */ +Document.prototype.createEvent=function(eventType){return new Object();}; +/** + * function createAttributeNS(namespaceURI, qualifiedName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} qualifiedName + * @returns {Attr} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Attr + */ +Document.prototype.createAttributeNS=function(namespaceURI, qualifiedName){return new Attr();}; +/** + * function getElementsByTagNameNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {NodeList} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see NodeList + */ +Document.prototype.getElementsByTagNameNS=function(namespaceURI, localName){return new NodeList();}; +/** + * function getElementById(elementId) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} elementId + * @returns {Element} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Element + */ +Document.prototype.getElementById=function(elementId){return new HTMLElement();}; + +/** + * Object Node() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Object + * @constructor + * @memberOf Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Object + */ +function Node(){}; +Node.prototype=new Object(); +/** + * Constant Node.ELEMENT_NODE=1 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.ELEMENT_NODE=1; +/** + * Constant Node.ATTRIBUTE_NODE=2 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.ATTRIBUTE_NODE=2; +/** + * Constant Node.TEXT_NODE=3 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.TEXT_NODE=3; +/** + * Constant Node.CDATA_SECTION_NODE=4 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.CDATA_SECTION_NODE=4; +/** + * Constant Node.ENTITY_REFERENCE_NODE=5 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.ENTITY_REFERENCE_NODE=5; +/** + * Constant Node.ENTITY_NODE=6 + * @type Number + * @memberOf Node + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html +*/ +Node.ENTITY_NODE=6; +/** + * Constant Node.PROCESSING_INSTRUCTION_NODE=7 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.PROCESSING_INSTRUCTION_NODE=7; +/** + * Constant Node.COMMENT_NODE=8 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.COMMENT_NODE=8; +/** + * Constant Node.DOCUMENT_NODE=9 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.DOCUMENT_NODE=9; +/** + * Constant Node.DOCUMENT_TYPE_NODE=10 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.DOCUMENT_TYPE_NODE=10; +/** + * Constant Node.DOCUMENT_FRAGMENT_NODE=11 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.DOCUMENT_FRAGMENT_NODE=11; +/** + * Constant Node.NOTATION_NODE=12 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.NOTATION_NODE=12; +/** + * Property nodeName + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.nodeName = ""; +/** + * Property nodeValue + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.nodeValue = ""; +/** + * Property nodeType + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.nodeType = 0; +/** + * Property parentNode + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.parentNode=new Node(); +/** + * Property childNodes + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type NodeList + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see NodeList +*/ +Node.prototype.childNodes=new NodeList(); +/** + * Property firstChild + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.firstChild=new Node(); +/** + * Property lastChild + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.lastChild=new Node(); +/** + * Property previousSibling + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.previousSibling=new Node(); +/** + * Property nextSibling + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.nextSibling=new Node(); +/** + * Property attributes + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type NamedNodeMap + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see NamedNodeMap + */ +Node.prototype.attributes=new NamedNodeMap(); +/** + * Property ownerDocument + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Document + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Document + */ +Node.prototype.ownerDocument = new HTMLDocument(); +/** + * Property namespaceURI + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.namespaceURI=""; +/** + * Property prefix + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.prefix = ""; +/** + * Property localName + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.localName= ""; +/** + * function insertBefore(newChild, refChild) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} newChild + * @param {Node} refChild + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.insertBefore = function(newChild, refChild){return new Node();}; +/** + * function replaceChild(newChild, oldChild) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} newChild + * @param {Node} oldChild + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.replaceChild = function(newChild, oldChild){return new Node();}; +/** + * function removeChild(oldChild) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} oldChild + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.removeChild = function(oldChild){return new Node();}; +/** + * function appendChild(newChild) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} newChild + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.appendChild = function(newChild){return new Node();}; +/** + * function hasChildNodes() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.hasChildNodes=function(){return false;}; +/** + * function cloneNode(deep) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Boolean} deep + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.cloneNode=function(deep){return new Node();}; +/** + * function normalize() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.normalize = function(){}; +/** + * function isSupported(feature, version) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} feature + * @param {String} version + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.isSupported=function(feature, version){return false;}; +/** + * function hasAttributes() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.hasAttributes=function(){return false;}; + +/** + * Object NodeList() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Object + */ +function NodeList(){}; +NodeList.prototype = new Object(); +/** + * Property length + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +NodeList.prototype.length=0; +/** + * function item(index) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * Note: This object can also be dereferenced using square bracket notation (e.g. obj[1]). Dereferencing with an integer index is equivalent to invoking the item method with that index + * + * @param {Number} index + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node +*/ +NodeList.prototype.item = function(index){return new Node();}; + +/** + * Object NamedNodeMap() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Object + */ +function NamedNodeMap(){}; +NamedNodeMap.prototype = new Object(); +/** + * Property length + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +NamedNodeMap.prototype.length=0; +/** + * function getNamedItem(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.getNamedItem=function(name){return new Node();}; +/** + * function setNamedItem(arg) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} arg + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.setNamedItem=function(arg){return new Node();}; +/** + * function removeNamedItem(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.removeNamedItem=function(name){return new Node();}; +/** + * function item(index) + * Note: This object can also be dereferenced using square bracket notation (e.g. obj[1]). Dereferencing with an integer index is equivalent to invoking the item method with that index. + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Number} index + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.item=function(index){return new Node();}; +/** + * function getNamedItemNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.getNamedItemNS=function(namespaceURI, localName){return new Node();}; +/** + * function setNamedItemNS(arg) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} arg + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.setNamedItemNS=function(arg){return new Node();}; +/** + * function removeNamedItemNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.removeNamedItemNS=function(namespaceURI, localName){return new Node();}; + +/** + * Object CharacterData() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function CharacterData(){}; +CharacterData.prototype=new Node(); +/** + * Property data + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.data=""; +/** + * Property length + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.length=0; +/** + * function substringData(offset, count) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Number} offset + * @param {Number} count + * @returns {String} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.substringData=function(offset, count){return "";}; +/** + * function appendData(arg) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} arg + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.appendData=function(arg){}; +/** + * function insertData(offset, arg) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Number} offset + * @param {String} arg + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.insertData=function(offset, arg){}; +/** + * function deleteData(offset, count) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Number} offset + * @param {Number} count + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.deleteData=function(offset, count){}; +/** + * function replaceData(offset, count, arg) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Number} offset + * @param {Number} count + * @param {String} arg + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.replaceData=function(offset, count, arg){}; + +/** + * Object Attr() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function Attr(){}; +Attr.prototype = new Node(); +/** + * Property name + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Attr.prototype.name = ""; +/** + * Property specified + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Attr.prototype.specified = false; +/** + * Property value + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Attr.prototype.value = ""; +/** + * Property ownerElement + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Element + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Element + */ +Attr.prototype.ownerElement = new Element(); + +/** + * Object Element() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function Element(){}; +Element.prototype=new Node(); +/** + * Property tagName + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.tagName=""; +/** + * function addEventListener(Stirng type, Function listener, Boolean useCapture) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} type + * @param {Function} listener + * @param {Boolean} useCapture + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.addEventListener=function(type, listener, useCapture){}; +/** + * function attachEvent(String type, Function listener) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} type + * @param {Function} listener + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.attachEvent=function(type, listener){}; +/** + * function detachEvent(String type, Function listener) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} type + * @param {Function} listener + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.detachEvent=function(type, listener){}; +/** + * function dispatchEvent(Object event) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Object} event + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.dispatchEvent=function(event){return false;}; +/** + * function getAttribute(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.getAttribute=function(name){return "";}; +/** + * function setAttribute(name, value) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @param {String} value + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.setAttribute=function(name, value){}; +/** + * function removeAttribute(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.removeAttribute=function(name){}; +/** + * function getAttributeNode(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {Attr} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.getAttributeNode=function(name){return new Attr();}; +/** + * function setAttributeNode(newAttr) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Attr} newAttr + * @returns {Attr} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.setAttributeNode=function(newAttr){return new Attr();}; +/** + * function removeAttributeNode(oldAttr) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Attr} oldAttr + * @returns {Attr} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.removeAttributeNode=function(oldAttr){return new Attr();}; +/** + * function getElementsByTagName(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {NodeList} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.getElementsByTagName=function(name){return new NodeList();}; +/** + * function getAttributeNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {String} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.getAttributeNS=function(namespaceURI, localName){return "";}; +/** + * function setAttributeNS(namespaceURI, qualifiedName, value) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} qualifiedName + * @param {String} value + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.setAttributeNS=function(namespaceURI, qualifiedName, value){}; +/** + * function removeAttributeNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.removeAttributeNS=function(namespaceURI, localName){}; +/** + * function getAttributeNodeNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {Attr} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.getAttributeNodeNS=function(namespaceURI, localName){return new Attr();}; +/** + * function setAttributeNodeNS(newAttr) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Attr} newAttr + * @returns {Attr} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.setAttributeNodeNS=function(newAttr){return new Attr();}; +/** + * function getElementsByTagNameNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {NodeList} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.getElementsByTagNameNS=function(namespaceURI, localName){return new NodeList();}; +/** + * function hasAttribute(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.hasAttribute=function(name){return false;}; +/** + * function hasAttributeNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.hasAttributeNS=function(namespaceURI, localName){return false;}; + +/** + * Object Text() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments CharacterData + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see CharacterData + */ +function Text(){}; +Text.prototype = new CharacterData(); +/** + * function splitText(offset) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Number} offset + * @returns {Text} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Text + */ +Text.prototype.splitText = function(offset) {return new Text();}; + +/** + * Object Comment() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments CharacterData + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see CharacterData + */ +function Comment(){}; +Comment.prototype = new CharacterData(); + +/** + * Object CDATASection() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Text + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Text + */ +function CDATASection(){}; +CDATASection.prototype = new Text(); + +/** + * Object DocumentType() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function DocumentType(){}; +DocumentType.prototype = new Node(); +/** + * Property name + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DocumentType.prototype.name=""; +/** + * Property entities + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type NamedNodeMap + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DocumentType.prototype.entities = new NamedNodeMap(); +/** + * Property notations + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type NamedNodeMap + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DocumentType.prototype.notations=new NamedNodeMap(); +/** + * Property publicId + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DocumentType.prototype.publicId=""; +/** + * Property systemId + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DocumentType.prototype.systemId=""; +/** + * Property internalSubset + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DocumentType.prototype.internalSubset=""; + +/** + * Object Notation() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function Notation(){}; +Notation.prototype=new Node(); +/** + * Property publicId + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Notation.prototype.publicId=""; +/** + * Property systemId + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Notation.prototype.systemId=""; + +/** + * Object Entity() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function Entity(){}; +Entity.prototype=new Node(); +/** + * Property publicId + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Entity.prototype.publicId=""; +/** + * Property systemId + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Entity.prototype.systemId=""; +/** + * Property notationName + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Entity.prototype.notationName=""; + +/** + * Object EntityReference() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function EntityReference(){}; +EntityReference.prototype=new Node(); + +/** + * Object ProcessingInstruction() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function ProcessingInstruction(){}; +ProcessingInstruction.prototype=new Node(); +/** + * Property target + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +ProcessingInstruction.prototype.target=""; +/** + * Property target + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +ProcessingInstruction.prototype.data=""; + + +/*HTML DOM Below this line*/ + +/** + * Object HTMLCollection() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +function HTMLCollection(){}; +HTMLCollection.prototype = new Object(); +/** + * Property length + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLCollection.prototype.length=0; +/** + * function item(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLCollection.prototype.item = function(index){return new Node();}; +/** + * function namedItem(name) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {String} name + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLCollection.prototype.namedItem = function(index){return new Node();}; + +/** + * Object HTMLOptionsCollection() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +function HTMLOptionsCollection(){}; +HTMLOptionsCollection.prototype = new Object(); +/** + * Property length + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionsCollection.prototype.length=0; +/** + * function item(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionsCollection.prototype.item = function(index){return new Node();}; +/** + * function namedItem(name) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {String} name + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionsCollection.prototype.namedItem = function(index){return new Node();}; + +/** + * Object HTMLDocument() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments Document + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see Document + */ +function HTMLDocument(){}; +HTMLDocument.prototype = new Document(); +/** + * Property title + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.title=""; +/** + * Property referrer + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.referrer=""; +/** + * Property domain + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.domain=""; +/** + * Property URL + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.URL=""; +/** + * Property body + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.body=new HTMLElement(); +/** + * Property images + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.images=new HTMLCollection(); +/** + * Property applets + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.applets=new HTMLCollection(); +/** + * Property links + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.links=new HTMLCollection(); +/** + * Property forms + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.forms=new HTMLCollection(); +/** + * Property anchors + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.anchors=new HTMLCollection(); +/** + * Property cookie + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.cookie=""; +/** + * Property lastModified + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.lastModified=""; +/** + * function open() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.open = function(){}; +/** + * function close() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.close = function(){}; +/** + * function write(text) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {String} text + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.write = function(text){}; +/** + * function writeln(text) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {String} text + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.writeln = function(text){}; +/** + * function getElementsByName(elementName) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {String} elementName + * @returns {NodeList} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.getElementsByName = function(elementName){return new NodeList();}; + +/** + * Object HTMLElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments Element + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see Element + */ +function HTMLElement(){}; +HTMLElement.prototype = new Element(); +/** + * Property id + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLElement.prototype.id=""; +/** + * Property title + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLElement.prototype.title=""; +/** + * Property lang + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLElement.prototype.lang=""; +/** + * Property dir + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLElement.prototype.dir=""; +/** + * Property className + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLElement.prototype.className=""; +/** + * Property innerHTML + * + * @type String + */ +HTMLElement.prototype.innerHTML=""; +/** + * Property offsetHeight + * + * @type Number + */ +HTMLElement.prototype.offsetHeight=0; +/** + * Property offsetWidth + * + * @type Number + */ +HTMLElement.prototype.offsetWidth=0; +/** + * Property offsetLeft + * + * @type Number + */ +HTMLElement.prototype.offsetLeft=0; +/** + * Property offsetTop + * + * @type Number + */ +HTMLElement.prototype.offsetTop=0; +/** + * Property offsetParent + * + * @type HTMLElement + */ +HTMLElement.prototype.offsetParent = new HTMLElement(); +/** + * Property scrollHeight + * + * @type Number + */ +HTMLElement.prototype.scrollHeight=0; +/** + * Property scrollWidth + * + * @type Number + */ +HTMLElement.prototype.scrollWidth=0; +/** + * Property scrollLeft + * + * @type Number + */ +HTMLElement.prototype.scrollLeft=0; +/** + * Property scrollTop + * + * @type Number + */ +HTMLElement.prototype.scrollTop=0; +/** + * Property style + * + * @type CSS2Properties + */ +HTMLElement.prototype.style = new CSS2Properties(); + +/** + * Object HTMLHtmlElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLHtmlElement(){}; +HTMLHtmlElement.prototype = new HTMLElement(); +/** + * Property version + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHtmlElement.prototype.version=""; + +/** + * Object HTMLHeadElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLHeadElement(){}; +HTMLHeadElement.prototype = new HTMLElement(); +/** + * Property profile + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHeadElement.prototype.profile=""; + +/** + * Object HTMLLinkElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLLinkElement(){}; +HTMLLinkElement.prototype = new HTMLElement(); +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.disabled=false; +/** + * Property charset + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.charset=""; +/** + * Property href + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.href=""; +/** + * Property hreflang + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.hreflang=""; +/** + * Property media + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.media=""; +/** + * Property rel + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.rel=""; +/** + * Property rev + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.rev=""; +/** + * Property target + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.target=""; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.type=""; + +/** + * Object HTMLTitleElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTitleElement(){}; +HTMLTitleElement.prototype = new HTMLElement(); +/** + * Property text + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTitleElement.prototype.text=""; + +/** + * Object HTMLMetaElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLMetaElement(){}; +HTMLMetaElement.prototype = new HTMLElement(); +/** + * Property content + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMetaElement.prototype.content=""; +/** + * Property httpEquiv + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMetaElement.prototype.httpEquiv=""; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMetaElement.prototype.name=""; +/** + * Property scheme + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMetaElement.prototype.scheme=""; + +/** + * Object HTMLBaseElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLBaseElement(){}; +HTMLBaseElement.prototype = new HTMLElement(); +/** + * Property href + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBaseElement.prototype.href=""; +/** + * Property target + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBaseElement.prototype.target=""; + +/** + * Object HTMLIsIndexElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLIsIndexElement(){}; +HTMLIsIndexElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIsIndexElement.prototype.form=new HTMLFormElement(); +/** + * Property prompt + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIsIndexElement.prototype.prompt=""; + +/** + * Object HTMLStyleElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLStyleElement(){}; +HTMLStyleElement.prototype = new HTMLElement(); +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLStyleElement.prototype.disabled=false; +/** + * Property media + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLStyleElement.prototype.media=""; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLStyleElement.prototype.type=""; + +/** + * Object HTMLBodyElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLBodyElement(){}; +HTMLBodyElement.prototype = new HTMLElement(); +/** + * Property aLink + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBodyElement.prototype.aLink=""; +/** + * Property background + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBodyElement.prototype.background=""; +/** + * Property bgColor + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBodyElement.prototype.bgColor=""; +/** + * Property link + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBodyElement.prototype.link=""; +/** + * Property text + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBodyElement.prototype.text=""; +/** + * Property vLink + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBodyElement.prototype.vLink=""; + +/** + * Object HTMLFormElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLFormElement(){}; +HTMLFormElement.prototype = new HTMLElement(); +/** + * Property elements + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.elements=new HTMLCollection(); +/** + * Property length + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.length=0; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.name=""; +/** + * Property acceptCharset + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.acceptCharset=""; +/** + * Property action + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.action=""; +/** + * Property enctype + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.enctype=""; +/** + * Property method + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.method=""; +/** + * Property target + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.target=""; +/** + * function submit() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.submit = function(){}; +/** + * function reset() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.reset = function(){}; + +/** + * Object HTMLSelectElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLSelectElement(){}; +HTMLSelectElement.prototype = new HTMLElement(); +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.type=""; +/** + * Property selectedIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.selectedIndex=0; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.value=""; +/** + * Property length + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.length=0; +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.form = new HTMLFormElement(); +/** + * Property options + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLOptionsCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.options= new HTMLOptionsCollection(); +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.disabled=false; +/** + * Property multiple + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.multiple=false; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.name=""; +/** + * Property size + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.size=0; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.tabIndex=0; +/** + * function add(element, before) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {HTMLElement} element + * @param {HTMLElement} before + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.add = function(element, before){}; +/** + * function remove(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.remove = function(index){}; +/** + * function blur() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.blur = function(){}; +/** + * function focus() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.focus = function(){}; + +/** + * Object HTMLOptGroupElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLOptGroupElement(){}; +HTMLOptGroupElement.prototype = new HTMLElement(); +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptGroupElement.prototype.disabled=false; +/** + * Property label + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptGroupElement.prototype.label=""; + +/** + * Object Option() + * @constructor + * @param {String} text + * @param {String} value + * @param {Boolean} defaultSelected + * @param {Boolean} selected + */ +function Option(text, value, defaultSelected, selected){}; +Option.prototype = new HTMLOptionElement(); +/** + * Object HTMLOptionElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLOptionElement(){}; +HTMLOptionElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.form = new HTMLFormElement(); +/** + * Property defaultSelected + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.defaultSelected=false; +/** + * Property text + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.text=""; +/** + * Property index + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.index=0; +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.disabled=false; +/** + * Property label + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.label=""; +/** + * Property selected + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.selected=false; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.value=""; + +/** + * Object HTMLInputElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLInputElement(){}; +HTMLInputElement.prototype = new HTMLElement(); +/** + * Property defaultValue + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.defaultValue=""; +/** + * Property defaultChecked + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.defaultChecked=false; +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.form = new HTMLFormElement(); +/** + * Property accept + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.accept=""; +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.accessKey=""; +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.align=""; +/** + * Property alt + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.alt=""; +/** + * Property checked + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.checked=false; +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.disabled=false; +/** + * Property masLength + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.maxLenght=0; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.name=""; +/** + * Property readOnly + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.readOnly=false; +/** + * Property size + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.size=0; +/** + * Property src + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.src=""; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.tabIndex=0; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.type=""; +/** + * Property useMap + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.useMap=""; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.value=""; +/** + * function blur() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.blur = function(){}; +/** + * function focus() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.focus = function(){}; +/** + * function select() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.select = function(){}; +/** + * function click() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.click = function(){}; + +/** + * Object HTMLTextAreaElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTextAreaElement(){}; +HTMLTextAreaElement.prototype = new HTMLElement(); +/** + * Property defaultValue + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.defaultValue=""; +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.form= new HTMLFormElement(); +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.accessKey=""; +/** + * Property cols + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.cols=0; +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.disabled=false; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.name=""; +/** + * Property readOnly + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.readOnly=false; +/** + * Property rows + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.rows=0; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.tabIndex=0; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.type=""; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.value=""; +/** + * function blur() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.blur = function(){}; +/** + * function focus() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.focus = function(){}; +/** + * function select() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.select = function(){}; + +/** + * Object HTMLButtonElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLButtonElement(){}; +HTMLButtonElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.form = new HTMLFormElement(); +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.accessKey = ""; +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.disabled=false; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.name=""; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.tabIndex=0; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.type=""; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.value=""; + +/** + * Object HTMLLabelElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLLabelElement(){}; +HTMLLabelElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLabelElement.prototype.form = new HTMLFormElement(); +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLabelElement.prototype.accessKey=""; +/** + * Property htmlFor + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLabelElement.prototype.htmlFor=""; + +/** + * Object HTMLFieldSetElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLFieldSetElement(){}; +HTMLFieldSetElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFieldSetElement.prototype.form = new HTMLFormElement(); + +/** + * Object HTMLLegendElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLLegendElement(){}; +HTMLLegendElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLegendElement.prototype.form = new HTMLFormElement(); +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLegendElement.prototype.accessKey=""; +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLegendElement.prototype.align=""; + +/** + * Object HTMLUListElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLUListElement(){}; +HTMLUListElement.prototype = new HTMLElement(); +/** + * Property compact + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLUListElement.prototype.compact=false; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLUListElement.prototype.type=""; + +/** + * Object HTMLOListElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLOListElement(){}; +HTMLOListElement.prototype = new HTMLElement(); +/** + * Property compact + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOListElement.prototype.compact=false; +/** + * Property start + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOListElement.prototype.start=0; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOListElement.prototype.type=""; + +/** + * Object HTMLDListElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLDListElement(){}; +HTMLDListElement.prototype = new HTMLElement(); +/** + * Property compact + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDListElement.prototype.compact=false; + +/** + * Object HTMLDirectoryElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLDirectoryElement(){}; +HTMLDirectoryElement.prototype = new HTMLElement(); +/** + * Property compact + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDirectoryElement.prototype.compact=false; + +/** + * Object HTMLMenuElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLMenuElement(){}; +HTMLMenuElement.prototype = new HTMLElement(); +/** + * Property compact + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMenuElement.prototype.compact=false; + +/** + * Object HTMLLIElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLLIElement(){}; +HTMLLIElement.prototype = new HTMLElement(); +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLIElement.prototype.type=""; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLIElement.prototype.value=0; + +/** + * Object HTMLDivElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLDivElement(){}; +HTMLDivElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDivElement.prototype.align=""; + +/** + * Object HTMLParagraphElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLParagraphElement(){}; +HTMLParagraphElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLParagraphElement.prototype.align=""; + +/** + * Object HTMLHeadingElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLHeadingElement(){}; +HTMLHeadingElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHeadingElement.prototype.align=""; + +/** + * Object HTMLQuoteElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLQuoteElement(){}; +HTMLQuoteElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLQuoteElement.prototype.align=""; + +/** + * Object HTMLPreElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLPreElement(){}; +HTMLPreElement.prototype = new HTMLElement(); +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLPreElement.prototype.width=0; + +/** + * Object HTMLBRElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLBRElement(){}; +HTMLBRElement.prototype = new HTMLElement(); +/** + * Property clear + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBRElement.prototype.clear=""; + +/** + * Object HTMLBaseFontElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLBaseFontElement(){}; +HTMLBaseFontElement.prototype = new HTMLElement(); +/** + * Property color + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBaseFontElement.prototype.color=""; +/** + * Property face + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBaseFontElement.prototype.face=""; +/** + * Property size + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBaseFontElement.prototype.size=0; + +/** + * Object HTMLBaseFontElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLFontElement(){}; +HTMLFontElement.prototype = new HTMLElement(); +/** + * Property color + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFontElement.prototype.color=""; +/** + * Property face + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFontElement.prototype.face=""; +/** + * Property size + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFontElement.prototype.size=0; + +/** + * Object HTMLHRElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLHRElement(){}; +HTMLHRElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHRElement.prototype.align=""; +/** + * Property noShade + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHRElement.prototype.noShade=false; +/** + * Property size + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHRElement.prototype.size=""; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHRElement.prototype.width=""; + +/** + * Object HTMLModElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLModElement(){}; +HTMLModElement.prototype = new HTMLElement(); +/** + * Property cite + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLModElement.prototype.cite=""; +/** + * Property dateTime + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLModElement.prototype.dateTime=""; + +/** + * Object HTMLAnchorElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLAnchorElement(){}; +HTMLAnchorElement.prototype = new HTMLElement(); +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.accessKey=""; +/** + * Property charset + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.charset=""; +/** + * Property coords + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.coords=""; +/** + * Property href + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.href=""; +/** + * Property hreflang + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.hreflang=""; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.name=""; +/** + * Property rel + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.rel=""; +/** + * Property rev + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.rev=""; +/** + * Property shape + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.shape=""; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.tabIndex=0; +/** + * Property target + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.target=""; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.type=""; +/** + * function blur() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.blur = function(){}; +/** + * function focus() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.focus = function(){}; + +/** + * Object Image() + * @constructor + * @param {Number} width + * @param {Number} height + */ +function Image(width, height){}; +Image.prototype = new HTMLImageElement(); +/** + * Object HTMLImageElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLImageElement(){}; +HTMLImageElement.prototype = new HTMLElement(); +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.name=""; +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.align=""; +/** + * Property alt + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.alt=""; +/** + * Property border + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.border=""; +/** + * Property height + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.height=0; +/** + * Property hspace + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.hspace=0; +/** + * Property isMap + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.isMap=false; +/** + * Property longDesc + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.longDesc=""; +/** + * Property src + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.src=""; +/** + * Property useMap + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.useMap=""; +/** + * Property vspace + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.vspace=0; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.width=0; + +/** + * Object HTMLObjectElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLObjectElement(){}; +HTMLObjectElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.form = new HTMLFormElement(); +/** + * Property code + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.code=""; +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.align=""; +/** + * Property archive + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.archive=""; +/** + * Property border + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.border=""; +/** + * Property codeBase + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.codeBase=""; +/** + * Property codeType + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.codeType=""; +/** + * Property data + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.data=""; +/** + * Property declare + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.declare=false; +/** + * Property height + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.height=""; +/** + * Property hspace + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.hspace=0; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.name=""; +/** + * Property standby + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.standby=""; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.tabIndex=0; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.type=""; +/** + * Property useMap + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.useMap=""; +/** + * Property vspace + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.vspace=0; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.width=""; +/** + * Property contentDocument + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Document + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.contentDocument= new HTMLDocument(); + +/** + * Object HTMLParamElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLParamElement(){}; +HTMLParamElement.prototype = new HTMLElement(); +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLParamElement.prototype.name=""; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLParamElement.prototype.type=""; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLParamElement.prototype.value=""; +/** + * Property valueType + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLParamElement.prototype.valueType=""; + +/** + * Object HTMLAppletElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLAppletElement(){}; +HTMLAppletElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.align=""; +/** + * Property alt + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.alt=""; +/** + * Property archive + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.archive=""; +/** + * Property code + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.code=""; +/** + * Property codeBase + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.codeBase=""; +/** + * Property height + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.hight=""; +/** + * Property hspace + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.hspace=0; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.name=""; +/** + * Property object + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.object=""; +/** + * Property vspace + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.vspace=0; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.width=""; + +/** + * Object HTMLMapElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLMapElement(){}; +HTMLMapElement.prototype = new HTMLElement(); +/** + * Property areas + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMapElement.prototype.areas = new HTMLCollection(); +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMapElement.prototype.name=""; + +/** + * Object HTMLAreaElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLAreaElement(){}; +HTMLAreaElement.prototype = new HTMLElement(); +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.accessKey=""; +/** + * Property alt + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.alt=""; +/** + * Property coords + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.coords=""; +/** + * Property href + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.href=""; +/** + * Property noHref + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.noHref=false; +/** + * Property shape + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.shape=""; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.tabIndex=0; +/** + * Property target + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.target=""; + +/** + * Object HTMLScriptElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLScriptElement(){}; +HTMLScriptElement.prototype = new HTMLElement(); +/** + * Property text + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.text=""; +/** + * Property htmlFor + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.htmlFor=""; +/** + * Property event + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.event=""; +/** + * Property charset + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.charset=""; +/** + * Property defer + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.defer=""; +/** + * Property src + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.src=""; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.type=""; + +/** + * Object HTMLTableElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTableElement(){}; +HTMLTableElement.prototype = new HTMLElement(); +/** + * Property caption + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLTableCaptionElement + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.caption = new HTMLTableCaptionElement(); +/** + * Property tHead + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLTableSectionElement + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.tHead = new HTMLTableSelectionElement(); +/** + * Property tFoot + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLTableSectionElement + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.tFoot = new HTMLTableSelectionElement(); +/** + * Property rows + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.rows = new HTMLCollection(); +/** + * Property tBodies + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.tBodies = new HTMLCollection(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.align=""; +/** + * Property bgColor + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.bgColor=""; +/** + * Property border + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.border=""; +/** + * Property cellPadding + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.cellPadding=""; +/** + * Property cellSpacing + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.cellSpacing=""; +/** + * Property frame + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.frame=""; +/** + * Property rules + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.rules=""; +/** + * Property summary + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.summary=""; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.width=""; +/** + * function createTHead(); + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @returns {HTMLElement} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.createTHead = function(){return new HTMLElement();}; +/** + * function deleteTHead(); + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.deleteTHead = function(){}; +/** + * function createTFoot(); + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @returns {HTMLElement} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.createTFoot = function(){return new HTMLElement();}; +/** + * function deleteTFoot(); + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.deleteTFoot = function(){}; +/** + * function createCaption(); + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @returns {HTMLElement} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.createCaption = function(){return new HTMLElement();}; +/** + * function deleteCaption(); + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.deleteCaption = function(){}; +/** + * function insertRow(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @returns {HTMLElement} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.insertRow = function(index){return new HTMLElement();}; +/** + * function deleteRow(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.deleteRow = function(index){}; + +/** + * Object HTMLTableCaptionElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTableCaptionElement(){}; +HTMLTableCaptionElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCaptionElement.prototype.align=""; + +/** + * Object HTMLTableColElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTableColElement(){}; +HTMLTableColElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableColElement.prototype.align=""; +/** + * Property ch + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableColElement.prototype.ch=""; +/** + * Property chOff + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableColElement.prototype.chOff=""; +/** + * Property span + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableColElement.prototype.span=0; +/** + * Property vAlign + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableColElement.prototype.vAlign=""; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableColElement.prototype.width=""; + +/** + * Object HTMLTableSelectionElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTableSelectionElement(){}; +HTMLTableSelectionElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.align=""; +/** + * Property ch + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.ch=""; +/** + * Property chOff + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.chOff=""; +/** + * Property vAlign + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.vAlign=""; +/** + * Property rows + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.rows=""; +/** + * function insertRow(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @returns {HTMLElement} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.insertRow = function(index){return new HTMLElement();}; +/** + * function deleteRow(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.deleteRow = function(index){}; + +/** + * Object HTMLTableRowElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTableRowElement(){}; +HTMLTableRowElement.prototype = new HTMLElement(); +/** + * Property rowIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.rowIndex=0; +/** + * Property sectionRowIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.sectionRowIndex=0; +/** + * Property cells + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.cells = new HTMLCollection(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.align=""; +/** + * Property bgColor + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.bgColor=""; +/** + * Property ch + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.ch=""; +/** + * Property chOff + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.chOff=""; +/** + * Property vAlign + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.vAlign=""; +/** + * function insertCell(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @returns {HTMLElement} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.insertCell = function(index){return new HTMLElement();}; +/** + * function insertCell(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.deleteCell = function(index){}; + +/** + * Object HTMLTableRowElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTableCellElement(){}; +HTMLTableCellElement.prototype = new HTMLElement(); +/** + * Property cellIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.cellIndex=0; +/** + * Property abbr + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.abbr=""; +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.align=""; +/** + * Property axis + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.axis=""; +/** + * Property bgColor + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.bgColor=""; +/** + * Property ch + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.ch=""; +/** + * Property chOff + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.chOff=""; +/** + * Property colSpan + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.colSpan=0; +/** + * Property headers + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.headers=""; +/** + * Property height + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.height=""; +/** + * Property noWrap + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.noWrap=false; +/** + * Property rowSpan + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.rowSpan=0; +/** + * Property scope + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.scope=""; +/** + * Property vAlign + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.vAlign=""; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.width=""; + +/** + * Object HTMLFrameSetElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLFrameSetElement(){}; +HTMLFrameSetElement.prototype = new HTMLElement(); +/** + * Property cols + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameSetElement.prototype.cols=""; +/** + * Property rows + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameSetElement.prototype.rows=""; + +/** + * Object HTMLFrameElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLFrameElement(){}; +HTMLFrameElement.prototype = new HTMLElement(); +/** + * Property frameBorder + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.frameBorder=""; +/** + * Property longDesc + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.longDesc=""; +/** + * Property marginHeight + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.marginHeight=""; +/** + * Property marginWidth + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.marginWidth=""; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.name=""; +/** + * Property noResize + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.noResize=false; +/** + * Property scrolling + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.scrolling=""; +/** + * Property src + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.src=""; +/** + * Property contentDocument + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Document + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.contentDocument= new HTMLDocument(); + +/** + * Object HTMLIFrameElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLIFrameElement(){}; +HTMLIFrameElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.align=""; +/** + * Property frameBorder + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.frameBorder=""; +/** + * Property height + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.height=""; +/** + * Property longDesc + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.longDesc=""; +/** + * Property marginHeight + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.marginHeight=""; +/** + * Property marginWidth + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.marginWidth=""; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.name=""; +/** + * Property scrolling + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.scrolling=""; +/** + * Property src + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.src=""; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.width=""; +/** + * Property contentDocument + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Document + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.contentDocument= new HTMLDocument(); + +/* Stylesheets */ +/** + * Object CSS2Properties() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/ecma-script-binding.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Style Specification. + */ +function CSS2Properties(){}; +CSS2Properties.prototype = new Object(); \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/libraries/system.js b/org.eclipse.wst.jsdt.core/libraries/system.js new file mode 100644 index 0000000..184cb12 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/libraries/system.js @@ -0,0 +1,1483 @@ +/******************************************************************************* + * Copyright (c) 2008, 2010 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + ****************************************************************************** +* Please see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html +*/ + +/** + * Object Object() + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function Object(){}; + /** + * function toString() + * @memberOf Object + * @returns {String} + * @see Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Object.prototype.toString = function(){return "";}; + /** + * function toLocaleString() + * @memberOf Object + * @returns {String} + * @see Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Object.prototype.toLocaleString = function(){return "";}; + /** + * function valueOf() + * @memberOf Object + * @returns {Object} + * @see Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Object.prototype.valueOf = function(){return new Object();}; + /** + * function hasOwnProperty(name) + * @memberOf Object + * @param {String} name + * @returns {Boolean} + * @see Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Object.prototype.hasOwnProperty = function(name){return true;}; + /** + * function isPrototypeOf(o) + * @memberOf Object + * @param {Object} o + * @returns {Boolean} + * @see Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Object.prototype.isPrototypeOf = function(o){return true;}; + /** + * function propertyIsEnumerable(name) + * @memberOf Object + * @param {Object} name + * @returns {Boolean} + * @see Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Object.prototype.propertyIsEnumerable = function(name){return true;}; +/** + * Property constructor + * @type Function + * @memberOf Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Object.prototype.constructor = new Function(); + +/** + * Object String() + * @constructor + * @extends Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function String(){} +String.prototype = new Object(); +/** + * static function fromCharCode(charCode1, ...) + * @memberOf String + * @param {Number} charCode + * @returns {String} + * @static + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.fromCharCode = function(charCode){return "";}; +/** + * Property length + * @type Number + * @memberOf String + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.length = 1; + /** + * function charAt(position) + * @memberOf String + * @param {Number} position + * @returns {String} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.charAt = function(position){return "";}; + /** + * function charCodeAt(position) + * @memberOf String + * @param {Number} position + * @returns {Number} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.charCodeAt = function(position){return 0;}; + /** + * function concat(value1, ...) + * @memberOf String + * @param {String} value + * @returns {String} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.concat = function(value){return "";}; + /** + * function indexOf(searchString, startPosition) + * @memberOf String + * @param {String} searchString + * @param {Number} startPosition + * @returns {Number} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.indexOf = function(searchString, startPosition){return 1;}; + /** + * function lastIndexOf(searchString, startPosition) + * @memberOf String + * @param {String} searchString + * @param {Number} startPosition + * @returns {Number} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.lastIndexOf = function(searchString, startPosition){return 1;}; + /** + * function localeCompare(otherString) + * @memberOf String + * @param {String} otherString + * @returns {Number} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.localeCompare = function(otherString){return 0;}; + /** + * function match(regexp) + * @memberOf String + * @param {RegExp} regexp + * @returns {Array} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.match = function(regexp){return [];}; + /** + * function replace(regexp, replaceValue) + * @memberOf String + * @param {RegExp} regexp + * @param {String} replaceValue + * @returns {String} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.replace = function(regexp, replaceValue){return "";}; + /** + * function search(regexp) + * @memberOf String + * @param {RegExp} regexp + * @returns {Number} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.search = function(regexp){return 1;}; + /** + * function slice(start, end) + * @memberOf String + * @param {Number} start + * @param {Number} end + * @returns {String} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.slice = function(start, end){return "";}; + /** + * function split(separator, limit) + * @memberOf String + * @param {String} separator + * @param {Number} limit + * @returns {Array} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.split = function(separator, limit){return [];}; + /** + * function substring(start, end) + * @memberOf String + * @param {Number} start + * @param {Number} end + * @returns {String} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.substring = function(start, end){return "";}; + /** + * function toLowerCase() + * @memberOf String + * @returns {String} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.toLowerCase = function(){return "";}; + /** + * function toLocaleLowerCase() + * @memberOf String + * @returns {String} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.toLocaleLowerCase = function(){return "";}; + /** + * function toUpperCase() + * @memberOf String + * @returns {String} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.toUpperCase= function (){return "";}; + /** + * function toLocaleUpperCase() + * @memberOf String + * @returns {String} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.toLocaleUpperCase = function(){return "";}; + +/** + * Object Number() + * @constructor + * @extends Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function Number(){} +Number.prototype = new Object(); +/** + * property MIN_VALUE + * @type Number + * @memberOf Number + * @static + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Number.MIN_VALUE = 0; +/** + * property MAX_VALUE + * @type Number + * @memberOf Number + * @static + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Number.MAX_VALUE = 0 ; +/** + * property NaN + * @type Number + * @memberOf Number + * @static + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Number.NaN = 0; +/** + * property NEGATIVE_INFINITY + * @type Number + * @memberOf Number + * @static + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Number.NEGATIVE_INFINITY = 0; +/** + * property POSITIVE_INFINITY + * @type Number + * @memberOf Number + * @static + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Number.POSITIVE_INFINITY = 0; +/** + * function toFixed(fractionDigits) + * @memberOf Number + * @param {Number} fractionDigits + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Number.prototype.toFixed = function(fractionDigits){return "";}; +/** + * function toExponential(fractionDigits) + * @memberOf Number + * @param {Number} fractionDigits + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +Number.prototype.toExponential = function(fractionDigits){return "";}; +/** + * function toPrecision(precision) + * @memberOf Number + * @param {Number} fractionDigits + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +Number.prototype.toPrecision = function(fractionDigits){return "";}; + +/** + * Object Boolean() + * @constructor + * @extends Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +function Boolean(){}; +Boolean.prototype = new Object(); + +/** + * Object Array() + * @constructor + * @extends Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function Array(){}; +Array.prototype = new Object(); +/** + * Property length + * @type Number + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.length = 1; +/** + * function concat(args) + * @param {Array} args + * @returns {Array} + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.concat = function(args){return [];}; +/** + * function join(seperator) + * @param {String} seperator + * @returns {Array} + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.join = function(seperator){return [];}; +/** + * function pop() + * @returns {Object} + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.pop = function(){return new Object();}; +/** + * function push(args) + * @param {Array} args + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.push = function(args){}; +/** + * function reverse() + * @returns {Array} + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.reverse = function(){return [];}; +/** + * function shift() + * @returns {Object} + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.shift = function(){return new Object();}; +/** + * function slice(start, end) + * @param {Number} start + * @param {Number} end + * @returns {Array} + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.slice = function(start, end){return [];}; +/** + * function sort(funct) + * @param {Function} funct + * @returns {Array} + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.sort = function(funct){return [];}; +/** + * function splice(start, deletecount, items) + * @param {Number} start + * @param {Number} deletecount + * @param {Array} items + * @returns {Array} + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.splice = function(start, deletecount, items){return [];}; +/** + * function unshift(items) + * @param {Array} start + * @returns {Array} + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.unshift = function(start){return [];}; + +/** + * Object Function() + * @constructor + * @extends Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function Function(){}; +Function.prototype = new Object(); +/** + * function apply (thisObject, argArray) + * @param {Object} thisObject + * @param {Array} argArray + * @returns {Object} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Function.prototype.apply = function(thisArg, argArray){return new Object();}; +/** + * function call (thisObject, args) + * @param {Object} thisObject + * @param {Object} args + * @returns {Object} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Function.prototype.call = function(thisObject, args){return new Object();}; +/** + * property length + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Function.prototype.length = 0; + +/** + * Object Date(s) + * @constructor + * @param {String} s + * @extends Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function Date(s){}; +Date.prototype = new Object(); +/** + * function UTC(hour, min, sec, ms) + * @memberOf Date + * @param {Number} hour + * @param {Number} min + * @param {Number} sec + * @param {Number} ms + * @returns {Number} + * @static + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +Date.UTC = function(hour, min, sec, ms){return 0;}; +/** + * function parse(string) + * @memberOf Date + * @param {String} string + * @returns {Number} + * @static + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.parse = function(string){return 0;}; +/** + * function toDateString() + * @memberOf Date + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.toDateString = function(){return "";}; +/** + * function toTimeString() + * @memberOf Date + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.toTimeString = function(){return "";}; +/** + * function toLocaleString() + * @memberOf Date + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.toLocaleString = function(){return "";}; +/** + * function toLocaleDateString() + * @memberOf Date + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.toLocaleDateString = function(){return "";}; +/** + * function toLocaleTimeString() + * @memberOf Date + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.toLocaleTimeString = function(){return "";}; +/** + * function valueOf() + * @memberOf Date + * @returns {Object} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.valueOf = function(){return new Object();}; +/** + * function getFullYear() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getFullYear = function(){return 0;}; +/** + * function getTime() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getTime = function(){return 0;}; +/** + * function getUTCFullYear() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getUTCFullYear = function(){return 0;}; +/** + * function getMonth() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getMonth = function(){return 0;}; +/** + * function getUTCMonth() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getUTCMonth = function(){return 0;}; +/** + * function getDate() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getDate = function(){return 0;}; +/** + * function getUTCDate() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getUTCDate = function(){return 0;}; +/** + * function getDay() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getDay = function(){return 0;}; +/** + * function getUTCDay() + * @memberOf Date + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + */ +Date.prototype.getUTCDay=function(){return 0;}; +/** + * function getHours() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getHours = function(){return 0;}; +/** + * function getUTCHours() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getUTCHours = function(){return 0;}; +/** + * function getMinutes() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getMinutes = function(){return 0;}; +/** + * function getUTCMinutes() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getUTCMinutes = function(){return 0;}; +/** + * function getSeconds() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getSeconds = function(){return 0;}; +/** + * function getUTCSeconds() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getUTCSeconds = function(){return 0;}; +/** + * function getMilliseconds() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getMilliseconds = function(){return 0;}; +/** + * function getUTCMilliseconds() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getUTCMilliseconds = function(){return 0;}; +/** + * function getTimezoneOffset() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getTimezoneOffset = function(){return 0;}; +/** + * function setTime(value) + * @memberOf Date + * @returns {Number} + * @param {Number} value + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setTime = function(value){return 0;}; + +/** + * function setMilliseconds(value) + * @memberOf Date + * @returns {Number} + * @param {Number} value + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setMilliseconds = function(value){return 0;}; +/** + * function setUTCMilliseconds(ms) + * @memberOf Date + * @returns {Number} + * @param {Number} ms + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setUTCMilliseconds = function(ms){return 0;}; +/** + * function setSeconds(sec,ms) + * @memberOf Date + * @returns {Number} + * @param {Number} sec + * @param {Number} ms + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setSeconds = function(sec,ms){return 0;}; +/** + * function setUTCSeconds(sec,ms) + * @memberOf Date + * @returns {Number} + * @param {Number} sec + * @param {Number} ms + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setUTCSeconds=function(sec,ms){return 0;}; +/** + * function setMinutes(min,sec,ms) + * @memberOf Date + * @returns {Number} + * @param {Number} min + * @param {Number} sec + * @param {Number} ms + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setMinutes=function(min,sec,ms){return 0;}; +/** + * function setUTCMinute(min,sec,ms) + * @memberOf Date + * @returns {Number} + * @param {Number} min + * @param {Number} sec + * @param {Number} ms + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setUTCMinute = function(min,sec,ms){return 0;}; +/** + * function setHours(hour, min,sec,ms) + * @memberOf Date + * @returns {Number} + * @param {Number} hour + * @param {Number} min + * @param {Number} sec + * @param {Number} ms + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setHours = function(hour,min,sec,ms){return 0;}; +/** + * function setUTCHours(hour, min,sec,ms) + * @memberOf Date + * @returns {Number} + * @param {Number} hour + * @param {Number} min + * @param {Number} sec + * @param {Number} ms + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setUTCHours = function(hour,min,sec,ms){return 0;}; + +/** + * function setDate(date) + * @memberOf Date + * @returns {Number} + * @param {Number} date + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setDate = function(date){return 0;}; + +/** + * function setUTCDate(date) + * @memberOf Date + * @returns {Number} + * @param {Number} date + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setUTCDate = function(date){return 0;}; + +/** + * function setMonth(month,date) + * @memberOf Date + * @returns {Number} + * @param {Number} date + * @param {Number} month + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setMonth = function(month,date){return 1;}; +/** + * function setUTCMonth(month,date) + * @memberOf Date + * @returns {Number} + * @param {Number} date + * @param {Number} month + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setUTCMonth = function(month,date){return 1;}; +/** + * function setFullYear(month,date) + * @memberOf Date + * @returns {Number} + * @param {Number} date + * @param {Number} month + * @param {Number} year + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setFullYear = function(year, month,date){return 0;}; +/** + * function setUTCFullYear(month,date) + * @memberOf Date + * @returns {Date} + * @param {Number} date + * @param {Number} month + * @param {Number} year + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setUTCFullYear = function(year, month,date){}; +/** + * function toUTCString() + * @memberOf Date + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +Date.prototype.toUTCString = function(){return "";}; + +/** + * Object Global + * @super Object + * @constructor + * @memberOf Global + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function Global(){}; +Global.prototype=new Object(); +/** + * Property NaN + * @memberOf Global + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Global.prototype.NaN=0; +/** + * Property Infinity + * @memberOf Global + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Global.prototype.Infinity=0; +/** + * function eval(s) + * @memberOf Global + * @param {String} s + * @type Object + * @returns {Object} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Global.prototype.eval=function(s){return new Object();}; + +//@GINO: Bug 197987 (Temp Fix) +/** + * Property debugger + * @memberOf Global + * @description Debugger keyword + */ +Global.prototype.debugger=null; + +/** + * Property undefined + * @memberOf Global + * @description undefined +*/ +Global.prototype.undefined=null; + +/** + * function parseInt(s,radix) + * @memberOf Global + * @param {String} s + * @param {Number} radix + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Global.prototype.parseInt=function(s,radix){return 0;}; +/** + * function parseFloat(s) + * @memberOf Global + * @param {String} s + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Global.prototype.parseFloat=function(s){return 0;}; +/** + * function escape(s) + * @memberOf Global + * @param {String} s + * @type String + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +Global.prototype.escape=function(s){return "";}; +/** + * function unescape(s) + * @memberOf Global + * @param {String} s + * @type String + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +Global.prototype.unescape=function(s){return "";}; +/** + * function isNaN(number) + * @memberOf Global + * @param {String} number + * @type Boolean + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Global.prototype.isNaN=function(number){return false;}; +/** + * function isFinite(number) + * @memberOf Global + * @param {String} number + * @type Boolean + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Global.prototype.isFinite=function(number){return false;}; +/** + * function decodeURI(encodedURI) + * @memberOf Global + * @param {String} encodedURI + * @type String + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +Global.prototype.decodeURI=function(encodedURI){return "";}; +/** + * @memberOf Global + * @param {String} uriComponent + * @type String + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +Global.prototype.decodeURIComponent=function(uriComponent){return "";}; +/** + * function encodeURIComponent(uriComponent) + * @memberOf Global + * @param {String} uriComponent + * @type String + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +Global.prototype.encodeURIComponent=function(uriComponent){return "";}; + +/** + * function encodeURIComponent(URI) + * @memberOf Global + * @param {String} URI + * @type String + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +Global.prototype.encodeURI=function(URI){return "";}; + +/** + * Object Math(\s) + * @super Object + * @constructor + * @memberOf Math + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + */ +function Math(){}; +Math.prototype=new Object(); +/** + * Property E + * @memberOf Math + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.E=0; +/** + * Property LN10 + * @memberOf Math + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.LN10=0; +/** + * Property LN2 + * @memberOf Math + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.LN2=0; +/** + * Property LOG2E + * @memberOf Math + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.LOG2E=0; +/** + * Property LOG10E + * @memberOf Math + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.LOG10E=0; +/** + * Property PI + * @memberOf Math + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.PI=0; +/** + * Property SQRT1_2 + * @memberOf Math + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.SQRT1_2=0; +/** + * Property SQRT2 + * @memberOf Math + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.SQRT2=0; +/** + * function abs(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.abs=function(x){return 0;}; +/** + * function acos(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.acos=function(x){return 0;}; +/** + * function asin(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.asin=function(x){return 0;}; +/** + * function atan(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.atan=function(x){return 0;}; +/** + * function atan2(x,y) + * @memberOf Math + * @param {Number} x + * @param {Number} y + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.atan2=function(x,y){return 0;}; +/** + * function ceil(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.ceil=function(x){return 0;}; +/** + * function cos(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.cos=function(x){return 0;}; +/** + * function exp(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.exp=function(x){return 0;}; +/** + * function floor(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.floor=function(x){return 0;}; +/** + * function log(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.log=function(x){return 0;}; +/** + * function max(arg) + * @memberOf Math + * @param {Number} args + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.max=function(args){return 0;}; +/** + * function min(arg) + * @memberOf Math + * @param {Number} args + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.min=function(args){return 0;}; +/** + * function pow(x,y) + * @memberOf Math + * @param {Number} x + * @param {Number} y + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.pow=function(x,y){return 0;}; +/** + * function pow() + * @memberOf Math + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.random=function(){return 0;}; +/** + * function round(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.round=function(x){return 0;}; +/** + * function sin(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.sin=function(x){return 0;}; +/** + * function sqrt(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.sqrt=function(x){return 0;}; +/** + * function tan(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.tan=function(x){return 0;}; +/** + * Object RegExp() + * @super Object + * @constructor + * @memberOf RegExp + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function RegExp(){}; +RegExp.prototype=new Object(); +/** + * function exec(string) + * @param {String} string + * @returns {Array} + * @type Array + * @memberOf RegExp + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +RegExp.prototype.exec=function(string){return [];}; +/** + * function test(string) + * @param {String} string + * @returns {Boolean} + * @type Boolean + * @memberOf RegExp + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +RegExp.prototype.test=function(string){return false;}; +/** + * property source + * @type String + * @memberOf RegExp + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +RegExp.prototype.source=""; +/** + * property global + * @type Boolean + * @memberOf RegExp + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +RegExp.prototype.global=false; + +/** + * property ignoreCase + * @type Boolean + * @memberOf RegExp + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +RegExp.prototype.ignoreCase=false; +/** + * property multiline + * @type Boolean + * @memberOf RegExp + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +RegExp.prototype.multiline=false; +/** + * property lastIndex + * @type Number + * @memberOf RegExp + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +RegExp.prototype.lastIndex=0; +/** + * Object Error(message) + * @super Object + * @constructor + * @param {String} message + * @memberOf Error + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function Error(message){}; +Error.prototype=new Object(); +/** + * property name + * @type String + * @memberOf Error + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Error.prototype.name=""; +/** + * property message + * @type String + * @memberOf Error + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Error.prototype.message=""; +/** + * Object EvalError() + * @super Error + * @constructor + * + * @memberOf EvalError + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function EvalError(){}; +EvalError.prototype=new Error(""); +/** + * Object RangeError() + * @super Error + * @constructor + * + * @memberOf RangeError + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function RangeError(){}; +RangeError.prototype=new Error(""); +/** + * Object ReferenceError() + * @super Error + * @constructor + * + * @memberOf ReferenceError + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function ReferenceError(){}; +ReferenceError.prototype=new Error(""); +/** + * Object SyntaxError() + * @super Error + * @constructor + * + * @memberOf SyntaxError + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function SyntaxError(){}; +SyntaxError.prototype=new Error(""); +/** + * Object TypeError() + * @super Error + * @constructor + * + * @memberOf TypeError + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function TypeError(){}; +TypeError.prototype=new Error(""); +/** + * Object URIError() + * @super Error + * @constructor + * + * @memberOf URIError + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function URIError(){}; +URIError.prototype=new Error(""); + +//support for debugger keyword +var debugger = null; \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/libraries/xhr.js b/org.eclipse.wst.jsdt.core/libraries/xhr.js new file mode 100644 index 0000000..87c4b3f --- /dev/null +++ b/org.eclipse.wst.jsdt.core/libraries/xhr.js @@ -0,0 +1,106 @@ +/******************************************************************************* + * Copyright (c) 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + ****************************************************************************** + * + * Based on information from https://developer.mozilla.org/En/XMLHttpRequest + * and http://msdn2.microsoft.com/en-us/library/ms533062.aspx + **/ + +/** +* function createRequest +* @type XMLHttpRequest +* @memberOf Window +*/ +Window.prototype.createRequest= function(){return new XMLHttpRequest();}; +/** +* Object XMLHttpRequest +* @super Global +* @type constructor +* @memberOf Global +*/ +XMLHttpRequest.prototype=new Object(); +function XMLHttpRequest(){}; + +/** + * function onreadystatechange + * @memberOf XMLHttpRequest + */ +XMLHttpRequest.prototype.onreadystatechange=function(){}; +/** + * property readyState + * @type Number + * @memberOf XMLHttpRequest + */ +XMLHttpRequest.prototype.readyState=0; +/** + * property responseText + * @type String + * @memberOf XMLHttpRequest + */ +XMLHttpRequest.prototype.responseText=""; +/** + * property responseXML + * @type Document + * @memberOf XMLHttpRequest + */ +XMLHttpRequest.prototype.responseXML=new Document(); +/** + * property status + * @type Number + * @memberOf XMLHttpRequest + */ +XMLHttpRequest.prototype.status=0; +/** + * property statusText + * @type String + * @memberOf XMLHttpRequest + */ +XMLHttpRequest.prototype.statusText=""; +/** + * function abort() + * @memberOf XMLHttpRequest + */ +XMLHttpRequest.prototype.abort=function(){}; +/** +* function getAllResponseHeaders() +* @type String +* @memberOf XMLHttpRequest +*/ +XMLHttpRequest.prototype.getAllResponseHeaders=function(){return "";}; +/** +* function open(method, url, async, username, password) +* @param {String} method +* @param {String} url +* @param {Boolean} optional async +* @param {String} optional username +* @param {String} optional password +* @memberOf XMLHttpRequest +*/ +XMLHttpRequest.prototype.open=function(method, url, async, username, password){}; +/** +* function send(body) +* @param {Object} body +* @memberOf XMLHttpRequest +*/ +XMLHttpRequest.prototype.send=function(body){}; +/** +* function setRequestHeader(header,value) +* @param {String} header +* @param {String} value +* @memberOf XMLHttpRequest +*/ +XMLHttpRequest.prototype.setRequestHeader=function(header,value){}; +/** +* function getAllResponseHeaders() +* @param {String} header +* @type String +* @memberOf XMLHttpRequest +*/ +XMLHttpRequest.prototype.getResponseHeader=function(header){return "";}; diff --git a/org.eclipse.wst.jsdt.core/plugin.properties b/org.eclipse.wst.jsdt.core/plugin.properties new file mode 100644 index 0000000..0d82aa5 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/plugin.properties @@ -0,0 +1,29 @@ +############################################################################### +# Copyright (c) 2000, 2010 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# IBM Corporation - initial API and implementation +############################################################################### +providerName=Eclipse Web Tools Platform +pluginName=JavaScript Development Tools Core +javaScriptNatureName=JavaScript +jsBuilderName=JavaScript Validator +jsProblemName=JavaScript Problem +buildPathProblemName=Include Path Problem +transientJsProblemName=Transient JavaScript Problem +JsGlobalScopeVariableInitializersName=Classpath Variable Initializers +JsGlobalScopeContainerInitializersName=Classpath Container Initializers +codeFormattersName=Source Code Formatters +validationParticipantsName=Compilation Participants +jsTaskName=JavaScript Task +jsPropertiesName=JavaScript Properties File +jsSourceName=JavaScript Source File +jsonSourceName=JS Object Notation File + + +extension-point.name.0 = Support for Inferencing +extension-point.name.1 = Default source path provider diff --git a/org.eclipse.wst.jsdt.core/plugin.xml b/org.eclipse.wst.jsdt.core/plugin.xml new file mode 100644 index 0000000..1e91746 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/plugin.xml @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.wst.jsdt.core/schema/JsGlobalScopeContainerInitializer.exsd b/org.eclipse.wst.jsdt.core/schema/JsGlobalScopeContainerInitializer.exsd new file mode 100644 index 0000000..fadb424 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/schema/JsGlobalScopeContainerInitializer.exsd @@ -0,0 +1,124 @@ + + + + + + + + + This extension point allows clients to contribute custom includepath container initializers, + which are used to lazily bind classpath containers to instances of org.eclipse.wst.jsdt.core.IJsGlobalScopeContainer. + + + + + + + + + + + + a fully qualified identifier of the target extension point + + + + + + + an optional identifier of the extension instance + + + + + + + an optional name of the extension instance + + + + + + + + + + + + + + + a unique name identifying all containers for which this initializer will be activated. + + + + + + + the class that implements this container initializer. + This class must implement a public subclass of <code>org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer</code> with a public 0-argument constructor. + + + + + + + + + + + + + + + 2.0 + + + + + + + + + Example of a declaration of a <code>JsGlobalScopeContainerInitializer</code> for a classpath container named "JDK": <pre> +<extension point="org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer"> + <JsGlobalScopeContainerInitializer + id="JDK" + class="com.example.MyInitializer"/> +</extension> +</pre> + + + + + + + + + + + + + + + + + + + + + + + + + + + Copyright (c) 2000, 2007 IBM Corporation and others.<br> +All rights reserved. This program and the accompanying materials are made +available under the terms of the Eclipse Public License v1.0 which accompanies +this distribution, and is available at <a +href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> + + + + diff --git a/org.eclipse.wst.jsdt.core/schema/JsGlobalScopeVariableInitializer.exsd b/org.eclipse.wst.jsdt.core/schema/JsGlobalScopeVariableInitializer.exsd new file mode 100644 index 0000000..3e5288b --- /dev/null +++ b/org.eclipse.wst.jsdt.core/schema/JsGlobalScopeVariableInitializer.exsd @@ -0,0 +1,141 @@ + + + + + + + + + This extension point allows clients to contribute custom includepath variable initializers, + which are used to lazily bind includepath variables. + + + + + + + + + + + + a fully qualified identifier of the target extension point + + + + + + + an optional identifier of the extension instance + + + + + + + an optional name of the extension instance + + + + + + + + + + + + + + + a unique name identifying the variable for which this initializer will be activated. + + + + + + + the class that implements this variable initializer. + This class must implement a public subclass of <code>org.eclipse.wst.jsdt.core.JsGlobalScopeVariableInitializer</code> with a public 0-argument constructor. + + + + + + + + + + String explaining the reason why the associated variable is deprecated + + + + + + + + + + Indicates that the associated variable cannot be modified + + + + + + + + + + + + 2.0 + + + + + + + + + Example of a declaration of a <code>JsGlobalScopeVariableInitializer</code> for a classpath variable named "FOO": <pre> +<extension point="org.eclipse.wst.jsdt.core.JsGlobalScopeVariableInitializer"> + <JsGlobalScopeVariableInitializer + variable="FOO" + class="com.example.CPVInitializer"/> +</extension> +</pre> + + + + + + + + + + + + + + + + + + + + + + + + + + + Copyright (c) 2000, 2007 IBM Corporation and others.<br> +All rights reserved. This program and the accompanying materials are made +available under the terms of the Eclipse Public License v1.0 which accompanies +this distribution, and is available at <a +href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> + + + + diff --git a/org.eclipse.wst.jsdt.core/schema/codeFormatter.exsd b/org.eclipse.wst.jsdt.core/schema/codeFormatter.exsd new file mode 100644 index 0000000..10f5692 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/schema/codeFormatter.exsd @@ -0,0 +1,111 @@ + + + + + + + + + This extension point allows clients to contribute new source code formatter implementations. + + + + + + + + + + + + a fully qualified identifier of the target extension point + + + + + + + an optional identifier of the extension instance + + + + + + + an optional name of the extension instance + + + + + + + + + + + + + + + the class that defines the code formatter implementation. This class must be a public implementation of <code>org.eclipse.wst.jsdt.core.ICodeFormatter</code> with a public 0-argument constructor. + + + + + + + + + + + + 2.0 + + + + + + + + + Example of an implementation of <code>ICodeFormatter</code>: <pre> +<extension point="org.eclipse.wst.jsdt.core.codeFormatter"> + <codeFormatter + class="com.example.MyCodeFormatter"/> +</extension> +</pre> + + + + + + + + + + + + + + + + + + + + + + + + + + + Copyright (c) 2000, 2007 IBM Corporation and others.<br> +All rights reserved. This program and the accompanying materials are made +available under the terms of the Eclipse Public License v1.0 which accompanies +this distribution, and is available at <a +href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> + + + + diff --git a/org.eclipse.wst.jsdt.core/schema/inferrenceSupport.exsd b/org.eclipse.wst.jsdt.core/schema/inferrenceSupport.exsd new file mode 100644 index 0000000..33ea891 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/schema/inferrenceSupport.exsd @@ -0,0 +1,106 @@ + + + + + + + + + This is an experimental API that is still under development and expected to + change significantly before reaching stability. It is being made available + at this early stage to solicit feedback from pioneering adopters on the + understanding that any code that uses this API will almost certainly be broken + (repeatedly) as the API evolves. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Since WTP 3.0 + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/org.eclipse.wst.jsdt.core/schema/sourcePathProvider.exsd b/org.eclipse.wst.jsdt.core/schema/sourcePathProvider.exsd new file mode 100644 index 0000000..59053da --- /dev/null +++ b/org.eclipse.wst.jsdt.core/schema/sourcePathProvider.exsd @@ -0,0 +1,102 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/org.eclipse.wst.jsdt.core/schema/validationParticipant.exsd b/org.eclipse.wst.jsdt.core/schema/validationParticipant.exsd new file mode 100644 index 0000000..34c9bee --- /dev/null +++ b/org.eclipse.wst.jsdt.core/schema/validationParticipant.exsd @@ -0,0 +1,192 @@ + + + + + + + + + This extension point allows clients to participate in the validation process by receiving notifications at various stages of build and reconcile, via a org.eclipse.jdt.core.compiler.validationParticipant. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + definition of a compilation participant. This definition allows to order participants. Participants are run by group. The group of participants that modify the environment is run first, then the group of participants that create problems is run, finally the group of other participants is run. Inside each group, participants are ordered using their 'requires' attributes. If a 'requires' attribute point to a participant that doesn't belong to the group, it is ignored. + + + + + + + + + + + the class that implements this compilation participant. This class must implement a public subclass of <code>org.eclipse.jdt.core.compiler.validationParticipant</code> with a public 0-argument constructor. + + + + + + + + + + a unique identifier for this participant + + + + + + + optionally specify whether this compilation participant modifies the environment, thus affecting binding resolution. If not specified, false is assumed. + + + + + + + optionally specifies whether this compilation participant creates problems. If not specified, false is assumed. + + + + + + + the required source level this participant needs (one of the JavaCore.VERSION* constants). If a project's source level is below this required source level, the participant will not be invoked. If this attribute is not specified, the participant will be invoked for any source level. + + + + + + + + + + a participant that is required to run this compilation participant + + + + + + + the unique identifier of the participant that is required + + + + + + + + + + a managed marker is created from the recorded problems (see BuildContext#recordNewProblems(CategorizedProblem[])) and is removed when the corresponding source file is re-built or when the project is cleaned + + + + + + + the type of the managed marker + + + + + + + + + + + + 3.2 + + + + + + + + + Example of a declaration of a <code>validationParticipant</code>: <pre> +<extension + id="apt" + name="%annotationProcessingName" + point="org.eclipse.jdt.core.validationParticipant"> + <validationParticipant + class="org.eclipse.jdt.apt.core.internal.AptvalidationParticipant" + id="APT" + requiredSourceLevel="1.5"> + <managedMarker markerType="org.eclipse.jdt.apt.core.compile.problem"/> + </validationParticipant> +</extension> +</pre> + + + + + + + + + + + + + + + + + + + + + + + + + + + Copyright (c) 2006 BEA Systems, Inc and others.<br> +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +which accompanies this distribution, and is available at +<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> + + + + diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/BindingKey.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/BindingKey.java new file mode 100644 index 0000000..ef01b9c --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/BindingKey.java @@ -0,0 +1,108 @@ +/******************************************************************************* + * Copyright (c) 2005, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.wst.jsdt.internal.core.util.KeyToSignature; + +/** + * Utility class to decode or create a binding key. + *

+ * This class is not intended to be subclassed by clients. + *

+ * + * @see org.eclipse.wst.jsdt.core.dom.IBinding#getKey() + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public final class BindingKey { + + private String key; + + /** + * Creates a new binding key. + * + * @param key the key to decode + */ + public BindingKey(String key) { + this.key = key; + } + + /** + * Creates a new array type binding key from the given type binding key and the given array dimension. + *

+ * For example: + *

+	 * 
+	 * createArrayTypeBindingKey("LObject;", 1) -> "[LObject;"
+	 * 
+	 * 
+ *

+ * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param typeKey the binding key of the given type + * @param arrayDimension the given array dimension + * @return a new array type binding key + */ + public static String createArrayTypeBindingKey(String typeKey, int arrayDimension) { + // Note this implementation is heavily dependent on ArrayTypeBinding#computeUniqueKey() + StringBuffer buffer = new StringBuffer(); + while (arrayDimension-- > 0) + buffer.append('['); + buffer.append(typeKey); + return buffer.toString(); + } + + /** + * Creates a new type binding key from the given type name. + *

+ * For example: + *

+	 * 
+	 * createTypeBindingKey("String") -> "LString;"
+	 * 
+	 * 
+ *

+ * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param typeName the possibly qualified type name + * @return a new type binding key + */ + public static String createTypeBindingKey(String typeName) { + // Note this implementation is heavily dependent on TypeBinding#computeUniqueKey() and its subclasses + return Signature.createTypeSignature(typeName.replace('.', '/'), true/*resolved*/); + } + + /** + * Transforms this binding key into a resolved signature. + * If this binding key represents a field, the returned signature is + * the declaring type's signature. + * + * @return the resolved signature for this binding key + * @see Signature + */ + public String toSignature() { + KeyToSignature keyToSignature = new KeyToSignature(this.key, KeyToSignature.SIGNATURE); + keyToSignature.parse(); + return keyToSignature.signature.toString(); + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + public String toString() { + return this.key; + } +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/BufferChangedEvent.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/BufferChangedEvent.java new file mode 100644 index 0000000..207ba45 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/BufferChangedEvent.java @@ -0,0 +1,121 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import java.util.EventObject; + +/** + * A buffer changed event describes how a buffer has changed. These events are + * used in IBufferChangedListener notifications. + *

+ * For text insertions, getOffset is the offset + * of the first inserted character, getText is the + * inserted text, and getLength is 0. + *

+ *

+ * For text removals, getOffset is the offset + * of the first removed character, getText is null, + * and getLength is the length of the text that was removed. + *

+ *

+ * For replacements (including IBuffer.setContents), + * getOffset is the offset + * of the first replaced character, getText is the replacement + * text, and getLength is the length of the original text + * that was replaced. + *

+ *

+ * When a buffer is closed, getOffset is 0, getLength + * is 0, and getText is null. + *

+ *

+ * This class is not intended to be instantiated or subclassed by clients. + * Instances of this class are automatically created by the JavaScript model. + *

+ * + * @see IBuffer + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public class BufferChangedEvent extends EventObject { + + /** + * The length of text that has been modified in the buffer. + */ + private int length; + + /** + * The offset into the buffer where the modification took place. + */ + private int offset; + + /** + * The text that was modified. + */ + private String text; + + private static final long serialVersionUID = 655379473891745999L; // backward compatible + +/** + * Creates a new buffer changed event indicating that the given buffer has changed. + * + * @param buffer the given buffer + * @param offset the given offset + * @param length the given length + * @param text the given text + */ +public BufferChangedEvent(IBuffer buffer, int offset, int length, String text) { + super(buffer); + this.offset = offset; + this.length = length; + this.text = text; +} +/** + * Returns the buffer which has changed. + * + * @return the buffer affected by the change + */ +public IBuffer getBuffer() { + return (IBuffer) this.source; +} +/** + * Returns the length of text removed or replaced in the buffer, or + * 0 if text has been inserted into the buffer. + * + * @return the length of the original text fragment modified by the + * buffer change ( 0 in case of insertion). + */ +public int getLength() { + return this.length; +} +/** + * Returns the index of the first character inserted, removed, or replaced + * in the buffer. + * + * @return the source offset of the textual manipulation in the buffer + */ +public int getOffset() { + return this.offset; +} +/** + * Returns the text that was inserted, the replacement text, + * or null if text has been removed. + * + * @return the text corresponding to the buffer change ( null + * in case of deletion). + */ +public String getText() { + return this.text; +} +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CompletionContext.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CompletionContext.java new file mode 100644 index 0000000..4bda771 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CompletionContext.java @@ -0,0 +1,238 @@ +/******************************************************************************* + * Copyright (c) 2005, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.wst.jsdt.internal.codeassist.InternalCompletionContext; +import org.eclipse.wst.jsdt.internal.codeassist.complete.CompletionOnJavadoc; + +/** + * Completion context. + * + * Represent the context in which the completion occurs. + *

+ * This class is not intended to be instantiated or subclassed by clients. + *

+ * + * @see CompletionRequestor#acceptContext(CompletionContext) + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public final class CompletionContext extends InternalCompletionContext { + + /** + * The completion token is unknown. + */ + public static final int TOKEN_KIND_UNKNOWN = 0; + + /** + * The completion token is a name. + */ + public static final int TOKEN_KIND_NAME = 1; + /** + * The completion token is a string literal. + * The string literal ends quote can be not present the source. + * "foo" or "foo. + */ + public static final int TOKEN_KIND_STRING_LITERAL = 2; + + /** + * Tell user whether completion takes place in a jsdoc comment or not. + * + * @return boolean true if completion takes place in a jsdoc comment, false otherwise. + */ + public boolean isInJsdoc() { + return this.javadoc != 0; + } + + /** + * Tell user whether completion takes place in text area of a jsdoc comment or not. + * + * @return boolean true if completion takes place in a text area of a jsdoc comment, false otherwise. + */ + public boolean isInJsdocText() { + return (this.javadoc & CompletionOnJavadoc.TEXT) != 0; + } + + /** + * Tell user whether completion takes place in a formal reference of a jsdoc tag or not. + * Tags with formal reference are: + *
    + *
  • @see
  • + *
  • @throws
  • + *
  • @exception
  • + *
  • {@link Object}
  • + *
  • {@linkplain Object}
  • + *
  • {@value} when compiler compliance is set at leats to 1.5
  • + *
+ * + * @return boolean true if completion takes place in formal reference of a jsdoc tag, false otherwise. + */ + public boolean isInJsdocFormalReference() { + return (this.javadoc & CompletionOnJavadoc.FORMAL_REFERENCE) != 0; + } + + /** + * Return signatures of expected types of a potential completion proposal at the completion position. + * + * It's not mandatory to a completion proposal to respect this expectation. + * + * @return signatures expected types of a potential completion proposal at the completion position or + * null if there is no expected types. + * + * @see Signature + */ + public char[][] getExpectedTypesSignatures() { + return this.expectedTypesSignatures; + } + /** + * Return keys of expected types of a potential completion proposal at the completion position. + * + * It's not mandatory to a completion proposal to respect this expectation. + * + * @return keys of expected types of a potential completion proposal at the completion position or + * null if there is no expected types. + * + * @see org.eclipse.wst.jsdt.core.dom.ASTParser#createASTs(IJavaScriptUnit[], String[], org.eclipse.wst.jsdt.core.dom.ASTRequestor, org.eclipse.core.runtime.IProgressMonitor) + */ + public char[][] getExpectedTypesKeys() { + return this.expectedTypesKeys; + } + + /** + * Returns the completed token. + * This token is either the identifier or JavaScript language keyword + * or the string literal under, immediately preceding, + * the original request offset. If the original request offset + * is not within or immediately after an identifier or keyword or + * a string literal then the returned value is null. + * + * @return completed token or null + */ + public char[] getToken() { + return this.token; + } + + /** + * Returns the kind of completion token being proposed. + *

+ * The set of different kinds of completion token is + * expected to change over time. It is strongly recommended + * that clients do not assume that the kind is one of the + * ones they know about, and code defensively for the + * possibility of unexpected future growth. + *

+ * + * @return the kind; one of the kind constants declared on + * this class whose name starts with TOKEN_KIND, + * or possibly a kind unknown to the caller + */ + public int getTokenKind() { + return this.tokenKind; + } + + /** + * Returns the character index of the start of the + * subrange in the source file buffer containing the + * relevant token being completed. This + * token is either the identifier or JavaScript language keyword + * under, or immediately preceding, the original request + * offset. If the original request offset is not within + * or immediately after an identifier or keyword, then the + * position returned is original request offset and the + * token range is empty. + * + * @return character index of token start position (inclusive) + */ + public int getTokenStart() { + return this.tokenStart; + } + + /** + * Returns the character index of the end (exclusive) of the subrange + * in the source file buffer containing the + * relevant token. When there is no relevant token, the + * range is empty + * (getTokenEnd() == getTokenStart() - 1). + * + * @return character index of token end position (exclusive) + */ + public int getTokenEnd() { + return this.tokenEnd; + } + + /** + * Returns the offset position in the source file buffer + * after which code assist is requested. + * + * @return offset position in the source file buffer + */ + public int getOffset() { + return this.offset; + } + + public String toString() { + StringBuffer buffer = new StringBuffer(); + + buffer.append("completion offset="); //$NON-NLS-1$ + buffer.append(this.offset); + buffer.append('\n'); + + buffer.append("completion range=["); //$NON-NLS-1$ + buffer.append(this.tokenStart); + buffer.append(", "); //$NON-NLS-1$ + buffer.append(this.tokenEnd); + buffer.append("]\n"); //$NON-NLS-1$ + + buffer.append("completion token="); //$NON-NLS-1$ + String string = "null"; //$NON-NLS-1$ + if(token == null) { + buffer.append(string); + } else { + buffer.append('\"'); + buffer.append(this.token); + buffer.append('\"'); + } + buffer.append('\n'); + + buffer.append("expectedTypesSignatures="); //$NON-NLS-1$ + if(this.expectedTypesSignatures == null) { + buffer.append(string); + } else { + buffer.append('{'); + for (int i = 0; i < this.expectedTypesSignatures.length; i++) { + if(i > 0) buffer.append(','); + buffer.append(this.expectedTypesSignatures[i]); + + } + buffer.append('}'); + } + buffer.append('\n'); + + buffer.append("expectedTypesKeys="); //$NON-NLS-1$ + if(expectedTypesSignatures == null) { + buffer.append(string); + } else { + buffer.append('{'); + for (int i = 0; i < this.expectedTypesKeys.length; i++) { + if(i > 0) buffer.append(','); + buffer.append(this.expectedTypesKeys[i]); + + } + buffer.append('}'); + } + buffer.append('\n'); + + return buffer.toString(); + } +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CompletionFlags.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CompletionFlags.java new file mode 100644 index 0000000..eda1d9e --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CompletionFlags.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (c) 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +/** + * Utility class for decoding additional flags in completion proposal. + *

+ * This class provides static methods only; it is not intended to be + * instantiated or subclassed by clients. + *

+ * + * @see CompletionProposal#getAdditionalFlags() + * + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public final class CompletionFlags { + /** + * Constant representing the absence of any flag + */ + public static final int Default = 0x0000; + + /** + * Not instantiable. + */ + private CompletionFlags() { + // Not instantiable + } +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CompletionProposal.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CompletionProposal.java new file mode 100644 index 0000000..2016b89 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CompletionProposal.java @@ -0,0 +1,2041 @@ +/******************************************************************************* + * Copyright (c) 2004, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.wst.jsdt.core.compiler.CharOperation; +import org.eclipse.wst.jsdt.internal.codeassist.InternalCompletionProposal; + +/** + * Completion proposal. + *

+ * In typical usage, the user working in a JavaScript code editor issues + * a code assist command. This command results in a call to + * ICodeAssist.codeComplete(position, completionRequestor) + * passing the current position in the source code. The code assist + * engine analyzes the code in the buffer, determines what kind of + * JavaScript language construct is at that position, and proposes ways + * to complete that construct. These proposals are instances of + * the class CompletionProposal. These proposals, + * perhaps after sorting and filtering, are presented to the user + * to make a choice. + *

+ *

+ * The proposal is as follows: insert + * the {@linkplain #getCompletion() completion string} into the + * source file buffer, replacing the characters between + * {@linkplain #getReplaceStart() the start} + * and {@linkplain #getReplaceEnd() end}. The string + * can be arbitrary; for example, it might include not only the + * name of a function but a set of parentheses. Moreover, the source + * range may include source positions before or after the source + * position where ICodeAssist.codeComplete was invoked. + * The rest of the information associated with the proposal is + * to provide context that may help a user to choose from among + * competing proposals. + *

+ *

+ * The completion engine creates instances of this class; it is not intended + * to be instantiated or subclassed by clients. + *

+ * + * @see ICodeAssist#codeComplete(int, CompletionRequestor) + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public final class CompletionProposal extends InternalCompletionProposal { + private boolean updateCompletion = false; + + /** + * Completion is a declaration of an anonymous class. + * This kind of completion might occur in a context like + * "new List^;" and complete it to + * "new List() {}". + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getDeclarationSignature()} - + * the type signature of the type being implemented or subclassed + *
  • + *
  • {@link #getDeclarationKey()} - + * the type unique key of the type being implemented or subclassed + *
  • + *
  • {@link #getSignature()} - + * the method signature of the constructor that is referenced + *
  • + *
  • {@link #getKey()} - + * the method unique key of the constructor that is referenced + * if the declaring type is not an interface + *
  • + *
  • {@link #getFlags()} - + * the modifiers flags of the constructor that is referenced + *
  • + *
+ *

+ * + * @see #getKind() + */ + public static final int ANONYMOUS_CLASS_DECLARATION = 1; + + /** + * Completion is a reference to a field. + * This kind of completion might occur in a context like + * "this.ref^ = 0;" and complete it to + * "this.refcount = 0;". + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getDeclarationSignature()} - + * the type signature of the type that declares the field that is referenced + *
  • + *
  • {@link #getFlags()} - + * the modifiers flags of the field that is referenced + *
  • + *
  • {@link #getName()} - + * the simple name of the field that is referenced + *
  • + *
  • {@link #getSignature()} - + * the type signature of the field's type (as opposed to the + * signature of the type in which the referenced field + * is declared) + *
  • + *
+ *

+ * + * @see #getKind() + */ + public static final int FIELD_REF = 2; + + /** + * Completion is a keyword. + * This kind of completion might occur in a context like + * "fu Foo {}" and complete it to + * "function Foo {}". + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getName()} - + * the keyword token + *
  • + *
  • {@link #getFlags()} - + * the corresponding modifier flags if the keyword is a modifier + *
  • + *
+ *

+ * + * @see #getKind() + */ + public static final int KEYWORD = 3; + + /** + * Completion is a reference to a label. + * This kind of completion might occur in a context like + * "break lo^;" and complete it to + * "break loop;". + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getName()} - + * the simple name of the label that is referenced + *
  • + *
+ *

+ * + * @see #getKind() + */ + public static final int LABEL_REF = 4; + + /** + * Completion is a reference to a local variable. + * This kind of completion might occur in a context like + * "ke^ = 4;" and complete it to + * "keys = 4;". + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getFlags()} - + * the modifiers flags of the local variable that is referenced + *
  • + *
  • {@link #getName()} - + * the simple name of the local variable that is referenced + *
  • + *
  • {@link #getSignature()} - + * the type signature of the local variable's type + *
  • + *
+ *

+ * + * @see #getKind() + */ + public static final int LOCAL_VARIABLE_REF = 5; + + /** + * Completion is a reference to a method. + * This kind of completion might occur in a context like + * "myObject.pr^();" and complete it to + * ""myObject.println();". + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getDeclarationSignature()} - + * the type signature of the type that declares the method that is referenced + *
  • + *
  • {@link #getFlags()} - + * the modifiers flags of the method that is referenced + *
  • + *
  • {@link #getName()} - + * the simple name of the method that is referenced + *
  • + *
  • {@link #getSignature()} - + * the method signature of the method that is referenced + *
  • + *
+ *

+ * + * @see #getKind() + */ + public static final int METHOD_REF = 6; + + /** + * Completion is a declaration of a function. + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getDeclarationSignature()} - + * the type signature of the type that declares the + * method that is being overridden or implemented + *
  • + *
  • {@link #getDeclarationKey()} - + * the unique of the type that declares the + * method that is being overridden or implemented + *
  • + *
  • {@link #getName()} - + * the simple name of the method that is being overridden + * or implemented + *
  • + *
  • {@link #getSignature()} - + * the method signature of the method that is being + * overridden or implemented + *
  • + *
  • {@link #getKey()} - + * the method unique key of the method that is being + * overridden or implemented + *
  • + *
  • {@link #getFlags()} - + * the modifiers flags of the method that is being + * overridden or implemented + *
  • + *
+ *

+ * + * @see #getKind() + */ + public static final int METHOD_DECLARATION = 7; + + /** + * Completion is a reference to a package. + * This kind of completion might occur in a context like + * "import java.u^.*;" and complete it to + * "import java.util.*;". + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getDeclarationSignature()} - + * the dot-based package name of the package that is referenced + *
  • + *
+ *

+ * + * This completion only applies to ECMAScript 4 which is not yet supported + * + * @see #getKind() + */ + public static final int PACKAGE_REF = 8; + + /** + * Completion is a reference to a type. + * This kind of completion might occur in a context like + * "var c=new Str^ ;" and complete it to + * "var c=new String ;". + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getDeclarationSignature()} - + *
  • + *
  • {@link #getSignature()} - + * the type signature of the type that is referenced + *
  • + *
  • {@link #getFlags()} - + * the modifiers flags (including Flags.AccInterface) of the type that is referenced + *
  • + *
+ *

+ * + * @see #getKind() + */ + public static final int TYPE_REF = 9; + + /** + * Completion is a declaration of a variable (locals, parameters, + * fields, etc.). + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getName()} - + * the simple name of the variable being declared + *
  • + *
  • {@link #getSignature()} - + * the type signature of the type of the variable + * being declared + *
  • + *
  • {@link #getFlags()} - + * the modifiers flags of the variable being declared + *
  • + *
+ *

+ * @see #getKind() + */ + public static final int VARIABLE_DECLARATION = 10; + + /** + * Completion is a declaration of a new potential function. + * This kind of completion might occur in a context like + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getDeclarationSignature()} - + * the type signature of the type that declares the + * method that is being created + *
  • + *
  • {@link #getName()} - + * the simple name of the method that is being created + *
  • + *
  • {@link #getSignature()} - + * the method signature of the method that is being + * created + *
  • + *
  • {@link #getFlags()} - + * the modifiers flags of the method that is being + * created + *
  • + *
+ *

+ * + * @see #getKind() + */ + public static final int POTENTIAL_METHOD_DECLARATION = 11; + + /** + * Completion is a reference to a function name. + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getDeclarationSignature()} - + * the type signature of the type that declares the method that is referenced + *
  • + *
  • {@link #getFlags()} - + * the modifiers flags of the method that is referenced + *
  • + *
  • {@link #getName()} - + * the simple name of the method that is referenced + *
  • + *
  • {@link #getSignature()} - + * the method signature of the method that is referenced + *
  • + *
+ *

+ * + * @see #getKind() + */ + public static final int METHOD_NAME_REFERENCE = 12; + + /** + * Completion is a link reference to a field in a JSdoc text. + * This kind of completion might occur in a context like + * " * blabla System.o^ blabla" and complete it to + * " * blabla {@link System#out } blabla". + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getDeclarationSignature()} - + * the type signature of the type that declares the field that is referenced + *
  • + *
  • {@link #getFlags()} - + * the modifiers flags (including ACC_ENUM) of the field that is referenced + *
  • + *
  • {@link #getName()} - + * the simple name of the field that is referenced + *
  • + *
  • {@link #getSignature()} - + * the type signature of the field's type (as opposed to the + * signature of the type in which the referenced field + * is declared) + *
  • + *
+ *

+ * + * @see #getKind() + */ + public static final int JSDOC_FIELD_REF = 14; + + /** + * Completion is a link reference to a function in a JSdoc text. + * This kind of completion might occur in a context like + * " * blabla Object#va^ blabla" and complete it to + * " * blabla {@link Object#valueOf() }". + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getDeclarationSignature()} - + * the type signature of the type that declares the method that is referenced + *
  • + *
  • {@link #getFlags()} - + * the modifiers flags of the method that is referenced + *
  • + *
  • {@link #getName()} - + * the simple name of the method that is referenced + *
  • + *
  • {@link #getSignature()} - + * the method signature of the method that is referenced + *
  • + *
+ *

+ * + * @see #getKind() + */ + public static final int JSDOC_METHOD_REF = 15; + + /** + * Completion is a link reference to a type in a JSdoc text. + * Any kind of type is allowed, including primitive types, reference types, + * array types, parameterized types, and type variables. + * This kind of completion might occur in a context like + * " * blabla Str^ blabla" and complete it to + * " * blabla {@link String } blabla". + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getDeclarationSignature()} - + * the dot-based package name of the package that contains + * the type that is referenced + *
  • + *
  • {@link #getSignature()} - + * the type signature of the type that is referenced + *
  • + *
  • {@link #getFlags()} - + * the modifiers flags of the type that is referenced + *
  • + *
+ *

+ * + * @see #getKind() + */ + public static final int JSDOC_TYPE_REF = 16; + + /** + * Completion is a method argument or a class/method type parameter + * in JSdoc param tag. + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getDeclarationSignature()} - + * the type signature of the type that declares the field that is referenced + *
  • + *
  • {@link #getFlags()} - + * the modifiers flags (including ACC_ENUM) of the field that is referenced + *
  • + *
  • {@link #getName()} - + * the simple name of the field that is referenced + *
  • + *
  • {@link #getSignature()} - + * the type signature of the field's type (as opposed to the + * signature of the type in which the referenced field + * is declared) + *
  • + *
+ *

+ * + * This field only applies to ECMAScript 4 which is not yet supported + * + * @see #getKind() + */ + public static final int JSDOC_PARAM_REF = 18; + + /** + * Completion is a JSdoc block tag. + * This kind of completion might occur in a context like + * " * @s^ blabla" and complete it to + * " * @see blabla". + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getDeclarationSignature()} - + * the type signature of the type that declares the field that is referenced + *
  • + *
  • {@link #getFlags()} - + * the modifiers flags of the field that is referenced + *
  • + *
  • {@link #getName()} - + * the simple name of the field that is referenced + *
  • + *
  • {@link #getSignature()} - + * the type signature of the field's type (as opposed to the + * signature of the type in which the referenced field + * is declared) + *
  • + *
+ *

+ * + * @see #getKind() + */ + public static final int JSDOC_BLOCK_TAG = 19; + + /** + * Completion is a JSdoc inline tag. + * This kind of completion might occur in a context like + * " * Insert @l^ Object" and complete it to + * " * Insert {@link Object }". + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getDeclarationSignature()} - + * the type signature of the type that declares the field that is referenced + *
  • + *
  • {@link #getFlags()} - + * the modifiers flags of the field that is referenced + *
  • + *
  • {@link #getName()} - + * the simple name of the field that is referenced + *
  • + *
  • {@link #getSignature()} - + * the type signature of the field's type (as opposed to the + * signature of the type in which the referenced field + * is declared) + *
  • + *
+ *

+ * + * @see #getKind() + */ + public static final int JSDOC_INLINE_TAG = 20; + + /** + * Completion is an import of reference to a static field. + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getDeclarationSignature()} - + * the type signature of the type that declares the field that is imported + *
  • + *
  • {@link #getFlags()} - + * the modifiers flags (including ACC_ENUM) of the field that is imported + *
  • + *
  • {@link #getName()} - + * the simple name of the field that is imported + *
  • + *
  • {@link #getSignature()} - + * the type signature of the field's type (as opposed to the + * signature of the type in which the referenced field + * is declared) + *
  • + *
  • {@link #getAdditionalFlags()} - + * the completion flags (including ComletionFlags.StaticImport) + * of the proposed import + *
  • + *
+ *

+ * + * @see #getKind() + * + */ + public static final int FIELD_IMPORT = 21; + + /** + * Completion is an import of reference to a static method. + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getDeclarationSignature()} - + * the type signature of the type that declares the method that is imported + *
  • + *
  • {@link #getFlags()} - + * the modifiers flags of the method that is imported + *
  • + *
  • {@link #getName()} - + * the simple name of the method that is imported + *
  • + *
  • {@link #getSignature()} - + * the method signature of the method that is imported + *
  • + *
  • {@link #getAdditionalFlags()} - + * the completion flags (including ComletionFlags.StaticImport) + * of the proposed import + *
  • + *
+ *

+ * + * @see #getKind() + * + */ + public static final int METHOD_IMPORT = 22; + + /** + * Completion is an import of reference to a type. + * Only reference to reference types are allowed. + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getDeclarationSignature()} - + * the dot-based package name of the package that contains + * the type that is imported + *
  • + *
  • {@link #getSignature()} - + * the type signature of the type that is imported + *
  • + *
  • {@link #getFlags()} - + * the modifiers flags (including Flags.AccInterface, AccEnum, + * and AccAnnotation) of the type that is imported + *
  • + *
  • {@link #getAdditionalFlags()} - + * the completion flags (including ComletionFlags.StaticImport) + * of the proposed import + *
  • + *
+ *

+ * + * @see #getKind() + * + */ + public static final int TYPE_IMPORT = 23; + + /** + * Completion is a reference to a constructor. + * This kind of completion might occur in a context like + * "new Lis" and complete it to + * "new List();" if List is a class that is not abstract. + *

+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *

    + *
  • {@link #getDeclarationSignature()} - + * the type signature of the type that declares the constructor that is referenced + *
  • + *
  • {@link #getFlags()} - + * the modifiers flags of the constructor that is referenced + *
  • + *
  • {@link #getName()} - + * the simple name of the constructor that is referenced + *
  • + *
  • {@link #getSignature()} - + * the method signature of the constructor that is referenced + *
  • + *
+ *

+ *

+ * This kind of proposal could require a long computation, so they are computed only if completion operation is called with a {@link IProgressMonitor} + * (e.g. {@link ICodeAssist#codeComplete(int, CompletionRequestor, IProgressMonitor)}).
+ * This kind of proposal is always is only proposals with a {@link #TYPE_REF} required proposal, so this kind of required proposal must be allowed: + * requestor.setAllowsRequiredProposals(CONSTRUCTOR_INVOCATION, TYPE_REF, true). + *

+ * + * @see #getKind() + * @see CompletionRequestor#setAllowsRequiredProposals(int, int, boolean) + */ + public static final int CONSTRUCTOR_INVOCATION = 26; + + /** + * First valid completion kind. + * + */ + protected static final int FIRST_KIND = ANONYMOUS_CLASS_DECLARATION; + + /** + * Last valid completion kind. + * + */ + protected static final int LAST_KIND = CONSTRUCTOR_INVOCATION; + + /** + * Kind of completion request. + */ + private int completionKind; + + /** + * Offset in original buffer where ICodeAssist.codeComplete() was + * requested. + */ + private int completionLocation; + + /** + * Start position (inclusive) of source range in original buffer + * containing the relevant token + * defaults to empty subrange at [0,0). + */ + private int tokenStart = 0; + + /** + * End position (exclusive) of source range in original buffer + * containing the relevant token; + * defaults to empty subrange at [0,0). + */ + private int tokenEnd = 0; + + /** + * Completion string; defaults to empty string. + */ + private char[] completion = CharOperation.NO_CHAR; + + /** + * Start position (inclusive) of source range in original buffer + * to be replaced by completion string; + * defaults to empty subrange at [0,0). + */ + private int replaceStart = 0; + + /** + * End position (exclusive) of source range in original buffer + * to be replaced by completion string; + * defaults to empty subrange at [0,0). + */ + private int replaceEnd = 0; + + /** + * Relevance rating; positive; higher means better; + * defaults to minimum rating. + */ + private int relevance = 1; + + /** + * Signature of the relevant package or type declaration + * in the context, or null if none. + * Defaults to null. + */ + private char[] declarationSignature = null; + + /** + * Unique key of the relevant package or type declaration + * in the context, or null if none. + * Defaults to null. + */ + private char[] declarationKey = null; + + /** + * Simple name of the method, field, + * member, or variable relevant in the context, or + * null if none. + * Defaults to null. + */ + private char[] name = null; + + /** + * Signature of the function, field type, member type, + * relevant in the context, or null if none. + * Defaults to null. + */ + private char[] signature = null; + + /** + * Unique of the function, field type, member type, + * relevant in the context, or null if none. + * Defaults to null. + */ + private char[] key = null; + + /** + * Array of required completion proposals, or null if none. + * The proposal can not be applied if the required proposals aren't applied. + * Defaults to null. + */ + private CompletionProposal[] requiredProposals; + + /** + * Modifier flags relevant in the context, or + * Flags.AccDefault if none. + * Defaults to Flags.AccDefault. + */ + private int flags = Flags.AccDefault; + + /** + * Completion flags relevant in the context, or + * CompletionFlags.Default if none. + * Defaults to CompletionFlags.Default. + */ + private int additionalFlags = CompletionFlags.Default; + + /** + * Parameter names (for method completions), or + * null if none. Lazily computed. + * Defaults to null. + */ + private char[][] parameterNames = null; + + /** + * Indicates whether parameter names have been computed. + */ + private boolean parameterNamesComputed = false; + + /** + * Indicates the start offset of local variable declaration + */ + private int sourceStart = -1; + /** + * Indicates the end offset of local variable declaration + */ + private int sourceEnd = -1; + + /** + * Creates a basic completion proposal. All instance + * field have plausible default values unless otherwise noted. + *

+ * Note that the constructors for this class are internal to the + * JavaScript model implementation. Clients cannot directly create + * CompletionProposal objects. + *

+ * + * @param kind one of the kind constants declared on this class + * @param completionOffset original offset of code completion request + * @return a new completion proposal + */ + public static CompletionProposal create(int kind, int completionOffset) { + return new CompletionProposal(kind, completionOffset); + } + + /** + * Creates a basic completion proposal. All instance + * field have plausible default values unless otherwise noted. + *

+ * Note that the constructors for this class are internal to the + * JavaScript model implementation. Clients cannot directly create + * CompletionProposal objects. + *

+ * + * @param kind one of the kind constants declared on this class + * @param completionLocation original offset of code completion request + */ + CompletionProposal(int kind, int completionLocation) { + if ((kind < CompletionProposal.FIRST_KIND) + || (kind > CompletionProposal.LAST_KIND)) { + throw new IllegalArgumentException(); + } + if (this.completion == null || completionLocation < 0) { + // Work around for bug 132558 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=132558). + // completionLocation can be -1 if the completion occur at the start of a file or + // the start of a code snippet but this API isn't design to support negative position. + if(this.completion == null || completionLocation != -1) { + throw new IllegalArgumentException(); + } + completionLocation = 0; + } + this.completionKind = kind; + this.completionLocation = completionLocation; + } + + /** + * Returns the completion flags relevant in the context, or + * CompletionFlags.Default if none. + *

+ * This field is available for the following kinds of + * completion proposals: + *

    + *
  • FIELD_IMPORT - completion flags + * of the attribute that is referenced. Completion flags for + * this proposal kind can only include CompletionFlags.StaticImport
  • + *
  • METHOD_IMPORT - completion flags + * of the attribute that is referenced. Completion flags for + * this proposal kind can only include CompletionFlags.StaticImport
  • + *
  • TYPE_IMPORT - completion flags + * of the attribute that is referenced. Completion flags for + * this proposal kind can only include CompletionFlags.StaticImport
  • + *
+ * For other kinds of completion proposals, this method returns + * CompletionFlags.Default. + *

+ * + * @return the completion flags, or + * CompletionFlags.Default if none + * @see CompletionFlags + * + */ + public int getAdditionalFlags() { + return this.additionalFlags; + } + + /** + * Sets the completion flags relevant in the context. + *

+ * If not set, defaults to none. + *

+ *

+ * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + *

+ * + * @param additionalFlags the completion flags, or + * CompletionFlags.Default if none + * + */ + public void setAdditionalFlags(int additionalFlags) { + this.additionalFlags = additionalFlags; + } + + /** + * Returns the kind of completion being proposed. + *

+ * The set of different kinds of completion proposals is + * expected to change over time. It is strongly recommended + * that clients do not assume that the kind is one of the + * ones they know about, and code defensively for the + * possibility of unexpected future growth. + *

+ * + * @return the kind; one of the kind constants + * declared on this class, or possibly a kind unknown + * to the caller + */ + public int getKind() { + return this.completionKind; + } + + /** + * Returns the character index in the source file buffer + * where source completion was requested (the + * offset parameter to + * ICodeAssist.codeComplete minus one). + * + * @return character index in source file buffer + * @see ICodeAssist#codeComplete(int,CompletionRequestor) + */ + // TODO (david) https://bugs.eclipse.org/bugs/show_bug.cgi?id=132558 + public int getCompletionLocation() { + return this.completionLocation; + } + + /** + * Returns the character index of the start of the + * subrange in the source file buffer containing the + * relevant token being completed. This + * token is either the identifier or JavaScript language keyword + * under, or immediately preceding, the original request + * offset. If the original request offset is not within + * or immediately after an identifier or keyword, then the + * position returned is original request offset and the + * token range is empty. + * + * @return character index of token start position (inclusive) + */ + public int getTokenStart() { + return this.tokenStart; + } + + /** + * Returns the character index of the end (exclusive) of the subrange + * in the source file buffer containing the + * relevant token. When there is no relevant token, the + * range is empty + * (getEndToken() == getStartToken()). + * + * @return character index of token end position (exclusive) + */ + public int getTokenEnd() { + return this.tokenEnd; + } + + /** + * Sets the character indices of the subrange in the + * source file buffer containing the relevant token being + * completed. This token is either the identifier or + * JavaScript language keyword under, or immediately preceding, + * the original request offset. If the original request + * offset is not within or immediately after an identifier + * or keyword, then the source range begins at original + * request offset and is empty. + *

+ * If not set, defaults to empty subrange at [0,0). + *

+ * + * @param startIndex character index of token start position (inclusive) + * @param endIndex character index of token end position (exclusive) + */ + public void setTokenRange(int startIndex, int endIndex) { + if (startIndex < 0 || endIndex < startIndex) { + throw new IllegalArgumentException(); + } + this.tokenStart = startIndex; + this.tokenEnd = endIndex; + } + + /** + * Returns the proposed sequence of characters to insert into the + * source file buffer, replacing the characters at the specified + * source range. The string can be arbitrary; for example, it might + * include not only the name of a method but a set of parentheses. + *

+ * The client must not modify the array returned. + *

+ * + * @return the completion string + */ + public char[] getCompletion() { + if(this.completionKind == METHOD_DECLARATION) { + this.findParameterNames(null); + if(this.updateCompletion) { + this.updateCompletion = false; + + if(this.parameterNames != null) { + int length = this.parameterNames.length; + StringBuffer completionBuffer = new StringBuffer(this.completion.length); + + int start = 0; + int end = CharOperation.indexOf('%', this.completion); + + completionBuffer.append(this.completion, start, end - start); + + for(int i = 0 ; i < length ; i++){ + completionBuffer.append(this.parameterNames[i]); + start = end + 1; + end = CharOperation.indexOf('%', this.completion, start); + if(end > -1){ + completionBuffer.append(this.completion, start, end - start); + } else { + completionBuffer.append(this.completion, start, this.completion.length - start); + } + } + int nameLength = completionBuffer.length(); + this.completion = new char[nameLength]; + completionBuffer.getChars(0, nameLength, this.completion, 0); + } + } + } + return this.completion; + } + + /** + * Sets the proposed sequence of characters to insert into the + * source file buffer, replacing the characters at the specified + * source range. The string can be arbitrary; for example, it might + * include not only the name of a method but a set of parentheses. + *

+ * If not set, defaults to an empty character array. + *

+ *

+ * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + *

+ * + * @param completion the completion string + */ + public void setCompletion(char[] completion) { + this.completion = completion; + } + + /** + * Returns the character index of the start of the + * subrange in the source file buffer to be replaced + * by the completion string. If the subrange is empty + * (getReplaceEnd() == getReplaceStart()), + * the completion string is to be inserted at this + * index. + *

+ * Note that while the token subrange is precisely + * specified, the replacement range is loosely + * constrained and may not bear any direct relation + * to the original request offset. For example, + * it would be possible for a type completion to + * propose inserting an import declaration at the + * top of the compilation unit; or the completion + * might include trailing parentheses and + * punctuation for a method completion. + *

+ * + * @return replacement start position (inclusive) + */ + public int getReplaceStart() { + return this.replaceStart; + } + + /** + * Returns the character index of the end of the + * subrange in the source file buffer to be replaced + * by the completion string. If the subrange is empty + * (getReplaceEnd() == getReplaceStart()), + * the completion string is to be inserted at this + * index. + * + * @return replacement end position (exclusive) + */ + public int getReplaceEnd() { + return this.replaceEnd; + } + + /** + * Sets the character indices of the subrange in the + * source file buffer to be replaced by the completion + * string. If the subrange is empty + * (startIndex == endIndex), + * the completion string is to be inserted at this + * index. + *

+ * If not set, defaults to empty subrange at [0,0). + *

+ *

+ * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + *

+ * + * @param startIndex character index of replacement start position (inclusive) + * @param endIndex character index of replacement end position (exclusive) + */ + public void setReplaceRange(int startIndex, int endIndex) { + if (startIndex < 0 || endIndex < startIndex) { + throw new IllegalArgumentException(); + } + this.replaceStart = startIndex; + this.replaceEnd = endIndex; + } + + /** + * Returns the relative relevance rating of this proposal. + * + * @return relevance rating of this proposal; ratings are positive; higher means better + */ + public int getRelevance() { + return this.relevance; + } + + /** + * Sets the relative relevance rating of this proposal. + *

+ * If not set, defaults to the lowest possible rating (1). + *

+ *

+ * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + *

+ * + * @param rating relevance rating of this proposal; ratings are positive; higher means better + */ + public void setRelevance(int rating) { + if (rating <= 0) { + throw new IllegalArgumentException(); + } + this.relevance = rating; + } + + /** + * Returns the type signature of the relevant + * declaration in the context, or null if none. + *

+ * This field is available for the following kinds of + * completion proposals: + *

    + *
  • ANNOTATION_ATTRIBUT_REF - type signature + * of the annotation that declares the attribute that is referenced
  • + *
  • ANONYMOUS_CLASS_DECLARATION - type signature + * of the type that is being subclassed or implemented
  • + *
  • FIELD_IMPORT - type signature + * of the type that declares the field that is imported
  • + *
  • FIELD_REF - type signature + * of the type that declares the field that is referenced
  • + *
  • METHOD_IMPORT - type signature + * of the type that declares the method that is imported
  • + *
  • FUNCTION_REF - type signature + * of the type that declares the method that is referenced
  • + *
  • FUNCTION_DECLARATION - type signature + * of the type that declares the method that is being + * implemented or overridden
  • + *
  • PACKAGE_REF - dot-based package + * name of the package that is referenced
  • + *
  • TYPE_IMPORT - dot-based package + * name of the package containing the type that is imported
  • + *
  • TYPE_REF - dot-based package + * name of the package containing the type that is referenced
  • + *
  • POTENTIAL_METHOD_DECLARATION - type signature + * of the type that declares the method that is being created
  • + *
+ * For kinds of completion proposals, this method returns + * null. Clients must not modify the array + * returned. + *

+ * + * @return a type signature or a package name (depending + * on the kind of completion), or null if none + * @see Signature + */ + public char[] getDeclarationSignature() { + return this.declarationSignature; + } + + /** + * Returns the key of the relevant + * declaration in the context, or null if none. + *

+ * This field is available for the following kinds of + * completion proposals: + *

    + *
  • ANONYMOUS_CLASS_DECLARATION - key + * of the type that is being subclassed or implemented
  • + *
  • FUNCTION_DECLARATION - key + * of the type that declares the method that is being + * implemented or overridden
  • + *
+ * For kinds of completion proposals, this method returns + * null. Clients must not modify the array + * returned. + *

+ * + * @return a key, or null if none + * @see org.eclipse.wst.jsdt.core.dom.ASTParser#createASTs(IJavaScriptUnit[], String[], org.eclipse.wst.jsdt.core.dom.ASTRequestor, IProgressMonitor) + */ + public char[] getDeclarationKey() { + return this.declarationKey; + } + + /** + * Sets the type signature of the relevant + * declaration in the context, or null if none. + *

+ * If not set, defaults to none. + *

+ *

+ * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + *

+ * + * @param signature the type or package signature, or + * null if none + */ + public void setDeclarationSignature(char[] signature) { + this.declarationSignature = signature; + } + + /** + * Sets the type key of the relevant + * declaration in the context, or null if none. + *

+ * If not set, defaults to none. + *

+ *

+ * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + *

+ * + * @param key the type or package key, or + * null if none + */ + public void setDeclarationKey(char[] key) { + this.declarationKey = key; + } + + /** + * Returns the simple name of the function, field, + * member, or variable relevant in the context, or + * null if none. + *

+ * This field is available for the following kinds of + * completion proposals: + *

    + *
  • ANNOTATION_ATTRIBUT_REF - the name of the attribute
  • + *
  • FIELD_IMPORT - the name of the field
  • + *
  • FIELD_REF - the name of the field
  • + *
  • KEYWORD - the keyword
  • + *
  • LABEL_REF - the name of the label
  • + *
  • LOCAL_VARIABLE_REF - the name of the local variable
  • + *
  • METHOD_IMPORT - the name of the method
  • + *
  • FUNCTION_REF - the name of the method (the type simple name for constructor)
  • + *
  • FUNCTION_DECLARATION - the name of the method (the type simple name for constructor)
  • + *
  • VARIABLE_DECLARATION - the name of the variable
  • + *
  • POTENTIAL_METHOD_DECLARATION - the name of the method
  • + *
+ * For kinds of completion proposals, this method returns + * null. Clients must not modify the array + * returned. + *

+ * + * @return the keyword, field, method, local variable, or member + * name, or null if none + */ + public char[] getName() { + return this.name; + } + + + /** + * Sets the simple name of the method (type simple name for constructor), field, + * member, or variable relevant in the context, or + * null if none. + *

+ * If not set, defaults to none. + *

+ *

+ * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + *

+ * + * @param name the keyword, field, method, local variable, + * or member name, or null if none + */ + public void setName(char[] name) { + this.name = name; + } + + /** + * Returns the signature of the method or type + * relevant in the context, or null if none. + *

+ * This field is available for the following kinds of + * completion proposals: + *

    + *
  • ANNOTATION_ATTRIBUT_REF - the type signature + * of the referenced attribute's type
  • + *
  • ANONYMOUS_CLASS_DECLARATION - method signature + * of the constructor that is being invoked
  • + *
  • FIELD_IMPORT - the type signature + * of the referenced field's type
  • + *
  • FIELD_REF - the type signature + * of the referenced field's type
  • + *
  • LOCAL_VARIABLE_REF - the type signature + * of the referenced local variable's type
  • + *
  • METHOD_IMPORT - method signature + * of the method that is imported
  • + *
  • FUNCTION_REF - method signature + * of the method that is referenced
  • + *
  • FUNCTION_DECLARATION - method signature + * of the method that is being implemented or overridden
  • + *
  • TYPE_IMPORT - type signature + * of the type that is imported
  • + *
  • TYPE_REF - type signature + * of the type that is referenced
  • + *
  • VARIABLE_DECLARATION - the type signature + * of the type of the variable being declared
  • + *
  • POTENTIAL_METHOD_DECLARATION - method signature + * of the method that is being created
  • + *
+ * For kinds of completion proposals, this method returns + * null. Clients must not modify the array + * returned. + *

+ * + * @return the signature, or null if none + * @see Signature + */ + public char[] getSignature() { + return this.signature; + } + + /** + * Returns the key relevant in the context, + * or null if none. + *

+ * This field is available for the following kinds of + * completion proposals: + *

    + *
  • ANONYMOUS_CLASS_DECLARATION - method key + * of the constructor that is being invoked, or null if + * the declaring type is an interface
  • + *
  • FUNCTION_DECLARATION - method key + * of the method that is being implemented or overridden
  • + *
+ * For kinds of completion proposals, this method returns + * null. Clients must not modify the array + * returned. + *

+ * + * @return the key, or null if none + * @see org.eclipse.wst.jsdt.core.dom.ASTParser#createASTs(IJavaScriptUnit[], String[], org.eclipse.wst.jsdt.core.dom.ASTRequestor, IProgressMonitor) + */ + public char[] getKey() { + return this.key; + } + +// /** +// * Returns the package name of the relevant +// * declaration in the context, or null if none. +// *

+// * This field is available for the following kinds of +// * completion proposals: +// *

    +// *
  • ANONYMOUS_CLASS_DECLARATION - the dot-based package name +// * of the type that is being subclassed or implemented
  • +// *
  • FIELD_REF - the dot-based package name +// * of the type that declares the field that is referenced
  • +// *
  • FUNCTION_REF - the dot-based package name +// * of the type that declares the method that is referenced
  • +// *
  • FUNCTION_DECLARATION - the dot-based package name +// * of the type that declares the method that is being +// * implemented or overridden
  • +// *
+// * For kinds of completion proposals, this method returns +// * null. Clients must not modify the array +// * returned. +// *

+// * +// * @return the dot-based package name, or +// * null if none +// * @see #getDeclarationSignature() +// * @see #getSignature() +// * +// */ +// public char[] getDeclarationPackageName() { +// return this.declarationPackageName; +// } +// +// /** +// * Returns the type name of the relevant +// * declaration in the context without the package fragment, +// * or null if none. +// *

+// * This field is available for the following kinds of +// * completion proposals: +// *

    +// *
  • ANONYMOUS_CLASS_DECLARATION - the dot-based type name +// * of the type that is being subclassed or implemented
  • +// *
  • FIELD_REF - the dot-based type name +// * of the type that declares the field that is referenced +// * or an anonymous type instantiation ("new X(){}") if it is an anonymous type
  • +// *
  • FUNCTION_REF - the dot-based type name +// * of the type that declares the method that is referenced +// * or an anonymous type instantiation ("new X(){}") if it is an anonymous type
  • +// *
  • FUNCTION_DECLARATION - the dot-based type name +// * of the type that declares the method that is being +// * implemented or overridden
  • +// *
+// * For kinds of completion proposals, this method returns +// * null. Clients must not modify the array +// * returned. +// *

+// * +// * @return the dot-based package name, or +// * null if none +// * @see #getDeclarationSignature() +// * @see #getSignature() +// * +// */ + public char[] getDeclarationTypeName() { + return this.declarationTypeName; + } +// +// /** +// * Returns the package name of the method or type +// * relevant in the context, or null if none. +// *

+// * This field is available for the following kinds of +// * completion proposals: +// *

    +// *
  • FIELD_REF - the dot-based package name +// * of the referenced field's type
  • +// *
  • LOCAL_VARIABLE_REF - the dot-based package name +// * of the referenced local variable's type
  • +// *
  • FUNCTION_REF - the dot-based package name +// * of the return type of the method that is referenced
  • +// *
  • FUNCTION_DECLARATION - the dot-based package name +// * of the return type of the method that is being implemented +// * or overridden
  • +// *
  • PACKAGE_REF - the dot-based package name +// * of the package that is referenced
  • +// *
  • TYPE_REF - the dot-based package name +// * of the type that is referenced
  • +// *
  • VARIABLE_DECLARATION - the dot-based package name +// * of the type of the variable being declared
  • +// *
+// * For kinds of completion proposals, this method returns +// * null. Clients must not modify the array +// * returned. +// *

+// * +// * @return the package name, or null if none +// * +// * @see #getDeclarationSignature() +// * @see #getSignature() +// * +// */ +// public char[] getPackageName() { +// return this.packageName; +// } +// +// /** +// * Returns the type name without the package fragment of the method or type +// * relevant in the context, or null if none. +// *

+// * This field is available for the following kinds of +// * completion proposals: +// *

    +// *
  • FIELD_REF - the dot-based type name +// * of the referenced field's type
  • +// *
  • LOCAL_VARIABLE_REF - the dot-based type name +// * of the referenced local variable's type
  • +// *
  • FUNCTION_REF - the dot-based type name +// * of the return type of the method that is referenced
  • +// *
  • FUNCTION_DECLARATION - the dot-based type name +// * of the return type of the method that is being implemented +// * or overridden
  • +// *
  • TYPE_REF - the dot-based type name +// * of the type that is referenced
  • +// *
  • VARIABLE_DECLARATION - the dot-based package name +// * of the type of the variable being declared
  • +// *
+// * For kinds of completion proposals, this method returns +// * null. Clients must not modify the array +// * returned. +// *

+// * +// * @return the package name, or null if none +// * +// * @see #getDeclarationSignature() +// * @see #getSignature() +// * +// */ +// public char[] getTypeName() { +// return this.typeName; +// } +// +// /** +// * Returns the parameter package names of the method +// * relevant in the context, or null if none. +// *

+// * This field is available for the following kinds of +// * completion proposals: +// *

    +// *
  • ANONYMOUS_CLASS_DECLARATION - parameter package names +// * of the constructor that is being invoked
  • +// *
  • FUNCTION_REF - parameter package names +// * of the method that is referenced
  • +// *
  • FUNCTION_DECLARATION - parameter package names +// * of the method that is being implemented or overridden
  • +// *
+// * For kinds of completion proposals, this method returns +// * null. Clients must not modify the array +// * returned. +// *

+// * +// * @return the package name, or null if none +// * +// * @see #getDeclarationSignature() +// * @see #getSignature() +// * +// */ +// public char[][] getParameterPackageNames() { +// return this.parameterPackageNames; +// } +// +// /** +// * Returns the parameter type names without the package fragment of +// * the method relevant in the context, or null if none. +// *

+// * This field is available for the following kinds of +// * completion proposals: +// *

    +// *
  • ANONYMOUS_CLASS_DECLARATION - parameter type names +// * of the constructor that is being invoked
  • +// *
  • FUNCTION_REF - parameter type names +// * of the method that is referenced
  • +// *
  • FUNCTION_DECLARATION - parameter type names +// * of the method that is being implemented or overridden
  • +// *
+// * For kinds of completion proposals, this method returns +// * null. Clients must not modify the array +// * returned. +// *

+// * +// * @return the package name, or null if none +// * +// * @see #getDeclarationSignature() +// * @see #getSignature() +// * +// */ +// public char[][] getParameterTypeNames() { +// return this.parameterTypeNames; +// } + + /** + * Sets the signature of the function, method, field type, member type, + * relevant in the context, or null if none. + *

+ * If not set, defaults to none. + *

+ *

+ * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + *

+ * + * @param signature the signature, or null if none + */ + public void setSignature(char[] signature) { + this.signature = signature; + } + + /** + * Sets the key of the method, field type, member type, + * relevant in the context, or null if none. + *

+ * If not set, defaults to none. + *

+ *

+ * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + *

+ * + * @param key the key, or null if none + */ + public void setKey(char[] key) { + this.key = key; + } + + /** + * Returns the modifier flags relevant in the context, or + * Flags.AccDefault if none. + *

+ * This field is available for the following kinds of + * completion proposals: + *

    + *
  • ANNOTATION_ATTRIBUT_REF - modifier flags + * of the attribute that is referenced; + *
  • ANONYMOUS_CLASS_DECLARATION - modifier flags + * of the constructor that is referenced
  • + *
  • FIELD_IMPORT - modifier flags + * of the field that is imported.
  • + *
  • FIELD_REF - modifier flags + * of the field that is referenced; + * Flags.AccEnum can be used to recognize + * references to enum constants + *
  • + *
  • KEYWORD - modifier flag + * corresponding to the modifier keyword
  • + *
  • LOCAL_VARIABLE_REF - modifier flags + * of the local variable that is referenced
  • + *
  • METHOD_IMPORT - modifier flags + * of the method that is imported; + *
  • + *
  • FUNCTION_REF - modifier flags + * of the method that is referenced; + * Flags.AccAnnotation can be used to recognize + * references to annotation type members + *
  • + *
  • FUNCTION_DECLARATION - modifier flags + * for the method that is being implemented or overridden
  • + *
  • TYPE_IMPORT - modifier flags + * of the type that is imported; Flags.AccInterface + * can be used to recognize references to interfaces, + * Flags.AccEnum enum types, + * and Flags.AccAnnotation annotation types
  • + *
  • TYPE_REF - modifier flags + * of the type that is referenced; Flags.AccInterface + * can be used to recognize references to interfaces, + * Flags.AccEnum enum types, + * and Flags.AccAnnotation annotation types + *
  • + *
  • VARIABLE_DECLARATION - modifier flags + * for the variable being declared
  • + *
  • POTENTIAL_METHOD_DECLARATION - modifier flags + * for the method that is being created
  • + *
+ * For other kinds of completion proposals, this method returns + * Flags.AccDefault. + *

+ * + * @return the modifier flags, or + * Flags.AccDefault if none + * @see Flags + */ + public int getFlags() { + return this.flags; + } + + /** + * Sets the modifier flags relevant in the context. + *

+ * If not set, defaults to none. + *

+ *

+ * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + *

+ * + * @param flags the modifier flags, or + * Flags.AccDefault if none + */ + public void setFlags(int flags) { + this.flags = flags; + } + + /** + * Returns the required completion proposals. + * The proposal can be apply only if these required completion proposals are also applied. + * If the required proposal aren't applied the completion could create completion problems. + * + *

+ * This field is available for the following kinds of + * completion proposals: + *

    + *
  • FIELD_REF - The allowed required proposals for this kind are: + *
      + *
    • TYPE_REF
    • + *
    • TYPE_IMPORT
    • + *
    • FIELD_IMPORT
    • + *
    + *
  • + *
  • FUNCTION_REF - The allowed required proposals for this kind are: + *
      + *
    • TYPE_REF
    • + *
    • TYPE_IMPORT
    • + *
    • METHOD_IMPORT
    • + *
    + *
  • + *
+ *

+ *

+ * Other kinds of required proposals will be returned in the future, therefore clients of this + * API must allow with {@link CompletionRequestor#setAllowsRequiredProposals(int, int, boolean)} + * only kinds which are in this list to avoid unexpected results in the future. + *

+ *

+ * A required completion proposal cannot have required completion proposals. + *

+ * + * @return the required completion proposals, or null if none. + * + * @see CompletionRequestor#setAllowsRequiredProposals(int, int,boolean) + * + */ + public CompletionProposal[] getRequiredProposals() { + return this.requiredProposals; + } + + + /** + * Sets the list of required completion proposals, or null if none. + *

+ * If not set, defaults to none. + *

+ *

+ * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + *

+ * + * @param proposals the list of required completion proposals, or + * null if none + */ + public void setRequiredProposals(CompletionProposal[] proposals) { + this.requiredProposals = proposals; + } + + /** + * Finds the method or function parameter names. + * This information is relevant to method reference (and + * method declaration proposals). Returns null + * if not available or not relevant. + *

+ * The client must not modify the array returned. + *

+ *

+ * Note that this is an expensive thing to compute, which may require + * parsing JavaScript source files, etc. Use sparingly. + *

+ * + * @param monitor the progress monitor, or null if none + * @return the parameter names, or null if none + * or not available or not relevant + */ + public char[][] findParameterNames(IProgressMonitor monitor) { + if (!this.parameterNamesComputed) { + this.parameterNamesComputed = true; + + switch(this.completionKind) { + case ANONYMOUS_CLASS_DECLARATION: + try { + this.parameterNames = this.findMethodParameterNames( + this.declarationPackageName, + this.declarationTypeName, + CharOperation.lastSegment(this.declarationTypeName, '.'), + Signature.getParameterTypes(this.originalSignature == null ? this.signature : this.originalSignature)); + } catch(IllegalArgumentException e) { + // protection for invalid signature + if(this.parameterTypeNames != null) { + this.parameterNames = this.createDefaultParameterNames(this.parameterTypeNames.length); + } else { + this.parameterNames = null; + } + } + break; + case METHOD_REF: + try { + this.parameterNames = this.findMethodParameterNames( + this.declarationPackageName, + this.declarationTypeName, + this.name, + Signature.getParameterTypes(this.originalSignature == null ? this.signature : this.originalSignature)); + } catch(IllegalArgumentException e) { + // protection for invalid signature + if(this.parameterTypeNames != null) { + this.parameterNames = this.createDefaultParameterNames(this.parameterTypeNames.length); + } else { + this.parameterNames = null; + } + } + break; + case METHOD_DECLARATION: + try { + this.parameterNames = this.findMethodParameterNames( + this.declarationPackageName, + this.declarationTypeName, + this.name, + Signature.getParameterTypes(this.originalSignature == null ? this.signature : this.originalSignature)); + } catch(IllegalArgumentException e) { + // protection for invalid signature + if(this.parameterTypeNames != null) { + this.parameterNames = this.createDefaultParameterNames(this.parameterTypeNames.length); + } else { + this.parameterNames = null; + } + } + if(this.parameterNames != null) { + this.updateCompletion = true; + } + break; + } + } + return this.parameterNames; + } + + /** + * Sets the method or function parameter names. + * This information is relevant to method reference (and + * method declaration proposals). + *

+ * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + *

+ * + * @param parameterNames the parameter names, or null if none + */ + public void setParameterNames(char[][] parameterNames) { + this.parameterNames = parameterNames; + this.parameterNamesComputed = true; + } + + /** + * @return true if this proposal includes parameters, + * false if it does not + */ + public boolean hasParameters() { + return this.parameterNames != null && this.parameterNames.length > 0; + } + + /** + * @return parameter names for this proposal, or null if they are not set + * + * @see #findParameterNames(IProgressMonitor) + * @see #setParameterNames(char[][]) + */ + public char[][] getParamaterNames() { + return this.parameterNames; + } + + /** + * @return type names of the parameters for this proposal, or null none are set + * + * @see org.eclipse.wst.jsdt.internal.codeassist.InternalCompletionProposal#getParameterTypeNames() + */ + public char[][] getParameterTypeNames() { + return this.parameterTypeNames; + } + + /** + * Returns the accessibility of the proposal. + *

+ * This field is available for the following kinds of + * completion proposals: + *

    + *
  • TYPE_REF - accessibility of the type
  • + *
+ * For these kinds of completion proposals, this method returns + * {@link IAccessRule#K_ACCESSIBLE} or {@link IAccessRule#K_DISCOURAGED} + * or {@link IAccessRule#K_NON_ACCESSIBLE}. + * By default this method return {@link IAccessRule#K_ACCESSIBLE}. + *

+ * + * @see IAccessRule + * + * @return the accessibility of the proposal + * + */ + public int getAccessibility() { + return this.accessibility; + } + + /** + * Returns whether this proposal is a constructor. + *

+ * This field is available for the following kinds of + * completion proposals: + *

    + *
  • FUNCTION_REF - return true + * if the referenced method is a constructor
  • + *
  • FUNCTION_DECLARATION - return true + * if the declared method is a constructor
  • + *
+ * For kinds of completion proposals, this method returns + * false. + *

+ * + * @return true if the proposal is a constructor. + */ + public boolean isConstructor() { + return this.isConstructor; + } + + public String toString() { + StringBuffer buffer = new StringBuffer(); + buffer.append('['); + switch(this.completionKind) { + case CompletionProposal.ANONYMOUS_CLASS_DECLARATION : + buffer.append("ANONYMOUS_CLASS_DECLARATION"); //$NON-NLS-1$ + break; + case CompletionProposal.FIELD_REF : + buffer.append("FIELD_REF"); //$NON-NLS-1$ + break; + case CompletionProposal.KEYWORD : + buffer.append("KEYWORD"); //$NON-NLS-1$ + break; + case CompletionProposal.LABEL_REF : + buffer.append("LABEL_REF"); //$NON-NLS-1$ + break; + case CompletionProposal.LOCAL_VARIABLE_REF : + buffer.append("LOCAL_VARIABLE_REF"); //$NON-NLS-1$ + break; + case CompletionProposal.METHOD_DECLARATION : + buffer.append("FUNCTION_DECLARATION"); //$NON-NLS-1$ + if(this.isConstructor) { + buffer.append(""); //$NON-NLS-1$ + } + break; + case CompletionProposal.METHOD_REF : + buffer.append("FUNCTION_REF"); //$NON-NLS-1$ + if(this.isConstructor) { + buffer.append(""); //$NON-NLS-1$ + } + break; + case CompletionProposal.PACKAGE_REF : + buffer.append("PACKAGE_REF"); //$NON-NLS-1$ + break; + case CompletionProposal.TYPE_REF : + buffer.append("TYPE_REF"); //$NON-NLS-1$ + break; + case CompletionProposal.VARIABLE_DECLARATION : + buffer.append("VARIABLE_DECLARATION"); //$NON-NLS-1$ + break; + case CompletionProposal.POTENTIAL_METHOD_DECLARATION : + buffer.append("POTENTIAL_METHOD_DECLARATION"); //$NON-NLS-1$ + break; + case CompletionProposal.METHOD_NAME_REFERENCE : + buffer.append("METHOD_IMPORT"); //$NON-NLS-1$ + break; + case CompletionProposal.JSDOC_BLOCK_TAG : + buffer.append("JSDOC_BLOCK_TAG"); //$NON-NLS-1$ + break; + case CompletionProposal.JSDOC_INLINE_TAG : + buffer.append("JSDOC_INLINE_TAG"); //$NON-NLS-1$ + break; + case CompletionProposal.JSDOC_FIELD_REF: + buffer.append("JSDOC_FIELD_REF"); //$NON-NLS-1$ + break; + case CompletionProposal.JSDOC_METHOD_REF : + buffer.append("JSDOC_METHOD_REF"); //$NON-NLS-1$ + break; + case CompletionProposal.JSDOC_TYPE_REF : + buffer.append("JSDOC_TYPE_REF"); //$NON-NLS-1$ + break; + case CompletionProposal.JSDOC_PARAM_REF : + buffer.append("JSDOC_PARAM_REF"); //$NON-NLS-1$ + break; + case CompletionProposal.FIELD_IMPORT : + buffer.append("FIELD_IMPORT"); //$NON-NLS-1$ + break; + case CompletionProposal.METHOD_IMPORT : + buffer.append("METHOD_IMPORT"); //$NON-NLS-1$ + break; + case CompletionProposal.TYPE_IMPORT : + buffer.append("TYPE_IMPORT"); //$NON-NLS-1$ + break; + default : + buffer.append("PROPOSAL"); //$NON-NLS-1$ + break; + + } + buffer.append("]{completion:"); //$NON-NLS-1$ + if (this.completion != null) buffer.append(this.completion); + buffer.append(", declSign:"); //$NON-NLS-1$ + if (this.declarationSignature != null) buffer.append(this.declarationSignature); + buffer.append(", sign:"); //$NON-NLS-1$ + if (this.signature != null) buffer.append(this.signature); + buffer.append(", declKey:"); //$NON-NLS-1$ + if (this.declarationKey != null) buffer.append(this.declarationKey); + buffer.append(", key:"); //$NON-NLS-1$ + if (this.key != null) buffer.append(key); + buffer.append(", name:"); //$NON-NLS-1$ + if (this.name != null) buffer.append(this.name); + buffer.append(", ["); //$NON-NLS-1$ + buffer.append(this.replaceStart); + buffer.append(','); + buffer.append(this.replaceEnd); + buffer.append("], relevance="); //$NON-NLS-1$ + buffer.append(this.relevance); + buffer.append('}'); + return buffer.toString(); + } + + /** + * Sets source range for local variable declaration + * @param sourceStart + * @param sourceEnd + */ + public void setLocalDeclarationSourceRange(int sourceStart, int sourceEnd) { + this.sourceStart = sourceStart; + this.sourceEnd = sourceEnd; + } + + /** + * @return start offset of variable declaration. -1 if it's not variable declaration. + */ + public int getLocalDeclarationSourceStart() { + return sourceStart; + } + + /** + * @return end offset of variable declaration. -1 if it's not variable declaration. + */ + public int getLocalDeclarationSourceEnd() { + return sourceEnd; + } +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CompletionRequestor.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CompletionRequestor.java new file mode 100644 index 0000000..28d6e07 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CompletionRequestor.java @@ -0,0 +1,296 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.wst.jsdt.core.compiler.IProblem; + +/** + * Abstract base class for a completion requestor which is passed completion + * proposals as they are generated in response to a code assist request. + *

+ * This class is intended to be subclassed by clients. + *

+ *

+ * The code assist engine normally invokes methods on completion + * requestor in the following sequence: + *

+ * requestor.beginReporting();
+ * requestor.acceptContext(context);
+ * requestor.accept(proposal_1);
+ * requestor.accept(proposal_2);
+ * ...
+ * requestor.endReporting();
+ * 
+ * If, however, the engine is unable to offer completion proposals + * for whatever reason, completionFailure is called + * with a problem object describing why completions were unavailable. + * In this case, the sequence of calls is: + *
+ * requestor.beginReporting();
+ * requestor.acceptContext(context);
+ * requestor.completionFailure(problem);
+ * requestor.endReporting();
+ * 
+ * In either case, the bracketing beginReporting + * endReporting calls are always made as well as + * acceptContext call. + *

+ * + * @see ICodeAssist + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public abstract class CompletionRequestor { + + /** + * The set of CompletionProposal kinds that this requestor + * ignores; 0 means the set is empty. + * 1 << completionProposalKind + */ + private int ignoreSet = 0; + + private String[] favoriteReferences; + + /** + * The set of CompletionProposal kinds that this requestor + * allows for required proposals; 0 means the set is empty. + * 1 << completionProposalKind + */ + private int requiredProposalAllowSet[] = null; + + /** + * Creates a new completion requestor. + * The requestor is interested in all kinds of completion + * proposals; none will be ignored. + */ + public CompletionRequestor() { + // do nothing + } + + /** + * Returns whether the given kind of completion proposal is ignored. + * + * @param completionProposalKind one of the kind constants declared + * on CompletionProposal + * @return true if the given kind of completion proposal + * is ignored by this requestor, and false if it is of + * interest + * @see #setIgnored(int, boolean) + * @see CompletionProposal#getKind() + */ + public boolean isIgnored(int completionProposalKind) { + if (completionProposalKind < CompletionProposal.FIRST_KIND + || completionProposalKind > CompletionProposal.LAST_KIND) { + throw new IllegalArgumentException("Unknown kind of completion proposal: "+completionProposalKind); //$NON-NLS-1$ + } + return 0 != (this.ignoreSet & (1 << completionProposalKind)); + } + + /** + * Sets whether the given kind of completion proposal is ignored. + * + * @param completionProposalKind one of the kind constants declared + * on CompletionProposal + * @param ignore true if the given kind of completion proposal + * is ignored by this requestor, and false if it is of + * interest + * @see #isIgnored(int) + * @see CompletionProposal#getKind() + */ + public void setIgnored(int completionProposalKind, boolean ignore) { + if (completionProposalKind < CompletionProposal.FIRST_KIND + || completionProposalKind > CompletionProposal.LAST_KIND) { + throw new IllegalArgumentException("Unknown kind of completion proposal: "+completionProposalKind); //$NON-NLS-1$ + } + if (ignore) { + this.ignoreSet |= (1 << completionProposalKind); + } else { + this.ignoreSet &= ~(1 << completionProposalKind); + } + } + + /** + * Returns whether a proposal of a given kind with a required proposal + * of the given kind is allowed. + * + * @param proposalKind one of the kind constants declared + * @param requiredProposalKind one of the kind constants declared + * on CompletionProposal + * @return true if a proposal of a given kind with a required proposal + * of the given kind is allowed by this requestor, and false + * if it isn't of interest. + *

+ * By default, all kinds of required proposals aren't allowed. + *

+ * @see #setAllowsRequiredProposals(int, int, boolean) + * @see CompletionProposal#getKind() + * @see CompletionProposal#getRequiredProposals() + * + */ + public boolean isAllowingRequiredProposals(int proposalKind, int requiredProposalKind) { + if (proposalKind < CompletionProposal.FIRST_KIND + || proposalKind > CompletionProposal.LAST_KIND) { + throw new IllegalArgumentException("Unknown kind of completion proposal: "+requiredProposalKind); //$NON-NLS-1$ + } + + if (requiredProposalKind < CompletionProposal.FIRST_KIND + || requiredProposalKind > CompletionProposal.LAST_KIND) { + throw new IllegalArgumentException("Unknown required kind of completion proposal: "+requiredProposalKind); //$NON-NLS-1$ + } + if (this.requiredProposalAllowSet == null) return false; + + return 0 != (this.requiredProposalAllowSet[proposalKind] & (1 << requiredProposalKind)); + } + + /** + * Sets whether a proposal of a given kind with a required proposal + * of the given kind is allowed. + * + * Currently only a subset of kinds support required proposals. To see what combinations + * are supported you must look at {@link CompletionProposal#getRequiredProposals()} + * documentation. + * + * @param proposalKind one of the kind constants declared + * @param requiredProposalKind one of the kind constants declared + * on CompletionProposal + * @param allow true if a proposal of a given kind with a required proposal + * of the given kind is allowed by this requestor, and false + * if it isn't of interest + * @see #isAllowingRequiredProposals(int, int) + * @see CompletionProposal#getKind() + * @see CompletionProposal#getRequiredProposals() + * + */ + public void setAllowsRequiredProposals(int proposalKind, int requiredProposalKind, boolean allow) { + if (proposalKind < CompletionProposal.FIRST_KIND + || proposalKind > CompletionProposal.LAST_KIND) { + throw new IllegalArgumentException("Unknown kind of completion proposal: "+requiredProposalKind); //$NON-NLS-1$ + } + if (requiredProposalKind < CompletionProposal.FIRST_KIND + || requiredProposalKind > CompletionProposal.LAST_KIND) { + throw new IllegalArgumentException("Unknown required kind of completion proposal: "+requiredProposalKind); //$NON-NLS-1$ + } + + if (this.requiredProposalAllowSet == null) { + this.requiredProposalAllowSet = new int[CompletionProposal.LAST_KIND + 1]; + } + + if (allow) { + this.requiredProposalAllowSet[proposalKind] |= (1 << requiredProposalKind); + } else { + this.requiredProposalAllowSet[proposalKind] &= ~(1 << requiredProposalKind); + } + } + + /** + * Returns the favorite references which are used to compute some completion proposals. + *

+ * Currently only on demand type references ("java.util.Arrays.*"), + * references to a static method or a static field are used to compute completion proposals. + * Other kind of reference could be used in the future. + *

+ *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @return favorite imports + * + */ + public String[] getFavoriteReferences() { + return this.favoriteReferences; + } + + /** + * Set the favorite references which will be used to compute some completion proposals. + * A favorite reference is a qualified reference as it can be seen in an import statement.
+ * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param favoriteImports + * + * @see #getFavoriteReferences() + * + */ + public void setFavoriteReferences(String[] favoriteImports) { + this.favoriteReferences = favoriteImports; + } + + /** + * Pro forma notification sent before reporting a batch of + * completion proposals. + *

+ * The default implementation of this method does nothing. + * Clients may override. + *

+ */ + public void beginReporting() { + // do nothing + } + + /** + * Pro forma notification sent after reporting a batch of + * completion proposals. + *

+ * The default implementation of this method does nothing. + * Clients may override. + *

+ */ + public void endReporting() { + // do nothing + } + + /** + * Notification of failure to produce any completions. + * The problem object explains what prevented completing. + *

+ * The default implementation of this method does nothing. + * Clients may override to receive this kind of notice. + *

+ * + * @param problem the problem object + */ + public void completionFailure(IProblem problem) { + // default behavior is to ignore + } + + /** + * Proposes a completion. Has no effect if the kind of proposal + * is being ignored by this requestor. Callers should consider + * checking {@link #isIgnored(int)} before avoid creating proposal + * objects that would only be ignored. + *

+ * Similarly, implementers should check + * {@link #isIgnored(int) isIgnored(proposal.getKind())} + * and ignore proposals that have been declared as uninteresting. + * The proposal object passed is only valid for the duration of + * completion operation. + * + * @param proposal the completion proposal + * @exception IllegalArgumentException if the proposal is null + */ + public abstract void accept(CompletionProposal proposal); + + /** + * Propose the context in which the completion occurs. + *

+ * This method is called one and only one time before any call to + * {@link #accept(CompletionProposal)}. + * The default implementation of this method does nothing. + * Clients may override. + *

+ * @param context the completion context + * + */ + public void acceptContext(CompletionContext context) { + // do nothing + } +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CorrectionEngine.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CorrectionEngine.java new file mode 100644 index 0000000..c2db585 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CorrectionEngine.java @@ -0,0 +1,463 @@ +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import java.util.Hashtable; +import java.util.Map; + +import org.eclipse.core.resources.IMarker; +import org.eclipse.wst.jsdt.core.compiler.CharOperation; +import org.eclipse.wst.jsdt.core.compiler.IProblem; +import org.eclipse.wst.jsdt.core.compiler.InvalidInputException; +import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions; +import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemReasons; +import org.eclipse.wst.jsdt.internal.compiler.parser.Scanner; +import org.eclipse.wst.jsdt.internal.compiler.parser.TerminalTokens; +import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter; +import org.eclipse.wst.jsdt.internal.core.util.Messages; +import org.eclipse.wst.jsdt.internal.core.util.Util; + +/** + * This class is the entry point for source corrections. + * + * This class is not intended to be subclassed by clients. This class is intended to be instantiated by clients. + * + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public class CorrectionEngine implements ProblemReasons { + + /** + * This field is not intended to be used by client. + */ + protected int correctionStart; + /** + * This field is not intended to be used by client. + */ + protected int correctionEnd; + /** + * This field is not intended to be used by client. + */ + protected int prefixLength; + /** + * This field is not intended to be used by client. + */ + protected IJavaScriptUnit compilationUnit; + /** + * This field is not intended to be used by client. + */ + protected ICorrectionRequestor correctionRequestor; + /** + * This field is not intended to be used by client. + */ + protected static final int CLASSES = 0x00000001; + /** + * This field is not intended to be used by client. + */ + protected static final int IMPORT = 0x00000004; + /** + * This field is not intended to be used by client. + */ + protected static final int METHOD = 0x00000008; + /** + * This field is not intended to be used by client. + */ + protected static final int FIELD = 0x00000010; + /** + * This field is not intended to be used by client. + */ + protected static final int LOCAL = 0x00000020; + /** + * This field is not intended to be used by client. + */ + protected int filter; + + /** + * The CorrectionEngine is responsible for computing problem corrections. + * + * @param setting java.util.Map + * set of options used to configure the code correction engine. + * CURRENTLY THERE IS NO CORRECTION SPECIFIC SETTINGS. + */ + public CorrectionEngine(Map setting) { + // settings ignored for now + } + + /** + * Performs code correction for the given marker, + * reporting results to the given correction requestor. + * + * Correction results are answered through a requestor. + * + * @param marker + * the marker which describe the problem to correct. + * @param targetUnit + * replace the compilation unit given by the marker. Ignored if null. + * @param positionOffset + * the offset of position given by the marker. + * @param requestor + * the given correction requestor + * @exception IllegalArgumentException if requestor is null + * @exception JavaScriptModelException currently this exception is never thrown, but the opportunity to thrown an exception + * when the correction failed is kept for later. + */ + public void computeCorrections(IMarker marker, IJavaScriptUnit targetUnit, int positionOffset, ICorrectionRequestor requestor) throws JavaScriptModelException { + + IJavaScriptElement element = targetUnit == null ? JavaScriptCore.create(marker.getResource()) : targetUnit; + + if(!(element instanceof IJavaScriptUnit)) + return; + + IJavaScriptUnit unit = (IJavaScriptUnit) element; + + int id = marker.getAttribute(IJavaScriptModelMarker.ID, -1); + String[] args = Util.getProblemArgumentsFromMarker(marker.getAttribute(IJavaScriptModelMarker.ARGUMENTS, "")); //$NON-NLS-1$ + int start = marker.getAttribute(IMarker.CHAR_START, -1); + int end = marker.getAttribute(IMarker.CHAR_END, -1); + + computeCorrections(unit, id, start + positionOffset, end + positionOffset, args, requestor); + } + + /** + * Performs code correction for the given IProblem, + * reporting results to the given correction requestor. + * + * Correction results are answered through a requestor. + * + * @param problem + * the problem which describe the problem to correct. + * @param targetUnit + * denote the compilation unit in which correction occurs. Cannot be null. + * @param requestor + * the given correction requestor + * @exception IllegalArgumentException if targetUnit or requestor is null + * @exception JavaScriptModelException currently this exception is never thrown, but the opportunity to thrown an exception + * when the correction failed is kept for later. + */ + public void computeCorrections(IProblem problem, IJavaScriptUnit targetUnit, ICorrectionRequestor requestor) throws JavaScriptModelException { + if (requestor == null) { + throw new IllegalArgumentException(Messages.correction_nullUnit); + } + this.computeCorrections( + targetUnit, problem.getID(), + problem.getSourceStart(), + problem.getSourceEnd(), + problem.getArguments(), + requestor); + } + + /** + * Ask the engine to compute a correction for the specified problem + * of the given compilation unit. + * Correction results are answered through a requestor. + * + * @param unit org.eclipse.wst.jsdt.internal.core.ICompilationUnit + * the compilation unit. + * + * @param id int + * the id of the problem. + * + * @param start int + * a position in the source where the error begin. + * + * @param end int + * a position in the source where the error finish. + * + * @param arguments String[] + * arguments of the problem. + * + * @exception IllegalArgumentException if requestor is null + * @exception JavaScriptModelException currently this exception is never thrown, but the opportunity to thrown an exception + * when the correction failed is kept for later. + */ + private void computeCorrections(IJavaScriptUnit unit, int id, int start, int end, String[] arguments, ICorrectionRequestor requestor) { + + if(id == -1 || arguments == null || start == -1 || end == -1) + return; + if (requestor == null) { + throw new IllegalArgumentException(Messages.correction_nullRequestor); + } + + this.correctionRequestor = requestor; + this.correctionStart = start; + this.correctionEnd = end; + this.compilationUnit = unit; + + String argument = null; + try { + switch (id) { + // Type correction + case IProblem.ImportNotFound : + this.filter = IMPORT; + argument = arguments[0]; + break; + case IProblem.UndefinedType : + this.filter = CLASSES; + argument = arguments[0]; + break; + + // Method correction + case IProblem.UndefinedMethod : + case IProblem.UndefinedFunction : + this.filter = METHOD; + argument = arguments[1]; + break; + + // Field and local variable correction + case IProblem.UndefinedField : + this.filter = FIELD; + argument = arguments[0]; + break; + case IProblem.UndefinedName : + this.filter = FIELD | LOCAL; + argument = arguments[0]; + break; + } + } catch (ArrayIndexOutOfBoundsException e) { + return; + } + if(argument != null) { + correct(argument.toCharArray()); + } + } + + private void correct(char[] argument) { + try { + String source = this.compilationUnit.getSource(); + Scanner scanner = new Scanner(); + scanner.setSource(source.toCharArray()); + + scanner.resetTo(this.correctionStart, this.correctionEnd); + int token = 0; + char[] argumentSource = CharOperation.NO_CHAR; + + // search last segment position + while(true) { + token = scanner.getNextToken(); + if (token == TerminalTokens.TokenNameEOF) return; + + char[] tokenSource = scanner.getCurrentTokenSource(); + + argumentSource = CharOperation.concat(argumentSource, tokenSource); + if(!CharOperation.prefixEquals(argumentSource, argument)) + return; + + if(CharOperation.equals(argument, argumentSource)) { + this.correctionStart = scanner.startPosition; + this.correctionEnd = scanner.currentPosition; + this.prefixLength = CharOperation.lastIndexOf('.', argument) + 1; + break; + } + + } + + // search completion position + int completionPosition = this.correctionStart; + scanner.resetTo(completionPosition, this.correctionEnd); + int position = completionPosition; + + for (int i = 0; i < 4; i++) { + if(scanner.getNextCharAsJavaIdentifierPart()) { + completionPosition = position; + position = scanner.currentPosition; + } else { + break; + } + } + Hashtable oldOptions = JavaScriptCore.getOptions(); + try { + Hashtable options = new Hashtable(oldOptions); + options.put(JavaScriptCore.CODEASSIST_CAMEL_CASE_MATCH, JavaScriptCore.DISABLED); + JavaScriptCore.setOptions(options); + + this.compilationUnit.codeComplete( + completionPosition, + this.completionRequestor + ); + } finally { + JavaScriptCore.setOptions(oldOptions); + } + } catch (JavaScriptModelException e) { + return; + } catch (InvalidInputException e) { + return; + } + } + + /** + * This field is not intended to be used by client. + */ + protected CompletionRequestor completionRequestor = new CompletionRequestor() { + public void accept(CompletionProposal proposal) { + switch (proposal.getKind()) { + case CompletionProposal.TYPE_REF: + if((CorrectionEngine.this.filter & CLASSES) != 0) { + char[] completionName = proposal.getCompletion(); + CorrectionEngine.this.correctionRequestor.acceptClass( + proposal.getDeclarationSignature(), + Signature.getSignatureSimpleName(proposal.getSignature()), + CharOperation.subarray(completionName, CorrectionEngine.this.prefixLength, completionName.length), + proposal.getFlags(), + CorrectionEngine.this.correctionStart, + CorrectionEngine.this.correctionEnd); + } else if((CorrectionEngine.this.filter & IMPORT) != 0) { + char[] packageName = proposal.getDeclarationSignature(); + char[] className = Signature.getSignatureSimpleName(proposal.getSignature()); + char[] fullName = CharOperation.concat(packageName, className, '.'); + CorrectionEngine.this.correctionRequestor.acceptClass( + packageName, + className, + CharOperation.subarray(fullName, CorrectionEngine.this.prefixLength, fullName.length), + proposal.getFlags(), + CorrectionEngine.this.correctionStart, + CorrectionEngine.this.correctionEnd); + } + break; + case CompletionProposal.FIELD_REF: + if((CorrectionEngine.this.filter & FIELD) != 0) { + char[] declaringSignature = proposal.getDeclarationSignature(); + char[] signature = proposal.getSignature(); + CorrectionEngine.this.correctionRequestor.acceptField( + Signature.getSignatureQualifier(declaringSignature), + Signature.getSignatureSimpleName(declaringSignature), + proposal.getName(), + Signature.getSignatureQualifier(signature), + Signature.getSignatureSimpleName(signature), + proposal.getName(), + proposal.getFlags(), + CorrectionEngine.this.correctionStart, + CorrectionEngine.this.correctionEnd); + } + break; + case CompletionProposal.LOCAL_VARIABLE_REF: + if((CorrectionEngine.this.filter & LOCAL) != 0) { + char[] signature = proposal.getSignature(); + CorrectionEngine.this.correctionRequestor.acceptLocalVariable( + proposal.getName(), + Signature.getSignatureQualifier(signature), + Signature.getSignatureSimpleName(signature), + proposal.getFlags(), + CorrectionEngine.this.correctionStart, + CorrectionEngine.this.correctionEnd); + } + break; + case CompletionProposal.METHOD_REF: + if((CorrectionEngine.this.filter & METHOD) != 0) { + char[] declaringSignature = proposal.getDeclarationSignature(); + char[] signature = proposal.getSignature(); + char[][] parameterTypeSignatures = Signature.getParameterTypes(signature); + int length = parameterTypeSignatures.length; + char[][] parameterPackageNames = new char[length][]; + char[][] parameterTypeNames = new char[length][]; + for (int i = 0; i < length; i++) { + parameterPackageNames[i] = Signature.getSignatureQualifier(parameterTypeSignatures[i]); + parameterTypeNames[i] = Signature.getSignatureSimpleName(parameterTypeSignatures[i]); + } + char[] returnTypeSignature = Signature.getReturnType(signature); + CorrectionEngine.this.correctionRequestor.acceptMethod( + Signature.getSignatureQualifier(declaringSignature), + Signature.getSignatureSimpleName(declaringSignature), + proposal.getName(), + parameterPackageNames, + parameterTypeNames, + proposal.findParameterNames(null), + Signature.getSignatureQualifier(returnTypeSignature), + Signature.getSignatureSimpleName(returnTypeSignature), + proposal.getName(), + proposal.getFlags(), + CorrectionEngine.this.correctionStart, + CorrectionEngine.this.correctionEnd); + } + break; + case CompletionProposal.PACKAGE_REF: + if((CorrectionEngine.this.filter & (CLASSES | IMPORT)) != 0) { + char[] packageName = proposal.getDeclarationSignature(); + CorrectionEngine.this.correctionRequestor.acceptPackage( + packageName, + CharOperation.subarray(packageName, CorrectionEngine.this.prefixLength, packageName.length), + CorrectionEngine.this.correctionStart, + CorrectionEngine.this.correctionEnd); + } + break; + } + } + }; + + + /** + * Return an array of strings which contains one entry per warning token + * accepted by the @SuppressWarnings annotation. This array is + * neither null nor empty, it contains at least the String all. + * It should not be modified by the caller (please take a copy if modifications + * are needed).
+ * Note: The tokens returned are not necessarily standardized across JavaScript + * validators. If you were to use one of these tokens in a @SuppressWarnings + * annotation in the JavaScript source code, the effects (if any) may vary from + * validator to validator. + * + * @return an array of strings which contains one entry per warning token + * accepted by the @SuppressWarnings annotation. + */ + public static String[] getAllWarningTokens() { + return CompilerOptions.warningTokens; + } + + /** + * Helper method for decoding problem marker attributes. Returns an array of String arguments + * extracted from the problem marker "arguments" attribute, or null if the marker + * "arguments" attribute is missing or ill-formed. + * + * @param problemMarker + * the problem marker to decode arguments from. + * @return an array of String arguments, or null if unable to extract arguments + */ + public static String[] getProblemArguments(IMarker problemMarker){ + String argumentsString = problemMarker.getAttribute(IJavaScriptModelMarker.ARGUMENTS, null); + return Util.getProblemArgumentsFromMarker(argumentsString); + } + + /** + * Returns a token which can be used to suppress a given warning using + * @SuppressWarnings annotation, for a given problem ID + * ({@link IProblem }). If a particular problem is not suppressable, + * null will be returned. + *

+ * Note: @SuppressWarnings can only suppress warnings, + * which means that if some problems got promoted to ERROR using custom compiler + * settings ({@link IJavaScriptProject#setOption(String, String)}), the + * @SuppressWarnings annotation will be ineffective. + *

+ *

+ * Note: @SuppressWarnings can be argumented with + * "all" so as to suppress all possible warnings at once. + *

+ *

+ * Note: The tokens returned are not necessarily standardized across JavaScript + * validators. If you were to use one of these tokens in an @SuppressWarnings + * annotation in the JavaScript source code, the effects (if any) may vary from + * validator to validator. + *

+ * @param problemID + * the ID of a given warning to suppress + * @return a String which can be used in @SuppressWarnings annotation, + * or null if unable to suppress this warning. + */ + public static String getWarningToken(int problemID){ + long irritant = ProblemReporter.getIrritant(problemID); + if (irritant != 0) { + return CompilerOptions.warningTokenFromIrritant(irritant); + } + return null; + } +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ElementChangedEvent.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ElementChangedEvent.java new file mode 100644 index 0000000..d29b576 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ElementChangedEvent.java @@ -0,0 +1,105 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import java.util.EventObject; + +/** + * An element changed event describes a change to the structure or contents + * of a tree of JavaScript elements. The changes to the elements are described by + * the associated delta object carried by this event. + *

+ * This class is not intended to be instantiated or subclassed by clients. + * Instances of this class are automatically created by the JavaScript model. + *

+ * + * @see IElementChangedListener + * @see IJavaScriptElementDelta + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public class ElementChangedEvent extends EventObject { + + /** + * Event type constant (bit mask) indicating an after-the-fact + * report of creations, deletions, and modifications + * to one or more JavaScript element(s) expressed as a hierarchical + * java element delta as returned by getDelta(). + * + * Note: this notification occurs during the corresponding POST_CHANGE + * resource change notification, and contains a full delta accounting for + * any JavaScriptModel operation and/or resource change. + * + * @see IJavaScriptElementDelta + * @see org.eclipse.core.resources.IResourceChangeEvent + * @see #getDelta() + */ + public static final int POST_CHANGE = 1; + + /** + * Event type constant (bit mask) indicating an after-the-fact + * report of creations, deletions, and modifications + * to one or more JavaScript element(s) expressed as a hierarchical + * java element delta as returned by getDelta. + * + * Note: this notification occurs as a result of a working copy reconcile + * operation. + * + * @see IJavaScriptElementDelta + * @see org.eclipse.core.resources.IResourceChangeEvent + * @see #getDelta() + */ + public static final int POST_RECONCILE = 4; + + private static final long serialVersionUID = -8947240431612844420L; // backward compatible + + /* + * Event type indicating the nature of this event. + * It can be a combination either: + * - POST_CHANGE + * - PRE_AUTO_BUILD + * - POST_RECONCILE + */ + private int type; + + /** + * Creates an new element changed event (based on a IJavaScriptElementDelta). + * + * @param delta the JavaScript element delta. + * @param type the type of delta (ADDED, REMOVED, CHANGED) this event contains + */ + public ElementChangedEvent(IJavaScriptElementDelta delta, int type) { + super(delta); + this.type = type; + } + /** + * Returns the delta describing the change. + * + * @return the delta describing the change + */ + public IJavaScriptElementDelta getDelta() { + return (IJavaScriptElementDelta) this.source; + } + + /** + * Returns the type of event being reported. + * + * @return one of the event type constants + * @see #POST_CHANGE + * @see #POST_RECONCILE + */ + public int getType() { + return this.type; + } +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/Flags.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/Flags.java new file mode 100644 index 0000000..751e5ef --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/Flags.java @@ -0,0 +1,230 @@ +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * IBM Corporation - added constant AccDefault + * IBM Corporation - added constants AccBridge and AccVarargs for J2SE 1.5 + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants; + +/** + * Utility class for decoding modifier flags in JavaScript elements. + *

+ * This class provides static methods only; it is not intended to be + * instantiated or subclassed by clients. + *

+ * + * @see IMember#getFlags() + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public final class Flags { + + /** + * Constant representing the absence of any flag + */ + public static final int AccDefault = ClassFileConstants.AccDefault; + /** + * Public access flag. + * + * This flag only applies to ECMAScript 4 which is not yet supported + */ + public static final int AccPublic = ClassFileConstants.AccPublic; + /** + * Private access flag. + * + * This flag only applies to ECMAScript 4 which is not yet supported + */ + public static final int AccPrivate = ClassFileConstants.AccPrivate; + /** + * Protected access flag. + * + * This flag only applies to ECMAScript 4 which is not yet supported + */ + public static final int AccProtected = ClassFileConstants.AccProtected; + /** + * Static access flag. + */ + public static final int AccStatic = ClassFileConstants.AccStatic; + /** + * Abstract property flag. + * + * This flag only applies to ECMAScript 4 which is not yet supported + */ + public static final int AccAbstract = ClassFileConstants.AccAbstract; + /** + * Super property flag. + * + * This flag only applies to ECMAScript 4 which is not yet supported + */ + public static final int AccSuper = ClassFileConstants.AccSuper; + /** + * Deprecated property flag. + */ + public static final int AccDeprecated = ClassFileConstants.AccDeprecated; + + /**= + * Varargs method property + * Used to flag variable arity method declarations. + * + * This flag only applies to ECMAScript 4 which is not yet supported + */ + public static final int AccVarargs = ClassFileConstants.AccVarargs; + + /** + * Not instantiable. + */ + private Flags() { + // Not instantiable + } + /** + * Returns whether the given integer includes the abstract modifier. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param flags the flags + * @return true if the abstract modifier is included + */ + public static boolean isAbstract(int flags) { + return (flags & AccAbstract) != 0; + } + /** + * Returns whether the given integer includes the indication that the + * element is deprecated (@deprecated tag in jsdoc comment). + * + * @param flags the flags + * @return true if the element is marked as deprecated + */ + public static boolean isDeprecated(int flags) { + return (flags & AccDeprecated) != 0; + } + /* + * Returns whether the given integer does not include one of the + * public, private, or protected flags. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param flags the flags + * @return true if no visibility flag is set + */ + public static boolean isPackageDefault(int flags) { + return (flags & (AccPublic | AccProtected | AccPrivate)) == 0; + } + /** + * Returns whether the given integer includes the private modifier. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param flags the flags + * @return true if the private modifier is included + */ + public static boolean isPrivate(int flags) { + return (flags & AccPrivate) != 0; + } + /** + * Returns whether the given integer includes the protected modifier. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param flags the flags + * @return true if the protected modifier is included + */ + public static boolean isProtected(int flags) { + return (flags & AccProtected) != 0; + } + /** + * Returns whether the given integer includes the public modifier. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param flags the flags + * @return true if the public modifier is included + */ + public static boolean isPublic(int flags) { + return (flags & AccPublic) != 0; + } + /** + * Returns whether the given integer includes the static modifier. + * + * @param flags the flags + * @return true if the static modifier is included + */ + public static boolean isStatic(int flags) { + return (flags & AccStatic) != 0; + } + /** + * Returns whether the given integer includes the super modifier. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param flags the flags + * @return true if the super modifier is included + */ + public static boolean isSuper(int flags) { + return (flags & AccSuper) != 0; + } + + /* + * Returns whether the given integer has the AccVarargs + * bit set. + * + * @param flags the flags + * @return true if the AccVarargs flag is included + * @see #AccVarargs + */ + public static boolean isVarargs(int flags) { + return (flags & AccVarargs) != 0; + } + + /** + * Returns a standard string describing the given modifier flags. + * Only modifier flags are included in the output; deprecated, + * synthetic, bridge, etc. flags are ignored. + *

+ * The flags are output in the following order: + *

+	 *   public protected private
+	 *   static
+	 *   abstract final native synchronized transient volatile strictfp
+	 * 
+ *

+ *

+ * Examples results: + *

+	 *	  "public static final"
+	 *	  "private native"
+	 * 
+ *

+ * + * @param flags the flags + * @return the standard string representation of the given flags + */ + public static String toString(int flags) { + StringBuffer sb = new StringBuffer(); + + if (isPublic(flags)) + sb.append("public "); //$NON-NLS-1$ + if (isPrivate(flags)) + sb.append("private "); //$NON-NLS-1$ + if (isStatic(flags)) + sb.append("static "); //$NON-NLS-1$ + if (isAbstract(flags)) + sb.append("abstract "); //$NON-NLS-1$ + + int len = sb.length(); + if (len == 0) + return ""; //$NON-NLS-1$ + sb.setLength(len - 1); + return sb.toString(); + } +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IAccessRule.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IAccessRule.java new file mode 100644 index 0000000..e6ff7b2 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IAccessRule.java @@ -0,0 +1,110 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.core.runtime.IPath; + +/** + * Describes an access rule to source and class files on a includepath entry. + * An access rule is composed of a file pattern and a kind (accessible, + * non accessible, or discouraged). + *

+ * On a given includepath entry, the access rules are considered in the order given + * when the entry was created. When a source matches an access + * rule's pattern, the access rule's kind define whether the file is considered + * accessible, non accessible, or its access is discouraged. If the source + * file doesn't match any accessible rule, it is considered accessible. A source + * file that is not accessible or discouraged can still be refered to but it is tagged as being not + * accessible - the JavaScript validator will create a problem marker for example. + * The severity of the marker created from a non accessible rule is controled through + * the {@link JavaScriptCore#COMPILER_PB_FORBIDDEN_REFERENCE} compiler option. + * The severity of the marker created from a discouraged rule is controled through + * the {@link JavaScriptCore#COMPILER_PB_DISCOURAGED_REFERENCE} compiler option. + * Note this is different from inclusion and exclusion patterns on source includepath entries, + * where a source file that is excluded is not even validated. + * Files patterns look like relative file paths with wildcards and are interpreted relative + * to each entry's path. + * File patterns are case-sensitive and they can contain '**', '*' or '?' wildcards (see + * {@link IIncludePathEntry#getExclusionPatterns()} for the full description + * of their syntax and semantics). + * Note that file patterns must not include the file extension. + * com/xyz/tests/MyClass is a valid file pattern, whereas + * com/xyz/tests/MyClass.class is not valid. + *

+ * + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IAccessRule { + + /** + * Constant indicating that files matching the rule's pattern are accessible. + */ + int K_ACCESSIBLE = 0; + + /** + * Constant indicating that files matching the rule's pattern are non accessible. + */ + int K_NON_ACCESSIBLE = 1; + + /** + * Constant indicating that access to the files matching the rule's pattern is discouraged. + */ + int K_DISCOURAGED = 2; + + /** + *

Flag indicating that whether a type matching this rule should be ignored iff a type with + * the same qualified name can be found on a later includepath entry with a better + * accessibility.

+ *

E.g. if a type p.X matches a rule K_NON_ACCESSIBLE | IGNORE_IF_BETTER + * on a library entry 'lib1' and another type p.X also matches a rule + * K_DISCOURAGED on library entry 'lib2' ('lib2' being after 'lib1' on the + * includepath), then p.X from 'lib2' will be used and reported as + * discouraged.

+ * + */ + int IGNORE_IF_BETTER = 0x100; + + /** + * Returns the file pattern for this access rule. + * + * @return the file pattern for this access rule + */ + IPath getPattern(); + + /** + * Returns the kind of this access rule (one of {@link #K_ACCESSIBLE}, {@link #K_NON_ACCESSIBLE} + * or {@link #K_DISCOURAGED}). + * + * @return the kind of this access rule + */ + int getKind(); + + /** + *

Returns whether a type matching this rule should be ignored iff a type with + * the same qualified name can be found on a later includepath entry with a better + * accessibility.

+ *

E.g. if a type p.X matches a rule K_NON_ACCESSIBLE | IGNORE_IF_BETTER + * on a library entry 'lib1' and another type p.X also matches a rule + * K_DISCOURAGED on library entry 'lib2' ('lib2' being after 'lib1' on the + * includepath), then p.X from 'lib2' will be used and reported as + * discouraged.

+ * + * @return whether a type matching this rule should be ignored iff a type + * with the same qualified name can be found on a later includepath + * entry with a better accessibility + */ + boolean ignoreIfBetter(); + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IBuffer.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IBuffer.java new file mode 100644 index 0000000..b46fb92 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IBuffer.java @@ -0,0 +1,261 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.IProgressMonitor; + +/** + * A buffer contains the text contents of a resource. It is not language-specific. + * The contents may be in the process of being edited, differing from the actual contents of the + * underlying resource. A buffer has an owner, which is an IOpenable. + * If a buffer does not have an underlying resource, saving the buffer has no effect. + * Buffers can be read-only. + *

+ * Note that javaScript model operations that manipulate an IBuffer (for example, + * IType.createMethod(...)) ensures that the same line delimiter + * (either "\n" or "\r" or "\r\n") is + * used across the whole buffer. Thus these operations may change the line delimiter(s) + * included in the string to be append, or replaced. + * However implementers of this interface should be aware that other clients of IBuffer + * might not do such transformations beforehand. + *

+ * This interface may be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IBuffer { + +/** + * Adds the given listener for changes to this buffer. + * Has no effect if an identical listener is already registered or if the buffer + * is closed. + * + * @param listener the listener of buffer changes + */ +public void addBufferChangedListener(IBufferChangedListener listener); +/** + * Appends the given character array to the contents of the buffer. + * This buffer will now have unsaved changes. + * Any client can append to the contents of the buffer, not just the owner of the buffer. + * Reports a buffer changed event. + *

+ * Has no effect if this buffer is read-only or if the buffer is closed. + * + * @param text the given character array to append to contents of the buffer + */ +public void append(char[] text); +/** + * Appends the given string to the contents of the buffer. + * This buffer will now have unsaved changes. + * Any client can append to the contents of the buffer, not just the owner of the buffer. + * Reports a buffer changed event. + *

+ * Has no effect if this buffer is read-only or if the buffer is closed. + * + * @param text the String to append to the contents of the buffer + */ +public void append(String text); +/** + * Closes the buffer. Any unsaved changes are lost. Reports a buffer changed event + * with a 0 offset and a 0 length. When this event is fired, the buffer should already + * be closed. + *

+ * Further operations on the buffer are not allowed, except for close. If an + * attempt is made to close an already closed buffer, the second attempt has no effect. + */ +public void close(); +/** + * Returns the character at the given position in this buffer. + *

+ * The returned value is undefined if the buffer is closed. + * + * @param position a zero-based source offset in this buffer + * @return the character at the given position in this buffer + */ +public char getChar(int position); +/** + * Returns the contents of this buffer as a character array, or null if + * the buffer has not been initialized. + *

+ * Callers should make no assumption about whether the returned character array + * is or is not the genuine article or a copy. In other words, if the client + * wishes to change this array, they should make a copy. Likewise, if the + * client wishes to hang on to the array in its current state, they should + * make a copy. + *

+ * The returned value is undefined if the buffer is closed. + * + * @return the characters contained in this buffer + */ +public char[] getCharacters(); +/** + * Returns the contents of this buffer as a String. Like all strings, + * the result is an immutable value object., It can also answer null if + * the buffer has not been initialized. + *

+ * The returned value is undefined if the buffer is closed. + * + * @return the contents of this buffer as a String + */ +public String getContents(); +/** + * Returns number of characters stored in this buffer. + *

+ * The returned value is undefined if the buffer is closed. + * + * @return the number of characters in this buffer + */ +public int getLength(); +/** + * Returns the JavaScript openable element owning of this buffer. + * + * @return the openable element owning this buffer + */ +public IOpenable getOwner(); +/** + * Returns the given range of text in this buffer. + *

+ * The returned value is undefined if the buffer is closed. + * + * @param offset the zero-based starting offset + * @param length the number of characters to retrieve + * @return the given range of text in this buffer + */ +public String getText(int offset, int length); +/** + * Returns the underlying resource for which this buffer was opened, + * or null if this buffer was not opened on a resource. + * + * @return the underlying resource for this buffer, or null + * if none. + */ +public IResource getUnderlyingResource(); +/** + * Returns whether this buffer has been modified since it + * was opened or since it was last saved. + * If a buffer does not have an underlying resource, this method always + * returns true. + *

+ * NOTE: when a buffer does not have unsaved changes, the model may decide to close it + * to claim some memory back. If the associated element needs to be reopened later on, its + * buffer factory will be requested to create a new buffer. + *

+ * @return a boolean indicating presence of unsaved changes (in + * the absence of any underlying resource, it will always return true). + */ +public boolean hasUnsavedChanges(); +/** + * Returns whether this buffer has been closed. + * + * @return a boolean indicating whether this buffer is closed. + */ +public boolean isClosed(); +/** + * Returns whether this buffer is read-only. + * + * @return a boolean indicating whether this buffer is read-only + */ +public boolean isReadOnly(); +/** + * Removes the given listener from this buffer. + * Has no affect if an identical listener is not registered or if the buffer is closed. + * + * @param listener the listener + */ +public void removeBufferChangedListener(IBufferChangedListener listener); +/** + * Replaces the given range of characters in this buffer with the given text. + * position and position + length must be in the range [0, getLength()]. + * length must not be negative. + *

+ * Has no effect if this buffer is read-only or if the buffer is closed. + * + * @param position the zero-based starting position of the affected text range in this buffer + * @param length the length of the affected text range in this buffer + * @param text the replacing text as a character array + */ +public void replace(int position, int length, char[] text); +/** + * Replaces the given range of characters in this buffer with the given text. + * position and position + length must be in the range [0, getLength()]. + * length must not be negative. + *

+ * Has no effect if this buffer is read-only or if the buffer is closed. + * + * @param position the zero-based starting position of the affected text range in this buffer + * @param length the length of the affected text range in this buffer + * @param text the replacing text as a String + */ +public void replace(int position, int length, String text); +/** + * Saves the contents of this buffer to its underlying resource. If + * successful, this buffer will have no unsaved changes. + * The buffer is left open. Saving a buffer with no unsaved + * changes has no effect - the underlying resource is not changed. + * If the buffer does not have an underlying resource or is read-only, this + * has no effect. + *

+ * The force parameter controls how this method deals with + * cases where the workbench is not completely in sync with the local file system. + * If false is specified, this method will only attempt + * to overwrite a corresponding file in the local file system provided + * it is in sync with the workbench. This option ensures there is no + * unintended data loss; it is the recommended setting. + * However, if true is specified, an attempt will be made + * to write a corresponding file in the local file system, + * overwriting any existing one if need be. + * In either case, if this method succeeds, the resource will be marked + * as being local (even if it wasn't before). + *

+ * Has no effect if this buffer is read-only or if the buffer is closed. + * + * @param progress the progress monitor to notify + * @param force a boolean flag indicating how to deal with resource + * inconsistencies. + * + * @exception JavaScriptModelException if an error occurs writing the buffer + * to the underlying resource + * + * @see org.eclipse.core.resources.IFile#setContents(java.io.InputStream, boolean, boolean, org.eclipse.core.runtime.IProgressMonitor) + */ +public void save(IProgressMonitor progress, boolean force) throws JavaScriptModelException; +/** + * Sets the contents of this buffer to the given character array. + * This buffer will now have unsaved changes. + * Any client can set the contents of the buffer, not just the owner of the buffer. + * Reports a buffer changed event. + *

+ * Equivalent to replace(0,getLength(),contents). + *

+ * Has no effect if this buffer is read-only or if the buffer is closed. + * + * @param contents the new contents of this buffer as a character array + */ +public void setContents(char[] contents); +/** + * Sets the contents of this buffer to the given String. + * This buffer will now have unsaved changes. + * Any client can set the contents of the buffer, not just the owner of the buffer. + * Reports a buffer changed event. + *

+ * Equivalent to replace(0,getLength(),contents). + *

+ * Has no effect if this buffer is read-only or if the buffer is closed. + * + * @param contents the new contents of this buffer as a String + */ +public void setContents(String contents); +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IBufferChangedListener.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IBufferChangedListener.java new file mode 100644 index 0000000..ed5c634 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IBufferChangedListener.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +/** + * A listener, which gets notified when the contents of a specific buffer + * have changed, or when the buffer is closed. + * When a buffer is closed, the listener is notified after the buffer has been closed. + * A listener is not notified when a buffer is saved. + *

+ * This interface may be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. +*/ +public interface IBufferChangedListener { + + /** + * Notifies that the given event has occurred. + * + * @param event the change event + */ + public void bufferChanged(BufferChangedEvent event); +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IBufferFactory.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IBufferFactory.java new file mode 100644 index 0000000..96e9d33 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IBufferFactory.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +/** + * A factory that creates IBuffers for openables. + *

+ * This interface may be implemented by clients. + *

+ * @deprecated Use {@link WorkingCopyOwner} instead + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IBufferFactory { + + /** + * Creates a buffer for the given owner. + * The new buffer will be initialized with the contents of the owner + * if and only if it was not already initialized by the factory (a buffer is uninitialized if + * its content is null). + * + * @param owner the owner of the buffer + * @return the newly created buffer + * @see IBuffer + */ + IBuffer createBuffer(IOpenable owner); +} + diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IClassFile.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IClassFile.java new file mode 100644 index 0000000..c98e698 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IClassFile.java @@ -0,0 +1,63 @@ +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + + +/** + * Represents an entire non-editable JavaScript file. + * non-editable JavaScript file elements need to be opened before they can be navigated. + * If a file cannot be parsed, its structure remains unknown. Use + * IJavaScriptElement.isStructureKnown to determine whether this is the + * case. + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. +*/ + +public interface IClassFile extends ITypeRoot { + +/** + * Returns the bytes contained in this file. + * + * @return the bytes contained in this file + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + */ +byte[] getBytes() throws JavaScriptModelException; + +/** + * Returns the first type contained in this file. + * This is a handle-only method. The type may or may not exist. + * + * @return the type contained in this file + * + */ +IType getType(); +public IType[] getTypes() throws JavaScriptModelException ; + + +/* + * Returns whether this type is edit. This is not guaranteed to be + * instantaneous, as it may require parsing the underlying file. + * + * @return true if the file represents a class. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + */ +boolean isClass() throws JavaScriptModelException; +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ICodeAssist.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ICodeAssist.java new file mode 100644 index 0000000..f8d85da --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ICodeAssist.java @@ -0,0 +1,127 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +/** + * Common protocol for JavaScript elements that support source code assist and code + * resolve. + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface ICodeAssist { + + /** + * Performs code completion at the given offset position in this javaScript unit, + * reporting results to the given completion requestor. The offset + * is the 0-based index of the character, after which code assist is desired. + * An offset of -1 indicates to code assist at the beginning of this + * javaScript unit. + *

+ * + * @param offset the given offset position + * @param requestor the given completion requestor + * @exception JavaScriptModelException if code assist could not be performed. Reasons include:

    + *
  • This JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • The position specified is < -1 or is greater than this javaScript unit's + * source length (INDEX_OUT_OF_BOUNDS) + *
+ * + * @exception IllegalArgumentException if requestor is null + */ + void codeComplete(int offset, CompletionRequestor requestor) + throws JavaScriptModelException; + + /** + * Performs code completion at the given offset position in this javaScript unit, + * reporting results to the given completion requestor. The offset + * is the 0-based index of the character, after which code assist is desired. + * An offset of -1 indicates to code assist at the beginning of this + * javaScript unit. + * It considers types in the working copies with the given owner first. In other words, + * the owner's working copies will take precedence over their original javaScript units + * in the workspace. + *

+ * Note that if a working copy is empty, it will be as if the original javaScript + * unit had been deleted. + *

+ * + * @param offset the given offset position + * @param requestor the given completion requestor + * @param owner the owner of working copies that take precedence over their original javaScript units + * @exception JavaScriptModelException if code assist could not be performed. Reasons include:
    + *
  • This JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • The position specified is < -1 or is greater than this javaScript unit's + * source length (INDEX_OUT_OF_BOUNDS) + *
+ * + * @exception IllegalArgumentException if requestor is null + */ + void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner owner) + throws JavaScriptModelException; + + /** + * Returns the JavaScript elements corresponding to the given selected text in this javaScript unit. + * The offset is the 0-based index of the first selected character. + * The length is the number of selected characters. + *

+ * Note that if the length is 0 and the offset is inside an identifier + * or the index just after an identifier then this identifier is considered as the selection. + *

+ * + * @param offset the given offset position + * @param length the number of selected characters + * @return the JavaScript elements corresponding to the given selected text + * + * @exception JavaScriptModelException if code resolve could not be performed. Reasons include: + *
    + *
  • This JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • The range specified is not within this element's + * source range (INDEX_OUT_OF_BOUNDS) + *
+ * + */ + IJavaScriptElement[] codeSelect(int offset, int length) throws JavaScriptModelException; + /** + * Returns the JavaScript elements corresponding to the given selected text in this javaScript unit. + * The offset is the 0-based index of the first selected character. + * The length is the number of selected characters. + * It considers types in the working copies with the given owner first. In other words, + * the owner's working copies will take precedence over their original javaScript units + * in the workspace. + *

+ * Note that if the length is 0 and the offset is inside an identifier + * or the index just after an identifier then this identifier is considered as the selection. + *

+ *

+ * Note that if a working copy is empty, it will be as if the original javaScript + * unit had been deleted. + *

+ * + * @param offset the given offset position + * @param length the number of selected characters + * @param owner the owner of working copies that take precedence over their original javaScript units + * @return the JavaScript elements corresponding to the given selected text + * + * @exception JavaScriptModelException if code resolve could not be performed. Reasons include: + *
    + *
  • This JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • The range specified is not within this element's + * source range (INDEX_OUT_OF_BOUNDS) + *
+ */ + IJavaScriptElement[] codeSelect(int offset, int length, WorkingCopyOwner owner) throws JavaScriptModelException; +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ICorrectionRequestor.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ICorrectionRequestor.java new file mode 100644 index 0000000..f8a158b --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ICorrectionRequestor.java @@ -0,0 +1,137 @@ +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +/** + * A callback interface for receiving javaScript problem correction. + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface ICorrectionRequestor { +/* + * Notification of a class correction. + * + * @param packageName Declaring package name of the class. + * @param className Name of the class. + * @param correctionName The correction for the class. + * @param modifiers The modifiers of the class. + * @param correctionStart The start position of insertion of the correction of the class. + * @param correctionEnd The end position of insertion of the correction of the class. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + */ +void acceptClass( + char[] packageName, + char[] className, + char[] correctionName, + int modifiers, + int correctionStart, + int correctionEnd); +/** + * Notification of a field/var correction. + * + * @param declaringTypePackageName Name of the package in which the type that contains this field is declared. + * @param declaringTypeName Name of the type declaring this field. + * @param name Name of the field. + * @param typePackageName Name of the package in which the type of this field is declared. + * @param typeName Name of the type of this field. + * @param correctionName The correction for the field. + * @param modifiers The modifiers of this field. + * @param correctionStart The start position of insertion of the correction of this field. + * @param correctionEnd The end position of insertion of the correction of this field. + * + */ +void acceptField( + char[] declaringTypePackageName, + char[] declaringTypeName, + char[] name, + char[] typePackageName, + char[] typeName, + char[] correctionName, + int modifiers, + int correctionStart, + int correctionEnd); +/** + * Notification of a local variable correction. + * + * @param name Name of the local variable. + * @param typePackageName Name of the package in which the type of this local variable is declared. + * @param typeName Name of the type of this local variable. + * @param modifiers The modifiers of this local variable. + * @param correctionStart The start position of insertion of the correction of this local variable. + * @param correctionEnd The end position of insertion of the correction of this local variable. + * + */ +void acceptLocalVariable( + char[] name, + char[] typePackageName, + char[] typeName, + int modifiers, + int correctionStart, + int correctionEnd); +/** + * Notification of a method correction. + * + * @param declaringTypePackageName Name of the package in which the type that contains this method is declared. + * @param declaringTypeName Name of the type declaring this method. + * @param selector Name of the method. + * @param parameterPackageNames Names of the packages in which the parameter types are declared. + * Should contain as many elements as parameterTypeNames. + * @param parameterTypeNames Names of the parameter types. + * Should contain as many elements as parameterPackageNames. + * @param parameterNames Names of the parameters. + * Should contain as many elements as parameterPackageNames. + * @param returnTypePackageName Name of the package in which the return type is declared. + * @param returnTypeName Name of the return type of this method, should be null for a constructor. + * @param correctionName The correction for the method. + * Can include zero, one or two brackets. If the closing bracket is included, then the cursor should be placed before it. + * @param modifiers The modifiers of this method. + * @param correctionStart The start position of insertion of the correction of this method. + * @param correctionEnd The end position of insertion of the correction of this method. + * + * NOTE: parameter names can be retrieved from the source model after the user selects a specific method. + */ +void acceptMethod( + char[] declaringTypePackageName, + char[] declaringTypeName, + char[] selector, + char[][] parameterPackageNames, + char[][] parameterTypeNames, + char[][] parameterNames, + char[] returnTypePackageName, + char[] returnTypeName, + char[] correctionName, + int modifiers, + int correctionStart, + int correctionEnd); +/** + * Notification of a package correction. + * + * @param packageName The package name. + * @param correctionName The correction for the package. + * Can include '.*;' for imports. + * @param correctionStart The start position of insertion of the correction of this package. + * @param correctionEnd The end position of insertion of the correction of this package. + * + * This Method only applies to ECMAScript 4 which is not yet supported + */ +void acceptPackage( + char[] packageName, + char[] correctionName, + int correctionStart, + int correctionEnd); +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IElementChangedListener.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IElementChangedListener.java new file mode 100644 index 0000000..2c2e421 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IElementChangedListener.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +/** + * An element changed listener receives notification of changes to JavaScript elements + * maintained by the JavaScript model. + *

+ * This interface may be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IElementChangedListener { + +/** + * Notifies that one or more attributes of one or more JavaScript elements have changed. + * The specific details of the change are described by the given event. + * + * @param event the change event + */ +public void elementChanged(ElementChangedEvent event); +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IField.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IField.java new file mode 100644 index 0000000..a7b5862 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IField.java @@ -0,0 +1,64 @@ +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * IBM Corporation - added J2SE 1.5 support + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +/** + * Represents a field declared in a type or a var declared at the file scope. + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IField extends IMember { +/** + * Returns the simple name of this field. + * @return the simple name of this field. + */ +String getElementName(); +/** + * Returns the binding key for this field. A binding key is a key that uniquely + * identifies this field. It allows access to generic info for parameterized + * fields. + * + * @return the binding key for this field + * @see org.eclipse.wst.jsdt.core.dom.IBinding#getKey() + * @see BindingKey + */ +String getKey(); +/** + * Returns the type signature of this field. + *

+ * The type signature may be either unresolved (for source types) + * or resolved (for binary types), and either basic (for basic types) + * or rich (for parameterized types). See {@link Signature} for details. + *

+ * + * @return the type signature of this field + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + * @see Signature + */ +String getTypeSignature() throws JavaScriptModelException; + +/** + * Returns whether this field represents a resolved field. + * If a field is resoved, its key contains resolved information. + * + * @return whether this field represents a resolved field. + */ +boolean isResolved(); + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IFunction.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IFunction.java new file mode 100644 index 0000000..beedf90 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IFunction.java @@ -0,0 +1,168 @@ +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * IBM Corporation - added J2SE 1.5 support + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +/** + * Represents a function or a method (or constructor) declared in a type. + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IFunction extends IMember { +/** + * Returns the simple name of this function or method. + * For a constructor, this returns the simple name of the declaring type. + * Note: This holds whether the constructor appears in a source or binary type + * This is a handle-only method. + * @return the simple name of this method + */ +String getElementName(); +/** + * Returns the number of parameters of this method. + * This is a handle-only method. + * + * @return the number of parameters of this method + */ +int getNumberOfParameters(); +/** + * Returns the binding key for this method. A binding key is a key that uniquely + * identifies this method. It allows access to generic info for parameterized + * methods. + * + * @return the binding key for this method + * @see org.eclipse.wst.jsdt.core.dom.IBinding#getKey() + * @see BindingKey + */ +String getKey(); +/** + * Returns the names of parameters in this method. + * Returns an empty array if this method has no parameters. + * + *

For example, a method declared as function foo( text, length) + * would return the array {"text","length"}. + *

+ * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the names of parameters in this method, an empty array if this method has no parameters + */ +String[] getParameterNames() throws JavaScriptModelException; +/** + * Returns the type signatures for the parameters of this method. + * Returns an empty array if this method has no parameters. + * This is a handle-only method. + *

+ * The type signatures may be either unresolved (for source types) + * or resolved (for binary types), and either basic (for basic types) + * or rich (for parameterized types). See {@link Signature} for details. + *

+ * + * @return the type signatures for the parameters of this method, an empty array if this method has no parameters + * @see Signature + */ +String[] getParameterTypes(); +/** + * Returns the names of parameters in this method. + * Returns an empty array if this method has no parameters. + * + *

For example, a method declared as function foo( text, length) + * would return the array {"text","length"}. For the same method in a + * binary, this would return {"arg0", "arg1"}. + *

+ * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the names of parameters in this method, an empty array if this method has no parameters + */ +String[] getRawParameterNames() throws JavaScriptModelException; +/** + * Returns the type signature of the return value of this method. + * For constructors, this returns the signature for void. + *

+ * Until EMCAScript 4 is supported, types are inferred by analying the code, and are not necessarily accurate. + *

+ *

+ * For example, a source method declared as function getName(){return "abc"} + * would return "QString;". + *

+ *

+ * The type signature may be either unresolved (for source types) + * or resolved (for binary types), and either basic (for basic types) + * or rich (for parameterized types). See {@link Signature} for details. + *

+ * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the type signature of the return value of this method, void for constructors + * @see Signature + */ +String getReturnType() throws JavaScriptModelException; +/** + * Returns the signature of this method. This includes the signatures for the + * parameter types and return type, but does not include the method name, + * exception types, or type parameters. + *

+ * For example, a source method declared as public void foo(String text, int length) + * would return "(QString;I)V". + *

+ *

+ * The type signatures embedded in the method signature may be either unresolved + * (for source types) or resolved (for binary types), and either basic (for + * basic types) or rich (for parameterized types). See {@link Signature} for + * details. + *

+ * + * @return the signature of this method + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @see Signature + */ +String getSignature() throws JavaScriptModelException; +/** + * Returns whether this method is a constructor. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * + * @return true if this method is a constructor, false otherwise + */ +boolean isConstructor() throws JavaScriptModelException; + +/** + * Returns whether this method represents a resolved method. + * If a method is resoved, its key contains resolved information. + * + * @return whether this method represents a resolved method. + */ +boolean isResolved(); +/** + * Returns whether this method is similar to the given method. + * Two methods are similar if: + *
    + *
  • their element names are equal
  • + *
  • they have the same number of parameters
  • + *
  • the simple names of their parameter types are equal
  • + *
+ * This is a handle-only method. + * + * @param method the given method + * @return true if this method is similar to the given method. + * @see Signature#getSimpleName(char[]) + */ +boolean isSimilar(IFunction method); +public IFunction getFunction(String selector, String[] parameterTypeSignatures) ; +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IFunctionContainer.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IFunctionContainer.java new file mode 100644 index 0000000..1ea8453 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IFunctionContainer.java @@ -0,0 +1,88 @@ +/******************************************************************************* + * Copyright (c) 2007, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + + + +/** + * Represents a container of methods and fields/vars (either an IJavaScriptUnit + * or an IType). + * + *

+ * This interface is not intended to be implemented by clients. + *

+ * + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + *

+ + */ +public interface IFunctionContainer { + + +/** + * Returns the field with the specified name + * in this type (for example, "bar"). + * This is a handle-only method. The field may or may not exist. + * + * @param name the given name + * @return the field with the specified name in this type + */ +IField getField(String name); +/** + * Returns the fields declared by this type or javascript file. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the fields declared by this type or file + */ +IField[] getFields() throws JavaScriptModelException; + +/** + * Returns the method with the specified name and parameter types + * in this type (for example, "foo", {"I", "QString;"}). + * To get the handle for a constructor, the name specified must be the + * simple name of the enclosing type. + * This is a handle-only method. The method may or may not be present. + *

+ * The type signatures may be either unresolved (for source types) + * or resolved (for binary types), and either basic (for basic types) + * or rich (for parameterized types). See {@link Signature} for details. + *

+ * + * @param name the given name + * @param parameterTypeSignatures the given parameter types + * @return the method with the specified name and parameter types in this type + */ +IFunction getFunction(String name, String[] parameterTypeSignatures); + +/** + * Returns the methods and constructors declared by this type or file. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the methods and constructors declared by this type + */ +IFunction[] getFunctions() throws JavaScriptModelException; + +/** + * Returns the type with the specified name + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the type with the specified name in this file + */ +IType getType(String name); + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IImportContainer.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IImportContainer.java new file mode 100644 index 0000000..d89a141 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IImportContainer.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +/** + * Represents an import container is a child of a JavaScript unit that contains + * all (and only) the import declarations. If a JavaScript unit has no import + * declarations, no import container will be present. + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * This Interface only applies to ECMAScript 4 which is not yet supported + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IImportContainer extends IJavaScriptElement, IParent, ISourceReference { +/** + * Returns the first import declaration in this import container with the given name. + * This is a handle-only method. The import declaration may or may not exist. + * + * @param name the given name + * + * @return the first import declaration in this import container with the given name + */ +IImportDeclaration getImport(String name); +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IImportDeclaration.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IImportDeclaration.java new file mode 100644 index 0000000..179bc32 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IImportDeclaration.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * IBM Corporation - added J2SE 1.5 support + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +/** + * Represents an import declaration in JavaScript unit. + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * This Interface only applies to ECMAScript 4 which is not yet supported + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IImportDeclaration extends IJavaScriptElement, ISourceReference, ISourceManipulation { +/** + * Returns the name that has been imported. + * + * @return the name that has been imported + */ +String getElementName(); +/** + * Returns the modifier flags for this import. The flags can be examined using class + * Flags. Only the static flag is meaningful for import declarations. + * + * @return the modifier flags for this import + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @see Flags + */ +int getFlags() throws JavaScriptModelException; + +/* + * Returns whether the import is on-demand. An import is on-demand if it ends + * with ".*". + * @return true if the import is on-demand, false otherwise + */ +boolean isOnDemand(); +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IIncludePathAttribute.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IIncludePathAttribute.java new file mode 100644 index 0000000..d3d2b92 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IIncludePathAttribute.java @@ -0,0 +1,93 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.wst.jsdt.internal.core.ClasspathAttribute; + +/** + * A includepath attribute defines a name/value pair that can be persisted with a includepath entry. Such an attribute + * can be created using the factory method {@link JavaScriptCore#newIncludepathAttribute(String, String) newClasspathAttribute(String name, String value)}. + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * @see JavaScriptCore#newContainerEntry( + * org.eclipse.core.runtime.IPath containerPath, + * IAccessRule[] accessRules, + * IIncludePathAttribute[] extraAttributes, + * boolean isExported) + * @see JavaScriptCore#newLibraryEntry( + * org.eclipse.core.runtime.IPath path, + * org.eclipse.core.runtime.IPath sourceAttachmentPath, + * org.eclipse.core.runtime.IPath sourceAttachmentRootPath, + * IAccessRule[] accessRules, + * IIncludePathAttribute[] extraAttributes, + * boolean isExported) + * @see JavaScriptCore#newProjectEntry( + * org.eclipse.core.runtime.IPath path, + * IAccessRule[] accessRules, + * boolean combineAccessRestrictions, + * IIncludePathAttribute[] extraAttributes, + * boolean isExported) + * @see JavaScriptCore#newSourceEntry( + * org.eclipse.core.runtime.IPath path, + * org.eclipse.core.runtime.IPath[] inclusionPatterns, + * org.eclipse.core.runtime.IPath[] exclusionPatterns, + * org.eclipse.core.runtime.IPath specificOutputLocation, + * IIncludePathAttribute[] extraAttributes) + * @see JavaScriptCore#newVariableEntry( + * org.eclipse.core.runtime.IPath variablePath, + * org.eclipse.core.runtime.IPath variableSourceAttachmentPath, + * org.eclipse.core.runtime.IPath variableSourceAttachmentRootPath, + * IAccessRule[] accessRules, + * IIncludePathAttribute[] extraAttributes, + * boolean isExported) + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IIncludePathAttribute { + + /** + * Constant for the name of the jsdoc location attribute. + * + */ + String JSDOC_LOCATION_ATTRIBUTE_NAME = "javadoc_location"; //$NON-NLS-1$ + + /** + * Constant for the name of the optional attribute. The possible values + * for this attribute are "true" or "false". + * When not present, "false" is assumed. + * If the value of this attribute is "true", the includepath entry + * is optional. If the underlying resource or jar file doesn't exist, no error + * is reported and the includepath entry is ignored. + */ + String OPTIONAL = "optional"; //$NON-NLS-1$ + + /** + * Returns the name of this includepath attribute. + * + * @return the name of this includepath attribute. + */ + String getName(); + + /** + * Returns the value of this includepath attribute. + * + * @return the value of this includepath attribute. + */ + String getValue(); + + public static final ClasspathAttribute HIDE = new ClasspathAttribute("hide","true"); //$NON-NLS-1$ //$NON-NLS-2$ + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IIncludePathEntry.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IIncludePathEntry.java new file mode 100644 index 0000000..326e4f8 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IIncludePathEntry.java @@ -0,0 +1,395 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.core.runtime.IPath; + +/** + * An entry on a JavaScript project includepath identifying one or more package fragment + * roots. A includepath entry has a content kind (either source, + * {@link IPackageFragmentRoot#K_SOURCE}, or binary, {@link IPackageFragmentRoot#K_BINARY}), which is inherited + * by each package fragment root and package fragment associated with the entry. + *

+ * A includepath entry can refer to any of the following:

    + * + *
  • Source code in the current project. In this case, the entry identifies a + * root folder in the current project containing package fragments and + * source files with one of the {@link JavaScriptCore#getJavaScriptLikeExtensions() + * JavaScript-like extensions}. The root folder itself represents a default + * package, subfolders represent package fragments, and files with a + * JavaScript-like extension (e.g. .js files) + * represent javaScript files. All javaScript files will be compiled when + * the project is built. The includepath entry must specify the + * absolute path to the root folder. Entries of this kind are + * associated with the {@link #CPE_SOURCE} constant. + * Source includepath entries can carry inclusion and exclusion patterns for + * selecting which source files appear as javaScript + * units and get compiled when the project is built. + *
  • + * + *
  • A binary library in the current project, in another project, or in the external + * file system. In this case the entry identifies non-editable files. Entries + * of this kind are associated with the {@link #CPE_LIBRARY} constant.
  • + * + *
  • A required project. In this case the entry identifies another project in + * the workspace. When performing other + * "development" operations - such as code assist, code resolve, type hierarchy + * creation, etc. - the source code of the project is referred to. Thus, development + * is performed against a required project's source code. The + * includepath entry must specify the absolute path to the + * project. Entries of this kind are associated with the {@link #CPE_PROJECT} + * constant. + * Note: referencing a required project with a includepath entry refers to the source + * code or associated .class files located in its output location. + * It will also automatically include any other libraries or projects that the required project's includepath + * refers to, iff the corresponding includepath entries are tagged as being exported + * ({@link IIncludePathEntry#isExported}). + * Unless exporting some includepath entries, includepaths are not chained by default - + * each project must specify its own includepath in its entirety.
  • + * + *
  • A path beginning in a includepath variable defined globally to the workspace. + * Entries of this kind are associated with the {@link #CPE_VARIABLE} constant. + * Includepath variables are created using {@link JavaScriptCore#setIncludepathVariable(String, IPath, org.eclipse.core.runtime.IProgressMonitor)}, + * and gets resolved, to either a project or library entry, using + * {@link JavaScriptCore#getResolvedIncludepathEntry(IIncludePathEntry)}. + * It is also possible to register an automatic initializer ({@link JsGlobalScopeVariableInitializer}), + * which will be invoked through the extension point "org.eclipse.wst.jsdt.core.JsGlobalScopeVariableInitializer". + * After resolution, a includepath variable entry may either correspond to a project or a library entry.
  • + * + *
  • A named includepath container identified by its container path. + * A includepath container provides a way to indirectly reference a set of includepath entries through + * a includepath entry of kind {@link #CPE_CONTAINER}. Typically, a includepath container can + * be used to describe a complex library composed of multiple files, projects or includepath variables, + * considering also that containers can be mapped differently on each project. Several projects can + * reference the same generic container path, but have each of them actually bound to a different + * container object. + * The container path is a formed by a first ID segment followed with extra segments, + * which can be used as additional hints for resolving this container reference. If no container was ever + * recorded for this container path onto this project (using {@link JavaScriptCore#setJsGlobalScopeContainer}, + * then a {@link JsGlobalScopeContainerInitializer} will be activated if any was registered for this + * container ID onto the extension point "org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer". + * A includepath container entry can be resolved explicitly using {@link JavaScriptCore#getJsGlobalScopeContainer} + * and the resulting container entries can contain any non-container entry. In particular, it may contain variable + * entries, which in turn needs to be resolved before being directly used. + *
    Also note that the container resolution APIs include an IJavaScriptProject argument, so as to allow the same + * container path to be interpreted in different ways for different projects.
  • + *
+ *

+ * The result of {@link IJavaScriptProject#getResolvedClasspath} will have all entries of type + * {@link #CPE_VARIABLE} and {@link #CPE_CONTAINER} resolved to a set of + * {@link #CPE_SOURCE}, {@link #CPE_LIBRARY} or {@link #CPE_PROJECT} + * includepath entries. + *

+ * Any includepath entry other than a source folder (kind {@link #CPE_SOURCE}) can + * be marked as being exported. Exported entries are automatically contributed to + * dependent projects, along with the project's default output folder, which is + * implicitly exported, and any auxiliary output folders specified on source + * includepath entries. The project's output folder(s) are always listed first, + * followed by the any exported entries. + *

+ * This interface is not intended to be implemented by clients. + * Includepath entries can be created via methods on {@link JavaScriptCore}. + *

+ * + * @see JavaScriptCore#newLibraryEntry(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath) + * @see JavaScriptCore#newProjectEntry(org.eclipse.core.runtime.IPath) + * @see JavaScriptCore#newSourceEntry(org.eclipse.core.runtime.IPath) + * @see JavaScriptCore#newVariableEntry(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath) + * @see JavaScriptCore#newContainerEntry(org.eclipse.core.runtime.IPath) + * @see JsGlobalScopeVariableInitializer + * @see JsGlobalScopeContainerInitializer + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IIncludePathEntry { + + /** + * Entry kind constant describing a includepath entry identifying a + * library. + */ + int CPE_LIBRARY = 1; + + /** + * Entry kind constant describing a includepath entry identifying a + * required project. + */ + int CPE_PROJECT = 2; + + /** + * Entry kind constant describing a includepath entry identifying a + * folder containing package fragments with source code + * to be validated. + */ + int CPE_SOURCE = 3; + + /** + * Entry kind constant describing a includepath entry defined using + * a path that begins with a includepath variable reference. + */ + int CPE_VARIABLE = 4; + + /** + * Entry kind constant describing a includepath entry representing + * a name includepath container. + */ + int CPE_CONTAINER = 5; + + /** + * Returns whether the access rules of the project's exported entries should be combined with this entry's access rules. + * Returns true for container entries. + * Returns false otherwise. + * + * @return whether the access rules of the project's exported entries should be combined with this entry's access rules + */ + boolean combineAccessRules(); + + /** + * Returns the possibly empty list of access rules for this entry. + * + * @return the possibly empty list of access rules for this entry + */ + IAccessRule[] getAccessRules(); + /** + * Returns the kind of files found in the package fragments identified by this + * includepath entry. + * + * @return {@link IPackageFragmentRoot#K_SOURCE} for files containing + * source code, and {@link IPackageFragmentRoot#K_BINARY} for binary + * class files. + * There is no specified value for an entry denoting a variable ({@link #CPE_VARIABLE}) + * or a includepath container ({@link #CPE_CONTAINER}). + */ + int getContentKind(); + + /** + * Returns the kind of this includepath entry. + * + * @return one of: + *
    + *
  • {@link #CPE_SOURCE} - this entry describes a source root in + its project + *
  • {@link #CPE_LIBRARY} - this entry describes a folder + containing non-editable files + *
  • {@link #CPE_PROJECT} - this entry describes another project + * + *
  • {@link #CPE_VARIABLE} - this entry describes a project or library + * indirectly via a includepath variable in the first segment of the path + * * + *
  • {@link #CPE_CONTAINER} - this entry describes set of entries + * referenced indirectly via a includepath container + *
+ */ + int getEntryKind(); + + /** + * Returns the set of patterns used to exclude resources or classes associated with + * this includepath entry. + *

+ * For source includepath entries, + * exclusion patterns allow specified portions of the resource tree rooted + * at this source entry's path to be filtered out. If no exclusion patterns + * are specified, this source entry includes all relevent files. Each path + * specified must be a relative path, and will be interpreted relative + * to this source entry's path. File patterns are case-sensitive. A file + * matched by one or more of these patterns is excluded from the + * corresponding package fragment root. + * Exclusion patterns have higher precedence than inclusion patterns; + * in other words, exclusion patterns can remove files for the ones that + * are to be included, not the other way around. + *

+ *

+ * The pattern mechanism is similar to Ant's. Each pattern is represented as + * a relative path. The path segments can be regular file or folder names or simple patterns + * involving standard wildcard characters. + *

+ *

+ * '*' matches 0 or more characters within a segment. So + * *.js matches .js, a.js + * and Foo.js, but not Foo.properties + * (does not end with .js). + *

+ *

+ * '?' matches 1 character within a segment. So ?.js + * matches a.js, A.js, + * but not .js or xyz.js (neither have + * just one character before .js). + *

+ *

+ * Combinations of *'s and ?'s are allowed. + *

+ *

+ * The special pattern '**' matches zero or more segments. In a source entry, + * a path like tests/ that ends in a trailing separator is interpreted + * as tests/**, and would match everything under + * the folder named tests. + *

+ *

+ * Example patterns in source entries (assuming that "js" is the only {@link JavaScriptCore#getJavaScriptLikeExtensions() JavaScript-like extension}): + *

    + *
  • + * tests/** (or simply tests/) + * matches all files under a root folder + * named tests. This includes tests/Foo.js + * and tests/com/example/Foo.js, but not + * com/example/tests/Foo.js (not under a root folder named + * tests). + *
  • + *
  • + * tests/* matches all files directly below a root + * folder named tests. This includes tests/Foo.js + * and tests/FooHelp.js + * but not tests/com/example/Foo.js (not directly under + * a folder named tests) or + * com/Foo.js (not under a folder named tests). + *
  • + *
  • + * **/tests/** matches all files under any + * folder named tests. This includes tests/Foo.js, + * com/examples/tests/Foo.js, and + * com/examples/tests/unit/Foo.js, but not + * com/example/Foo.js (not under a folder named + * tests). + *
  • + *
+ *

+ * + * @return the possibly empty list of resource exclusion patterns + * associated with this includepath entry, or null if this kind + * of includepath entry does not support exclusion patterns + */ + IPath[] getExclusionPatterns(); + + /** + * Returns the extra includepath attributes for this includepath entry. Returns an empty array if this entry + * has no extra attributes. + * + * @return the possibly empty list of extra includepath attributes for this includepath entry + */ + IIncludePathAttribute[] getExtraAttributes(); + + /** + * Returns the set of patterns used to explicitly define resources + * to be included with this includepath entry. + *

+ * For source includepath entries, + * when no inclusion patterns are specified, the source entry includes all + * relevent files in the resource tree rooted at this source entry's path. + * Specifying one or more inclusion patterns means that only the specified + * portions of the resource tree are to be included. Each path specified + * must be a relative path, and will be interpreted relative to this source + * entry's path. File patterns are case-sensitive. A file matched by one or + * more of these patterns is included in the corresponding package fragment + * root unless it is excluded by one or more of this entrie's exclusion + * patterns. Exclusion patterns have higher precedence than inclusion + * patterns; in other words, exclusion patterns can remove files for the + * ones that are to be included, not the other way around. + *

+ *

+ * See {@link #getExclusionPatterns()} for a discussion of the syntax and + * semantics of path patterns. The absence of any inclusion patterns is + * semantically equivalent to the explicit inclusion pattern + * **. + *

+ *

+ * Example patterns in source entries: + *

    + *
  • + * The inclusion pattern src/** by itself includes all + * files under a root folder named src. + *
  • + *
  • + * The inclusion patterns src/** and + * tests/** includes all files under the root folders + * named src and tests. + *
  • + *
  • + * The inclusion pattern src/** together with the + * exclusion pattern src/**/Foo.js includes all + * files under a root folder named src except for ones + * named Foo.js. + *
  • + *
+ *

+ * + * @return the possibly empty list of resource inclusion patterns + * associated with this includepath entry, or null if this kind + * of includepath entry does not support inclusion patterns + */ + IPath[] getInclusionPatterns(); + + /** + * Returns the path of this includepath entry. + * + * The meaning of the path of a includepath entry depends on its entry kind:
    + *
  • Source code in the current project ({@link #CPE_SOURCE}) - + * The path associated with this entry is the absolute path to the root folder.
  • + *
  • A binary library in the current project ({@link #CPE_LIBRARY}) - the path + * associated with this entry is the absolute path to the file. + *
  • A required project ({@link #CPE_PROJECT}) - the path of the entry denotes the + * path to the corresponding project resource.
  • + *
  • A variable entry ({@link #CPE_VARIABLE}) - the first segment of the path + * is the name of a includepath variable. If this includepath variable + * is bound to the path P, the path of the corresponding includepath entry + * is computed by appending to P the segments of the returned + * path without the variable.
  • + *
  • A container entry ({@link #CPE_CONTAINER}) - the path of the entry + * is the name of the includepath container, which can be bound indirectly to a set of includepath + * entries after resolution. The containerPath is a formed by a first ID segment followed with + * extra segments that can be used as additional hints for resolving this container + * reference (also see {@link IJsGlobalScopeContainer}). + *
  • + *
+ * + * @return the path of this includepath entry + */ + IPath getPath(); + + /** + * Returns the path to the source archive or folder associated with this + * includepath entry, or null if this includepath entry has no + * source attachment. + *

+ * Only library and variable includepath entries may have source attachments. + * For library includepath entries, the result path (if present) locates a source + * archive or folder. This archive or folder can be located in a project of the + * workspace or outside thr workspace. For variable includepath entries, the + * result path (if present) has an analogous form and meaning as the + * variable path, namely the first segment is the name of a includepath variable. + *

+ * + * @return the path to the source archive or folder, or null if none + */ + IPath getSourceAttachmentPath(); + + /** + * Returns the path within the source archive or folder where package fragments + * are located. An empty path indicates that packages are located at + * the root of the source archive or folder. Returns a non-null value + * if and only if {@link #getSourceAttachmentPath} returns + * a non-null value. + * + * @return the path within the source archive or folder, or null if + * not applicable + */ + IPath getSourceAttachmentRootPath(); + + /** + * Returns whether this entry is exported to dependent projects. + * Always returns false for source entries (kind + * {@link #CPE_SOURCE}), which cannot be exported. + * + * @return true if exported, and false otherwise + */ + boolean isExported(); +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IInitializer.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IInitializer.java new file mode 100644 index 0000000..2c27d98 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IInitializer.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +/** + * Represents a stand-alone instance or class (static) initializer in a type. + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IInitializer extends IMember { + // interface used as a marker: defines no member +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJarEntryResource.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJarEntryResource.java new file mode 100644 index 0000000..512b386 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJarEntryResource.java @@ -0,0 +1,77 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.core.resources.IStorage; +import org.eclipse.core.runtime.IPath; + +/** + * A jar entry corresponding to a non-Java resource in an archive {@link IPackageFragment} or {@link IPackageFragmentRoot}. + *

+ * One can navigate the non-Java resource tree using the {@link #getChildren()} and {@link #getParent()} methods. + * Jar entry resources are either files ({@link #isFile()} returns true) or directories ({@link #isFile()} returns false). + * Files don't have any children and the returned array is always empty. + *

+ * Jar entry resources that refer to the same element are guaranteed to be equal, but not necessarily identical. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IJarEntryResource extends IStorage { + + /** + * Returns the list of children of this jar entry resource. + * Returns an empty array if this jar entry is a file, or if this jar entry is a directory and it has no children. + * + * @return the children of this jar entry resource + */ + IJarEntryResource[] getChildren(); + + /** + * Returns the full, absolute path of this jar entry resource relative to the archive this jar + * entry belongs to. + *

+ * A jar entry resource's full path indicates the route from the root of the archive + * to the jar entry resource. Within an archive, there is exactly one such path + * for any given jar entry resource. The returned path never has a trailing separator. + *

+ * + * @return the absolute path of this jar entry resource + */ + IPath getFullPath(); + + /** + * Returns the parent of this jar entry resource. This is either an {@link IJarEntryResource}, an {@link IPackageFragment} + * or an {@link IPackageFragmentRoot}. + * + * @return the parent of this jar entry resource + */ + Object getParent(); + + /** + * Returns the package fragment root this jar entry file belongs to. + * + * @return the package fragment root this jar entry file belongs to. + */ + IPackageFragmentRoot getPackageFragmentRoot(); + + /** + * Returns true if this jar entry represents a file. + * Returns false if it is a directory. + * + * @return whether this jar entry is a file + */ + boolean isFile(); + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptElement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptElement.java new file mode 100644 index 0000000..d1a6e76 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptElement.java @@ -0,0 +1,382 @@ +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import java.net.URI; + +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.jobs.ISchedulingRule; + +/** + * Common protocol for all elements provided by the JavaScript model. + * JavaScript model elements are exposed to clients as handles to the actual underlying element. + * The JavaScript model may hand out any number of handles for each element. Handles + * that refer to the same element are guaranteed to be equal, but not necessarily identical. + *

+ * Methods annotated as "handle-only" do not require underlying elements to exist. + * Methods that require underlying elements to exist throw + * a JavaScriptModelException when an underlying element is missing. + * JavaScriptModelException.isDoesNotExist can be used to recognize + * this common special case. + *

+ *

+ * This interface is not intended to be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IJavaScriptElement extends IAdaptable, ILookupScope{ + + /** + * Constant representing a JavaScript model (workspace level object). + * A JavaScript element with this type can be safely cast to {@link IJavaScriptModel}. + */ + int JAVASCRIPT_MODEL = 1; + + /** + * Constant representing a JavaScript project. + * A JavaScript element with this type can be safely cast to {@link IJavaScriptProject}. + */ + int JAVASCRIPT_PROJECT = 2; + + /** + * Constant representing a root source folder (package fragment root). + * A JavaScript element with this type can be safely cast to {@link IPackageFragmentRoot}. + */ + int PACKAGE_FRAGMENT_ROOT = 3; + + /** + * Constant representing a source folder (package fragment). + * A JavaScript element with this type can be safely cast to {@link IPackageFragment}. + */ + int PACKAGE_FRAGMENT = 4; + + /** + * Constant representing a JavaScript file. + * A JavaScript element with this type can be safely cast to {@link IJavaScriptUnit}. + */ + int JAVASCRIPT_UNIT = 5; + + /** + * Constant representing a non-editable javaScript file. + * A JavaScript element with this type can be safely cast to {@link IClassFile}. + */ + int CLASS_FILE = 6; + + /** + * Constant representing a type (a class or interface). + * A JavaScript element with this type can be safely cast to {@link IType}. + */ + int TYPE = 7; + + /** + * Constant representing a field or a var with file scope. + * A JavaScript element with this type can be safely cast to {@link IField}. + */ + int FIELD = 8; + + /** + * Constant representing a function, method or constructor. + * A JavaScript element with this type can be safely cast to {@link IFunction}. + */ + int METHOD = 9; + + /** + * Constant representing a stand-alone instance or class initializer. + * A JavaScript element with this type can be safely cast to {@link IInitializer}. + */ + int INITIALIZER = 10; + + /** + * Constant representing all import declarations within a compilation unit. + * A JavaScript element with this type can be safely cast to {@link IImportContainer}. + * + * This type only applies to ECMAScript 4 which is not yet supported + */ + int IMPORT_CONTAINER = 12; + + /** + * Constant representing an import declaration within a compilation unit. + * A JavaScript element with this type can be safely cast to {@link IImportDeclaration}. + * + * This type only applies to ECMAScript 4 which is not yet supported + */ + int IMPORT_DECLARATION = 13; + + /** + * Constant representing a local variable declaration. + * A JavaScript element with this type can be safely cast to {@link ILocalVariable}. + */ + int LOCAL_VARIABLE = 14; + + /** + * Returns whether this JavaScript element exists in the model. + *

+ * JavaScript elements are handle objects that may or may not be backed by an + * actual element. JavaScript elements that are backed by an actual element are + * said to "exist", and this method returns true. For JavaScript + * elements that are not working copies, it is always the case that if the + * element exists, then its parent also exists (provided it has one) and + * includes the element as one of its children. It is therefore possible + * to navigated to any existing JavaScript element from the root of the JavaScript model + * along a chain of existing JavaScript elements. On the other hand, working + * copies are said to exist until they are destroyed (with + * IWorkingCopy.destroy). Unlike regular JavaScript elements, a + * working copy never shows up among the children of its parent element + * (which may or may not exist). + *

+ * + * @return true if this element exists in the JavaScript model, and + * false if this element does not exist + */ + boolean exists(); + + /** + * Returns the first ancestor of this JavaScript element that has the given type. + * Returns null if no such an ancestor can be found. + * This is a handle-only method. + * + * @param ancestorType the given type + * @return the first ancestor of this JavaScript element that has the given type, null if no such an ancestor can be found + */ + IJavaScriptElement getAncestor(int ancestorType); + + /** + *

Returns the Jsdoc as an html source if this element has an attached jsdoc, + * null otherwise.

+ *

This should be used only for binary elements. Source elements will always return null.

+ *

The encoding used to read the jsdoc is the one defined by the content type of the + * file. If none is defined, then the project's encoding of this java element is used. If the project's + * encoding cannot be retrieved, then the platform encoding is used.

+ *

In case of the jsdoc doesn't exist for this element, null is returned.

+ * + *

The html is extracted from the attached jsdoc and provided as is. No + * transformation or validation is done.

+ * + * @param monitor the given progress monitor + * @exception JavaScriptModelException if:
    + *
  • this element does not exist
  • + *
  • retrieving the attached jsdoc fails (timed-out, invalid URL, ...)
  • + *
  • the format of the jsdoc doesn't match expected standards (different anchors,...)
  • + *
+ * @return the extracted jsdoc from the attached jsdoc, null if none + * @see IIncludePathAttribute#JSDOC_LOCATION_ATTRIBUTE_NAME + */ + String getAttachedJavadoc(IProgressMonitor monitor) throws JavaScriptModelException; + + /** + * Returns the resource that corresponds directly to this element, + * or null if there is no resource that corresponds to + * this element. + *

+ * For example, the corresponding resource for an IJavaScriptUnit + * is its underlying IFile. The corresponding resource for + * an IPackageFragment that is not contained in an archive + * is its underlying IFolder. An IPackageFragment + * contained in an archive has no corresponding resource. Similarly, there + * are no corresponding resources for IMethods, + * IFields, etc. + *

+ * + * @return the corresponding resource, or null if none + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + */ + IResource getCorrespondingResource() throws JavaScriptModelException; + + /** + * Returns the name of this element. This is a handle-only method. + * + * @return the element name + */ + String getElementName(); + + /** + * Returns this element's kind encoded as an integer. + * This is a handle-only method. + * + * @return the kind of element; one of the constants declared in + * IJavaScriptElement + * @see IJavaScriptElement + */ + int getElementType(); + + /** + * Returns a string representation of this element handle. The format of + * the string is not specified; however, the identifier is stable across + * workspace sessions, and can be used to recreate this handle via the + * JavaScriptCore.create(String) method. + * + * @return the string handle identifier + * @see JavaScriptCore#create(java.lang.String) + */ + String getHandleIdentifier(); + + /** + * Returns the JavaScript model. + * This is a handle-only method. + * + * @return the JavaScript model + */ + IJavaScriptModel getJavaScriptModel(); + + /** + * Returns the JavaScript project this element is contained in, + * or null if this element is not contained in any JavaScript project + * (for instance, the IJavaScriptModel is not contained in any JavaScript + * project). + * This is a handle-only method. + * + * @return the containing JavaScript project, or null if this element is + * not contained in a JavaScript project + */ + IJavaScriptProject getJavaScriptProject(); + + /** + * Returns the first openable parent. If this element is openable, the element + * itself is returned. Returns null if this element doesn't have + * an openable parent. + * This is a handle-only method. + * + * @return the first openable parent or null if this element doesn't have + * an openable parent. + */ + IOpenable getOpenable(); + + /** + * Returns the element directly containing this element, + * or null if this element has no parent. + * This is a handle-only method. + * + * @return the parent element, or null if this element has no parent + */ + IJavaScriptElement getParent(); + + /** + * Returns the path to the innermost resource enclosing this element. + * If this element is not included in an external archive, + * the path returned is the full, absolute path to the underlying resource, + * relative to the workbench. + * If this element is included in an external archive, + * the path returned is the absolute path to the archive in the file system. + * This is a handle-only method. + * + * @return the path to the innermost resource enclosing this element + */ + IPath getPath(); + + /** + * Returns the primary element (whose compilation unit is the primary compilation unit) + * this working copy element was created from, or this element if it is a descendant of a + * primary javaScript unit or if it is not a descendant of a working copy (e.g. it is a + * binary member). + * The returned element may or may not exist. + * + * @return the primary element this working copy element was created from, or this + * element. + */ + IJavaScriptElement getPrimaryElement(); + + /** + * Returns the innermost resource enclosing this element. + * If this element is included in an archive and this archive is not external, + * this is the underlying resource corresponding to the archive. + * If this element is included in an external archive, null + * is returned. + * This is a handle-only method. + * + * @return the innermost resource enclosing this element, null if this + * element is included in an external archive + */ + IResource getResource(); + + /** + * Returns the scheduling rule associated with this JavaScript element. + * This is a handle-only method. + * + * @return the scheduling rule associated with this JavaScript element + */ + ISchedulingRule getSchedulingRule(); + + /** + * Returns the smallest underlying resource that contains + * this element, or null if this element is not contained + * in a resource. + * + * @return the underlying resource, or null if none + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its underlying resource + */ + IResource getUnderlyingResource() throws JavaScriptModelException; + + /** + * Returns whether this JavaScript element is read-only. An element is read-only + * if its structure cannot be modified by the java model. + *

+ * Note this is different from IResource.isReadOnly(). For example, .jar + * files are read-only as the javaScript model doesn't know how to add/remove + * elements in this file, but the underlying IFile can be writable. + *

+ * This is a handle-only method. + * + * @return true if this element is read-only + */ + boolean isReadOnly(); + + /** + * Returns whether the structure of this element is known. For example, for a + * javaScript file that could not be parsed, false is returned. + * If the structure of an element is unknown, navigations will return reasonable + * defaults. For example, getChildren will return an empty collection. + *

+ * Note: This does not imply anything about consistency with the + * underlying resource/buffer contents. + *

+ * + * @return true if the structure of this element is known + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + */ + boolean isStructureKnown() throws JavaScriptModelException; + /** + * Returns a readable (non mangled) name. In virtual elements this is derived from a JsGlobalScopeContainerInitializer + * + * @return a human friendly element name. + */ + String getDisplayName(); + /** + * Returns if this is a virtual element (ie actually exists in the model or filesystem). + * + * @return if this is a virtual element. + */ + boolean isVirtual(); + + /** + * If a resource is virtual, then return a real host path for the element. (Query the container initializer). + * + * @return if this is a virtual element. + */ + URI getHostPath(); + + /** + * Returns the Super type this file is considered to be a member of. For Browser base javaScript, this would be "Window". + * + * @return the supertype for the javascript file. + */ + LibrarySuperType getCommonSuperType(); + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptElementDelta.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptElementDelta.java new file mode 100644 index 0000000..28193cb --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptElementDelta.java @@ -0,0 +1,375 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.core.resources.IResourceDelta; +import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit; + +/** + * A JavaScript element delta describes changes in JavaScript element between two discrete + * points in time. Given a delta, clients can access the element that has + * changed, and any children that have changed. + *

+ * Deltas have a different status depending on the kind of change they represent. + * The list below summarizes each status (as returned by {@link #getKind}) + * and its meaning (see individual constants for a more detailled description): + *

    + *
  • {@link #ADDED} - The element described by the delta has been added.
  • + *
  • {@link #REMOVED} - The element described by the delta has been removed.
  • + *
  • {@link #CHANGED} - The element described by the delta has been changed in some way. + * Specification of the type of change is provided by {@link #getFlags} which returns the following values: + *
      + *
    • {@link #F_ADDED_TO_CLASSPATH} - A includepath entry corresponding to the element + * has been added to the project's includepath. This flag is only valid if the element is an + * {@link IPackageFragmentRoot}.
    • + *
    • {@link #F_ARCHIVE_CONTENT_CHANGED} - The contents of an archive + * has changed in some way. This flag is only valid if the element is an {@link IPackageFragmentRoot} + * which is an archive.
    • + *
    • {@link #F_CHILDREN} - A child of the element has changed in some way. This flag + * is only valid if the element is an {@link IParent}.
    • + *
    • {@link #F_INCLUDEPATH_REORDER} - A Includepath entry corresponding to the element + * has changed position in the project's Includepath. This flag is only valid if the element is an + * {@link IPackageFragmentRoot}.
    • + *
    • {@link #F_CLOSED} - The underlying {@link org.eclipse.core.resources.IProject} + * has been closed. This flag is only valid if the element is an {@link IJavaScriptProject}.
    • + *
    • {@link #F_CONTENT} - The contents of the element have been altered. This flag + * is only valid for elements which correspond to files.
    • + *
    • {@link #F_FINE_GRAINED} - The delta is a fine-grained delta, that is, an analysis down + * to the members level was done to determine if there were structural changes to members of the element.
    • + *
    • {@link #F_MODIFIERS} - The modifiers on the element have changed in some way. + * This flag is only valid if the element is an {@link IMember}.
    • + *
    • {@link #F_OPENED} - The underlying {@link org.eclipse.core.resources.IProject} + * has been opened. This flag is only valid if the element is an {@link IJavaScriptProject}.
    • + *
    • {@link #F_REMOVED_FROM_CLASSPATH} - A includepath entry corresponding to the element + * has been removed from the project's includepath. This flag is only valid if the element is an + * {@link IPackageFragmentRoot}.
    • + *
    • {@link #F_SOURCEATTACHED} - The source attachment path or the source attachment root path + * of a includepath entry corresponding to the element was added. This flag is only valid if the element is an + * {@link IPackageFragmentRoot}.
    • + *
    • {@link #F_SOURCEDETACHED} - The source attachment path or the source attachment root path + * of a includepath entry corresponding to the element was removed. This flag is only valid if the element is an + * {@link IPackageFragmentRoot}.
    • + *
    • {@link #F_SUPER_TYPES} - One of the supertypes of an {@link IType} has changed
    • . + *
    + *
  • + *
+ *

+ *

+ * Move operations are indicated by other change flags, layered on top + * of the change flags described above. If element A is moved to become B, + * the delta for the change in A will have status {@link #REMOVED}, + * with change flag {@link #F_MOVED_TO}. In this case, + * {@link #getMovedToElement} on delta A will return the handle for B. + * The delta for B will have status {@link #ADDED}, with change flag + * {@link #F_MOVED_FROM}, and {@link #getMovedFromElement} on delta + * B will return the handle for A. (Note, the handle to A in this case represents + * an element that no longer exists). + *

+ *

+ * Note that the move change flags only describe the changes to a single element, they + * do not imply anything about the parent or children of the element. + *

+ *

+ * The {@link #F_ADDED_TO_CLASSPATH}, {@link #F_REMOVED_FROM_CLASSPATH} and + * {@link #F_INCLUDEPATH_REORDER} flags are triggered by changes to a project's includepath. They do not mean that + * the underlying resource was added, removed or changed. For example, if a project P already contains a folder src, then + * adding a includepath entry with the 'P/src' path to the project's includepath will result in an {@link IJavaScriptElementDelta} + * with the {@link #F_ADDED_TO_CLASSPATH} flag for the {@link IPackageFragmentRoot} P/src. + * On the contrary, if a resource is physically added, removed or changed and this resource corresponds to a includepath + * entry of the project, then an {@link IJavaScriptElementDelta} with the {@link #ADDED}, + * {@link #REMOVED}, or {@link #CHANGED} kind will be fired. + *

+ *

+ * Note that when a source attachment path or a source attachment root path is changed, then the flags of the delta contain + * both {@link #F_SOURCEATTACHED} and {@link #F_SOURCEDETACHED}. + *

+ *

+ * No assumptions should be made on whether the javaScript element delta tree is rooted at the {@link IJavaScriptModel} + * level or not. + *

+ *

+ * {@link IJavaScriptElementDelta} object are not valid outside the dynamic scope + * of the notification. + *

+ *

+ * This interface is not intended to be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IJavaScriptElementDelta { + + /** + * Status constant indicating that the element has been added. + * Note that an added javaScript element delta has no children, as they are all implicitely added. + */ + public int ADDED = 1; + + /** + * Status constant indicating that the element has been removed. + * Note that a removed javaScript element delta has no children, as they are all implicitely removed. + */ + public int REMOVED = 2; + + /** + * Status constant indicating that the element has been changed, + * as described by the change flags. + * + * @see #getFlags() + */ + public int CHANGED = 4; + + /** + * Change flag indicating that the content of the element has changed. + * This flag is only valid for elements which correspond to files. + */ + public int F_CONTENT = 0x000001; + + /** + * Change flag indicating that the modifiers of the element have changed. + * This flag is only valid if the element is an {@link IMember}. + */ + public int F_MODIFIERS = 0x000002; + + /** + * Change flag indicating that there are changes to the children of the element. + * This flag is only valid if the element is an {@link IParent}. + */ + public int F_CHILDREN = 0x000008; + + /** + * Change flag indicating that the element was moved from another location. + * The location of the old element can be retrieved using {@link #getMovedFromElement}. + */ + public int F_MOVED_FROM = 0x000010; + + /** + * Change flag indicating that the element was moved to another location. + * The location of the new element can be retrieved using {@link #getMovedToElement}. + */ + public int F_MOVED_TO = 0x000020; + + /** + * Change flag indicating that a includepath entry corresponding to the element has been added to the project's includepath. + * This flag is only valid if the element is an {@link IPackageFragmentRoot}. + */ + public int F_ADDED_TO_CLASSPATH = 0x000040; + + /** + * Change flag indicating that a includepath entry corresponding to the element has been removed from the project's + * includepath. This flag is only valid if the element is an {@link IPackageFragmentRoot}. + */ + public int F_REMOVED_FROM_CLASSPATH = 0x000080; + + /** + * Change flag indicating that the element has changed position relatively to its siblings. + * If the element is an {@link IPackageFragmentRoot}, a includepath entry corresponding + * to the element has changed position in the project's includepath. + * + */ + public int F_REORDER = 0x000100; + + /** + * Change flag indicating that the underlying {@link org.eclipse.core.resources.IProject} has been + * opened. This flag is only valid if the element is an {@link IJavaScriptProject}. + */ + public int F_OPENED = 0x000200; + + /** + * Change flag indicating that the underlying {@link org.eclipse.core.resources.IProject} has been + * closed. This flag is only valid if the element is an {@link IJavaScriptProject}. + */ + public int F_CLOSED = 0x000400; + + /** + * Change flag indicating that one of the supertypes of an {@link IType} + * has changed. + */ + public int F_SUPER_TYPES = 0x000800; + + /** + * Change flag indicating that the source attachment path or the source attachment root path of a includepath entry + * corresponding to the element was added. This flag is only valid if the element is an + * {@link IPackageFragmentRoot}. + */ + public int F_SOURCEATTACHED = 0x001000; + + /** + * Change flag indicating that the source attachment path or the source attachment root path of a includepath entry + * corresponding to the element was removed. This flag is only valid if the element is an + * {@link IPackageFragmentRoot}. + */ + public int F_SOURCEDETACHED = 0x002000; + + /** + * Change flag indicating that this is a fine-grained delta, that is, an analysis down + * to the members level was done to determine if there were structural changes to + * members. + *

+ * Clients can use this flag to find out if a javaScript unit + * that have a {@link #F_CONTENT} change should assume that there are + * no finer grained changes ({@link #F_FINE_GRAINED} is set) or if + * finer grained changes were not considered ({@link #F_FINE_GRAINED} + * is not set). + * + */ + public int F_FINE_GRAINED = 0x004000; + + /** + * Change flag indicating that the element's archive content on the includepath has changed. + * This flag is only valid if the element is an {@link IPackageFragmentRoot} + * which is an archive. + * + * @see IPackageFragmentRoot#isArchive() + */ + public int F_ARCHIVE_CONTENT_CHANGED = 0x008000; + + /** + * Change flag indicating that a javaScript unit has become a primary working copy, or that a + * primary working copy has reverted to a javaScript unit. + * This flag is only valid if the element is an {@link IJavaScriptUnit}. + * + */ + public int F_PRIMARY_WORKING_COPY = 0x010000; + + /** + * Change flag indicating that the raw includepath (or the output folder) of a project has changed. + * This flag is only valid if the element is an {@link IJavaScriptProject}. + * + */ + public int F_INCLUDEPATH_CHANGED = 0x020000; + + /** + * Change flag indicating that the resource of a primary javaScript unit has changed. + * This flag is only valid if the element is a primary {@link IJavaScriptUnit}. + * + */ + public int F_PRIMARY_RESOURCE = 0x040000; + + /** + * Change flag indicating that a reconcile operation has affected the javaScript unit AST created in a + * previous reconcile operation. Use {@link #getJavaScriptUnitAST()} to retrieve the AST (if any is available). + * This flag is only valid if the element is an {@link IJavaScriptUnit} in working copy mode. + * + */ + public int F_AST_AFFECTED = 0x080000; + + /** + * Change flag indicating that the categories of the element have changed. + * This flag is only valid if the element is an {@link IMember}. + * + */ + public int F_CATEGORIES = 0x100000; + + /** + * Returns deltas for the children that have been added. + * @return deltas for the children that have been added + */ + public IJavaScriptElementDelta[] getAddedChildren(); + + /** + * Returns deltas for the affected (added, removed, or changed) children. + * @return deltas for the affected (added, removed, or changed) children + */ + public IJavaScriptElementDelta[] getAffectedChildren(); + + /** + * Returns the javaScript unit AST created by the last reconcile operation on this delta's element. + * This returns a non-null value if and only if: + *

    + *
  • the last reconcile operation on this working copy requested an AST
  • + *
  • this delta's element is an {@link IJavaScriptUnit} in working copy mode
  • + *
  • the delta comes from a {@link ElementChangedEvent#POST_RECONCILE} event + *
+ * + * @return the AST created during the last reconcile operation + * @see IJavaScriptUnit#reconcile(int, boolean, WorkingCopyOwner, org.eclipse.core.runtime.IProgressMonitor) + * @see #F_AST_AFFECTED + */ + public JavaScriptUnit getJavaScriptUnitAST(); + + /** + * Returns deltas for the children which have changed. + * @return deltas for the children which have changed + */ + public IJavaScriptElementDelta[] getChangedChildren(); + + /** + * Returns the element that this delta describes a change to. + * @return the element that this delta describes a change to + */ + public IJavaScriptElement getElement(); + + /** + * Returns flags that describe how an element has changed. + * Such flags should be tested using the & operand. For example: + *
+	 * if ((delta.getFlags() & IJavaScriptElementDelta.F_CONTENT) != 0) {
+	 * 	// the delta indicates a content change
+	 * }
+	 * 
+ * + * @return flags that describe how an element has changed + */ + public int getFlags(); + + /** + * Returns the kind of this delta - one of {@link #ADDED}, {@link #REMOVED}, + * or {@link #CHANGED}. + * + * @return the kind of this delta + */ + public int getKind(); + + /** + * Returns an element describing this element before it was moved + * to its current location, or null if the + * {@link #F_MOVED_FROM} change flag is not set. + * + * @return an element describing this element before it was moved + * to its current location, or null if the + * {@link #F_MOVED_FROM} change flag is not set + */ + public IJavaScriptElement getMovedFromElement(); + + /** + * Returns an element describing this element in its new location, + * or null if the {@link #F_MOVED_TO} change + * flag is not set. + * + * @return an element describing this element in its new location, + * or null if the {@link #F_MOVED_TO} change + * flag is not set + */ + public IJavaScriptElement getMovedToElement(); + + /** + * Returns deltas for the children which have been removed. + * + * @return deltas for the children which have been removed + */ + public IJavaScriptElementDelta[] getRemovedChildren(); + + /** + * Returns the collection of resource deltas. + *

+ * Note that resource deltas, like JavaScript element deltas, are generally only valid + * for the dynamic scope of an event notification. Clients must not hang on to + * these objects. + *

+ * + * @return the underlying resource deltas, or null if none + */ + public IResourceDelta[] getResourceDeltas(); +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptModel.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptModel.java new file mode 100644 index 0000000..0b75e73 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptModel.java @@ -0,0 +1,260 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IWorkspace; +import org.eclipse.core.runtime.IProgressMonitor; + +/** + * Represent the root JavaScript element corresponding to the workspace. + * Since there is only one such root element, it is commonly referred to as + * the JavaScript model element. + * The JavaScript model element needs to be opened before it can be navigated or manipulated. + * The JavaScript model element has no parent (it is the root of the JavaScript element + * hierarchy). Its children are IJavaScriptProjects. + *

+ * This interface provides methods for performing copy, move, rename, and + * delete operations on multiple JavaScript elements. + *

+ *

+ * This interface is not intended to be implemented by clients. An instance + * of one of these handles can be created via + * JavaScriptCore.create(workspace.getRoot()). + *

+ * + * @see JavaScriptCore#create(org.eclipse.core.resources.IWorkspaceRoot) + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IJavaScriptModel extends IJavaScriptElement, IOpenable, IParent { +/** + * Returns whether this JavaScript model contains an IJavaScriptElement whose + * resource is the given resource or a non-JavaScript resource which is the given resource. + *

+ * Note: no existency check is performed on the argument resource. If it is not accessible + * (see IResource.isAccessible()) yet but would be located in JavaScript model + * range, then it will return true. + *

+ * If the resource is accessible, it can be reached by navigating the JavaScript model down using the + * getChildren() and/or getNonJavaResources() methods. + *

+ * @param resource the resource to check + * @return true if the resource is accessible through the JavaScript model + */ +boolean contains(IResource resource); +/** + * Copies the given elements to the specified container(s). + * If one container is specified, all elements are copied to that + * container. If more than one container is specified, the number of + * elements and containers must match, and each element is copied to + * its associated container. + *

+ * Optionally, each copy can positioned before a sibling + * element. If null is specified for a given sibling, the copy + * is inserted as the last child of its associated container. + *

+ *

+ * Optionally, each copy can be renamed. If + * null is specified for the new name, the copy + * is not renamed. + *

+ *

+ * Optionally, any existing child in the destination container with + * the same name can be replaced by specifying true for + * force. Otherwise an exception is thrown in the event that a name + * collision occurs. + *

+ * + * @param elements the elements to copy + * @param containers the container, or list of containers + * @param siblings the list of siblings element any of which may be + * null; or null + * @param renamings the list of new names any of which may be + * null; or null + * @param replace true if any existing child in a target container + * with the target name should be replaced, and false to throw an + * exception in the event of a name collision + * @param monitor a progress monitor + * @exception JavaScriptModelException if an element could not be copied. Reasons include: + *
    + *
  • There is no element to process (NO_ELEMENTS_TO_PROCESS). The given elements is null or empty
  • + *
  • A specified element, container, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A CoreException occurred while updating an underlying resource
  • + *
  • A container is of an incompatible type (INVALID_DESTINATION)
  • + *
  • A sibling is not a child of it associated container (INVALID_SIBLING)
  • + *
  • A new name is invalid (INVALID_NAME)
  • + *
  • A child in its associated container already exists with the same + * name and replace has been specified as false (NAME_COLLISION)
  • + *
  • A container or element is read-only (READ_ONLY)
  • + *
+ */ +void copy(IJavaScriptElement[] elements, IJavaScriptElement[] containers, IJavaScriptElement[] siblings, String[] renamings, boolean replace, IProgressMonitor monitor) throws JavaScriptModelException; +/** + * Deletes the given elements, forcing the operation if necessary and specified. + * + * @param elements the elements to delete + * @param force a flag controlling whether underlying resources that are not + * in sync with the local file system will be tolerated + * @param monitor a progress monitor + * @exception JavaScriptModelException if an element could not be deleted. Reasons include: + *
    + *
  • There is no element to process (NO_ELEMENTS_TO_PROCESS). The given elements is null or empty
  • + *
  • A specified element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A CoreException occurred while updating an underlying resource
  • + *
  • An element is read-only (READ_ONLY)
  • + *
+ */ +void delete(IJavaScriptElement[] elements, boolean force, IProgressMonitor monitor) throws JavaScriptModelException; +/** + * Returns the JavaScript project with the given name. This is a handle-only method. + * The project may or may not exist. + * + * @param name the name of the JavaScript project + * @return the JavaScript project with the given name + */ +IJavaScriptProject getJavaScriptProject(String name); +/** + * Returns the JavaScript projects in this JavaScript model, or an empty array if there + * are none. + * + * @return the JavaScript projects in this JavaScript model, or an empty array if there + * are none + * @exception JavaScriptModelException if this request fails. + */ +IJavaScriptProject[] getJavaScriptProjects() throws JavaScriptModelException; +/** + * Returns an array of non-JavaScript resources (that is, non-JavaScript projects) in + * the workspace. + *

+ * Non-JavaScript projects include all projects that are closed (even if they have the + * JavaScript nature). + *

+ * + * @return an array of non-JavaScript projects (IProjects) contained + * in the workspace. + * @throws JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + */ +Object[] getNonJavaScriptResources() throws JavaScriptModelException; +/** + * Returns the workspace associated with this JavaScript model. + * + * @return the workspace associated with this JavaScript model + */ +IWorkspace getWorkspace(); +/** + * Moves the given elements to the specified container(s). + * If one container is specified, all elements are moved to that + * container. If more than one container is specified, the number of + * elements and containers must match, and each element is moved to + * its associated container. + *

+ * Optionally, each element can positioned before a sibling + * element. If null is specified for sibling, the element + * is inserted as the last child of its associated container. + *

+ *

+ * Optionally, each element can be renamed. If + * null is specified for the new name, the element + * is not renamed. + *

+ *

+ * Optionally, any existing child in the destination container with + * the same name can be replaced by specifying true for + * force. Otherwise an exception is thrown in the event that a name + * collision occurs. + *

+ * + * @param elements the elements to move + * @param containers the container, or list of containers + * @param siblings the list of siblings element any of which may be + * null; or null + * @param renamings the list of new names any of which may be + * null; or null + * @param replace true if any existing child in a target container + * with the target name should be replaced, and false to throw an + * exception in the event of a name collision + * @param monitor a progress monitor + * @exception JavaScriptModelException if an element could not be moved. Reasons include: + *
    + *
  • There is no element to process (NO_ELEMENTS_TO_PROCESS). The given elements is null or empty
  • + *
  • A specified element, container, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A CoreException occurred while updating an underlying resource
  • + *
  • A container is of an incompatible type (INVALID_DESTINATION)
  • + *
  • A sibling is not a child of it associated container (INVALID_SIBLING)
  • + *
  • A new name is invalid (INVALID_NAME)
  • + *
  • A child in its associated container already exists with the same + * name and replace has been specified as false (NAME_COLLISION)
  • + *
  • A container or element is read-only (READ_ONLY)
  • + *
+ * + * @exception IllegalArgumentException any element or container is null + */ +void move(IJavaScriptElement[] elements, IJavaScriptElement[] containers, IJavaScriptElement[] siblings, String[] renamings, boolean replace, IProgressMonitor monitor) throws JavaScriptModelException; + +/** + * Triggers an update of the JavaScriptModel with respect to the referenced external archives. + * This operation will issue a JavaScriptModel delta describing the discovered changes, in term + * of JavaScript element package fragment roots added, removed or changed. + * Note that a collection of elements can be passed so as to narrow the set of archives + * to refresh (passing null along is equivalent to refreshing the entire mode). + * The elements can be: + *
    + *
  • package fragment roots corresponding to external archives + *
  • JavaScript projects, which referenced external archives will be refreshed + *
  • JavaScript model, all referenced external archives will be refreshed. + *
+ *

In case an archive is used by multiple projects, the delta issued will account for + * all of them. This means that even if a project was not part of the elements scope, it + * may still be notified of changes if it is referencing a library comprised in the scope. + *

+ * @param elementsScope - a collection of elements defining the scope of the refresh + * @param monitor - a progress monitor used to report progress + * @exception JavaScriptModelException in one of the corresponding situation: + *

    + *
  • an exception occurs while accessing project resources
  • + *
+ * + * @see IJavaScriptElementDelta + */ +void refreshExternalArchives(IJavaScriptElement[] elementsScope, IProgressMonitor monitor) throws JavaScriptModelException; + +/** + * Renames the given elements as specified. + * If one container is specified, all elements are renamed within that + * container. If more than one container is specified, the number of + * elements and containers must match, and each element is renamed within + * its associated container. + * + * @param elements the elements to rename + * @param destinations the container, or list of containers + * @param names the list of new names + * @param replace true if an existing child in a target container + * with the target name should be replaced, and false to throw an + * exception in the event of a name collision + * @param monitor a progress monitor + * @exception JavaScriptModelException if an element could not be renamed. Reasons include: + *
    + *
  • There is no element to process (NO_ELEMENTS_TO_PROCESS). The given elements is null or empty
  • + *
  • A specified element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A CoreException occurred while updating an underlying resource + *
  • A new name is invalid (INVALID_NAME) + *
  • A child already exists with the same name and replace has been specified as false (NAME_COLLISION) + *
  • An element is read-only (READ_ONLY) + *
+ */ +void rename(IJavaScriptElement[] elements, IJavaScriptElement[] destinations, String[] names, boolean replace, IProgressMonitor monitor) throws JavaScriptModelException; + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptModelMarker.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptModelMarker.java new file mode 100644 index 0000000..7089373 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptModelMarker.java @@ -0,0 +1,111 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +/** + * Markers used by the JavaScript model. + *

+ * This interface declares constants only; it is not intended to be implemented + * or extended. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IJavaScriptModelMarker { + + /** + * JavaScript model problem marker type (value + * "org.eclipse.wst.jsdt.core.problem"). This can be used to + * recognize those markers in the workspace that flag problems detected by + * the JavaScript tooling during validation. + */ + String JAVASCRIPT_MODEL_PROBLEM_MARKER = JavaScriptCore.PLUGIN_ID + ".problem"; //$NON-NLS-1$ + + /** + * JavaScript model transient problem marker type (value + * "org.eclipse.wst.jsdt.core.transient_problem"). This can be + * used to recognize those markers in the workspace that flag transient + * problems detected by the JavaScript tooling (such as a problem detected by the + * outliner, or a problem detected during a code completion). Since 1.0, + * transient problems are reported as IProblem through + * various API. Only the evaluation API is still producing markers for + * transient problems. + * + * @see org.eclipse.wst.jsdt.core.compiler.IProblem + * @see org.eclipse.wst.jsdt.core.eval.ICodeSnippetRequestor#acceptProblem(org.eclipse.core.resources.IMarker,String, + * int) + */ + String TRANSIENT_PROBLEM = JavaScriptCore.PLUGIN_ID + ".transient_problem"; //$NON-NLS-1$ + + /** + * JavaScript model task marker type (value + * "org.eclipse.wst.jsdt.core.task"). This can be used to + * recognize task markers in the workspace that correspond to tasks + * specified in JavaScript source comments and detected during compilation (for + * example, 'TO-DO: ...'). Tasks are identified by a task tag, which can be + * customized through JavaScriptCore option + * "org.eclipse.wst.jsdt.core.compiler.taskTag". + * + */ + String TASK_MARKER = JavaScriptCore.PLUGIN_ID + ".task"; //$NON-NLS-1$ + + /** + * Id marker attribute (value "arguments"). Arguments are + * concatenated into one String, prefixed with an argument count (followed + * with colon separator) and separated with '#' characters. For example: { + * "foo", "bar" } is encoded as "2:foo#bar", { } is encoded as "0: " + * + */ + String ARGUMENTS = "arguments"; //$NON-NLS-1$ + + /** + * ID marker attribute (value "id"). + */ + String ID = "id"; //$NON-NLS-1$ + + /** + * ID category marker attribute (value "categoryId") + */ + String CATEGORY_ID = "categoryId"; //$NON-NLS-1$ + + /** + * Flags marker attribute (value "flags"). Reserved for + * future use. + */ + String FLAGS = "flags"; //$NON-NLS-1$ + + /** + * Cycle detected marker attribute (value "cycleDetected"). + * Used only on buildpath problem markers. The value of this attribute is + * either "true" or "false". + */ + String CYCLE_DETECTED = "cycleDetected"; //$NON-NLS-1$ + + /** + * Include path problem marker type (value + * "org.eclipse.wst.jsdt.core.buildpath_problem"). This can be + * used to recognize those markers in the workspace that flag problems + * detected by the JavaScript tooling during includepath setting. + */ + String BUILDPATH_PROBLEM_MARKER = JavaScriptCore.PLUGIN_ID + + ".buildpath_problem"; //$NON-NLS-1$ + + /** + * IncludePath file format marker attribute (value + * "classpathFileFormat"). Used only on includepath problem + * markers. The value of this attribute is either "true" or "false". + * + */ + String INCLUDEPATH_FILE_FORMAT = "classpathFileFormat"; //$NON-NLS-1$ +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptModelStatus.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptModelStatus.java new file mode 100644 index 0000000..49d7e7c --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptModelStatus.java @@ -0,0 +1,78 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IStatus; + +/** + * Represents the outcome of an JavaScript model operation. Status objects are + * used inside JavaScriptModelException objects to indicate what went + * wrong. + *

+ * JavaScript model status object are distinguished by their plug-in id: + * getPlugin returns "org.eclipse.wst.jsdt.core". + * getCode returns one of the status codes declared in + * IJavaScriptModelStatusConstants. + *

+ *

+ * A JavaScript model status may also carry additional information (that is, in + * addition to the information defined in IStatus): + *

    + *
  • elements - optional handles to JavaScript elements associated with the failure
  • + *
  • string - optional string associated with the failure
  • + *
+ *

+ * This interface is not intended to be implemented by clients. + *

+ * + * @see org.eclipse.core.runtime.IStatus + * @see IJavaScriptModelStatusConstants + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IJavaScriptModelStatus extends IStatus { +/** + * Returns any JavaScript elements associated with the failure (see specification + * of the status code), or an empty array if no elements are related to this + * particular status code. + * + * @return the list of JavaScript element culprits + * @see IJavaScriptModelStatusConstants + */ +IJavaScriptElement[] getElements(); +/** + * Returns the path associated with the failure (see specification + * of the status code), or null if the failure is not + * one of DEVICE_PATH, INVALID_PATH, + * PATH_OUTSIDE_PROJECT, or RELATIVE_PATH. + * + * @return the path that caused the failure, or null if none + * @see IJavaScriptModelStatusConstants#DEVICE_PATH + * @see IJavaScriptModelStatusConstants#INVALID_PATH + * @see IJavaScriptModelStatusConstants#PATH_OUTSIDE_PROJECT + * @see IJavaScriptModelStatusConstants#RELATIVE_PATH + */ +IPath getPath(); +/** + * Returns whether this status indicates that a JavaScript model element does not exist. + * This convenience method is equivalent to + * getCode() == IJavaScriptModelStatusConstants.ELEMENT_DOES_NOT_EXIST. + * + * @return true if the status code indicates that a JavaScript model + * element does not exist + * @see IJavaScriptModelStatusConstants#ELEMENT_DOES_NOT_EXIST + */ +boolean isDoesNotExist(); +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptModelStatusConstants.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptModelStatusConstants.java new file mode 100644 index 0000000..39e76ac --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptModelStatusConstants.java @@ -0,0 +1,319 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * + * TODO missing 2.1 and subsequent contributions + * VALIDATION_FAILURE + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +/** + * Status codes used with JavaScript model status objects. + *

+ * This interface declares constants only; it is not intended to be implemented + * or extended. + *

+ * + * @see IJavaScriptModelStatus + * @see org.eclipse.core.runtime.IStatus#getCode() + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IJavaScriptModelStatusConstants { + + /** + * Status constant indicating that a container path was resolved + * to invalid entries (null or container). + */ + public static final int INVALID_CP_CONTAINER_ENTRY = 962; + + /** + * Status constant indicating that a container path was not resolvable + * indicating either the referred container is undefined, unbound. + */ + public static final int CP_CONTAINER_PATH_UNBOUND = 963; + + /** + * Status constant indicating that a includepath entry was invalid + */ + public static final int INVALID_INCLUDEPATH = 964; + + /** + * Status constant indicating that a variable path was not resolvable + * indicating either the referred variable is undefined, unbound or the resolved + * variable path does not correspond to an existing file or folder. + */ + public static final int CP_VARIABLE_PATH_UNBOUND = 965; + + /** + * Status constant indicating a core exception occurred. + * Use getException to retrieve a CoreException. + */ + public static final int CORE_EXCEPTION = 966; + + /** + * Status constant indicating one or more of the elements + * supplied are not of a valid type for the operation to + * process. + * The element(s) can be retrieved using getElements on the status object. + */ + public static final int INVALID_ELEMENT_TYPES = 967; + + /** + * Status constant indicating that no elements were + * provided to the operation for processing. + */ + public static final int NO_ELEMENTS_TO_PROCESS = 968; + + /** + * Status constant indicating that one or more elements + * supplied do not exist. + * The element(s) can be retrieved using getElements on the status object. + * + * @see IJavaScriptModelStatus#isDoesNotExist() + */ + public static final int ELEMENT_DOES_NOT_EXIST = 969; + + /** + * Status constant indicating that a null path was + * supplied to the operation. + */ + public static final int NULL_PATH = 970; + + /** + * Status constant indicating that a path outside of the + * project was supplied to the operation. The path can be retrieved using + * getPath on the status object. + */ + public static final int PATH_OUTSIDE_PROJECT = 971; + + /** + * Status constant indicating that a relative path + * was supplied to the operation when an absolute path is + * required. The path can be retrieved using getPath on the + * status object. + */ + public static final int RELATIVE_PATH = 972; + + /** + * Status constant indicating that a path specifying a device + * was supplied to the operation when a path with no device is + * required. The path can be retrieved using getPath on the + * status object. + */ + public static final int DEVICE_PATH = 973; + + /** + * Status constant indicating that a string + * was supplied to the operation that was null. + */ + public static final int NULL_STRING = 974; + + /** + * Status constant indicating that the operation encountered + * a read-only element. + * The element(s) can be retrieved using getElements on the status object. + */ + public static final int READ_ONLY = 976; + + /** + * Status constant indicating that a naming collision would occur + * if the operation proceeded. + */ + public static final int NAME_COLLISION = 977; + + /** + * Status constant indicating that a destination provided for a copy/move/rename operation + * is invalid. + * The destination element can be retrieved using getElements on the status object. + */ + public static final int INVALID_DESTINATION = 978; + + /** + * Status constant indicating that a path provided to an operation + * is invalid. The path can be retrieved using getPath on the + * status object. + */ + public static final int INVALID_PATH = 979; + + /** + * Status constant indicating the given source position is out of bounds. + */ + public static final int INDEX_OUT_OF_BOUNDS = 980; + + /** + * Status constant indicating there is an update conflict + * for a working copy. The compilation unit on which the + * working copy is based has changed since the working copy + * was created. + */ + public static final int UPDATE_CONFLICT = 981; + + /** + * Status constant indicating that null was specified + * as a name argument. + */ + public static final int NULL_NAME = 982; + + /** + * Status constant indicating that a name provided is not syntactically correct. + * The name can be retrieved from getString. + */ + public static final int INVALID_NAME = 983; + + /** + * Status constant indicating that the specified contents + * are not valid. + */ + public static final int INVALID_CONTENTS = 984; + + /** + * Status constant indicating that an java.io.IOException + * occurred. + */ + public static final int IO_EXCEPTION = 985; + + /** + * Status constant indicating that a DOMException + * occurred. + */ + public static final int DOM_EXCEPTION = 986; + + /** + * Status constant indicating that a TargetException + * occurred. + */ + public static final int TARGET_EXCEPTION = 987; + + /** + * Status constant indicating that the JavaScript validator + * could not be initialized. + */ + public static final int BUILDER_INITIALIZATION_ERROR = 990; + + /** + * Status constant indicating that the JavaScript validator's last built state + * could not be serialized or deserialized. + */ + public static final int BUILDER_SERIALIZATION_ERROR = 991; + + /** + * Status constant indicating that an error was encountered while + * trying to evaluate a code snippet, or other item. + */ + public static final int EVALUATION_ERROR = 992; + + /** + * Status constant indicating that a sibling specified is not valid. + */ + public static final int INVALID_SIBLING = 993; + + /** + * Status indicating that a JavaScript element could not be created because + * the underlying resource is invalid. + * @see JavaScriptCore + */ + public static final int INVALID_RESOURCE = 995; + + /** + * Status indicating that a JavaScript element could not be created because + * the underlying resource is not of an appropriate type. + * @see JavaScriptCore + */ + public static final int INVALID_RESOURCE_TYPE = 996; + + /** + * Status indicating that a JavaScript element could not be created because + * the project owning underlying resource does not have the JavaScript nature. + * @see JavaScriptCore + */ + public static final int INVALID_PROJECT = 997; + + /** + * Status indicating that the package declaration in a IJavaScriptUnit + * does not correspond to the IPackageFragment it belongs to. + * The getString method of the associated status object + * gives the name of the package in which the IJavaScriptUnit is + * declared. + */ + public static final int INVALID_PACKAGE = 998; + + /** + * Status indicating that the corresponding resource has no local contents yet. + * This might happen when attempting to use a resource before its contents + * has been made locally available. + */ + public static final int NO_LOCAL_CONTENTS = 999; + + /** + * Status indicating that a .jsdtScope file is ill-formed, and thus cannot + * be read/written successfully. + */ + public static final int INVALID_INCLUDEPATH_FILE_FORMAT = 1000; + + /** + * Status indicating that a project is involved in a build path cycle. + */ + public static final int INCLUDEPATH_CYCLE = 1001; + + /** + * Status constant indicating that an inclusion or an exclusion pattern got specified + * on a includepath source entry, though it was explicitely disabled + * according to its project preference settings. + * @see org.eclipse.wst.jsdt.core.IJavaScriptProject#getOptions(boolean) + */ + public static final int DISABLED_CP_EXCLUSION_PATTERNS = 1002; + + /** + * Status constant indicating that a specific output location got associated + * with a source entry, though it was explicitely disabled according to its project + * preference settings. + * @see org.eclipse.wst.jsdt.core.IJavaScriptProject#getOptions(boolean) + */ + public static final int DISABLED_CP_MULTIPLE_OUTPUT_LOCATIONS = 1003; + + /* + * Status constant indicating that a project is prerequisiting some library for which the + * classfile JDK version level is more recent than the project JDK target level setting. + * This can indicate some binary incompatibility issues later on. + */ + public static final int INCOMPATIBLE_JDK_LEVEL = 1004; + + /** + * Status constant indicating that a validation failure occurred. + */ + public static final int VALIDATION_FAILURE = 1005; + /** + * Status constant indicating that an element is not on its project's includepath. + */ + public static final int ELEMENT_NOT_ON_CLASSPATH = 1006; + /* + * Status constant indicating that a compiler option is invalid. + */ +// public static final int INVALID_COMPILER_OPTION = 1007; + /** + *

Status constant indicating that the attached jsdoc content cannot be retrieved due to multiple reasons: + * invalid url, timed-out,...

+ * + */ + public static final int CANNOT_RETRIEVE_ATTACHED_JSDOC = 1008; + /** + *

Status constant indicating that the attached jsdoc content format is unrecognized.

+ * + */ + public static final int UNKNOWN_JSDOC_FORMAT = 1009; + /** + *

Status constant indicating that the variable is deprecated.

+ * + */ + public static final int DEPRECATED_VARIABLE = 1010; +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptProject.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptProject.java new file mode 100644 index 0000000..7f363d7 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptProject.java @@ -0,0 +1,846 @@ +/******************************************************************************* + * Copyright (c) 2000, 2010 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * IBM Corporation - added getOption(String, boolean), getOptions(boolean) and setOptions(Map) + * IBM Corporation - deprecated getPackageFragmentRoots(IIncludePathEntry) and + * added findPackageFragmentRoots(IIncludePathEntry) + * IBM Corporation - added isOnClasspath(IResource) + * IBM Corporation - added setOption(String, String) + * IBM Corporation - added forceClasspathReload(IProgressMonitor) + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import java.util.Map; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.wst.jsdt.core.eval.IEvaluationContext; + +/** + * A JavaScript project represents a view of a project resource in terms of JavaScript + * elements such as package fragments, types, methods and fields. + * A project may contain several source folders (package roots), which contain source folders (package fragments). + * A package root corresponds to an underlying folder. + *

+ * Each JavaScript project has a includepath, defining which folders contain source code and + * where required libraries are located. A project that + * references packages in another project can access the packages by including + * the required project in a includepath entry. The JavaScript model will present the + * source elements in the required project. The includepath format is a sequence of includepath entries + * describing the location and contents of package fragment roots. + *

+ * JavaScript project elements need to be opened before they can be navigated or manipulated. + * The children of a JavaScript project are the package fragment roots that are + * defined by the includepath and contained in this project (in other words, it + * does not include package fragment roots for other projects). + *

+ *

+ * This interface is not intended to be implemented by clients. An instance + * of one of these handles can be created via + * JavaScriptCore.create(project). + *

+ * + * @see JavaScriptCore#create(org.eclipse.core.resources.IProject) + * @see IIncludePathEntry + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IJavaScriptProject extends IParent, IJavaScriptElement, IOpenable { + + /* returns the projects scope file */ + IFile getJSDTScopeFile(); + + /* returns the projects scope file */ + IFile getJSDTScopeFile(boolean forceCreate); + + /** + * Decodes the includepath entry that has been encoded in the given string + * in the context of this project. + * Returns null if the encoded entry is malformed. + * + * @param encodedEntry the encoded includepath entry + * @return the decoded includepath entry, or null if unable to decode it + */ + IIncludePathEntry decodeIncludepathEntry(String encodedEntry); + + /** + * Encodes the given includepath entry into a string in the context of this project. + * + * @param includepathEntry the includepath entry to encode + * @return the encoded includepath entry + */ + String encodeIncludepathEntry(IIncludePathEntry includepathEntry); + + /** + * Returns the IJavaScriptElement corresponding to the given + * includepath-relative path, or null if no such + * IJavaScriptElement is found. The result is one of an + * IJavaScriptUnit, IClassFile, or + * IPackageFragment. + *

+ * When looking for a package fragment, there might be several potential + * matches; only one of them is returned. + * + *

For example, the path "java/lang/Object.js", would result in the + * IJavaScriptUnit or IClassFile corresponding to + * "java.lang.Object". The path "java/lang" would result in the + * IPackageFragment for "java.lang". + * @param path the given includepath-relative path + * @exception JavaScriptModelException if the given path is null + * or absolute + * @return the IJavaScriptElement corresponding to the given + * includepath-relative path, or null if no such + * IJavaScriptElement is found + */ + IJavaScriptElement findElement(IPath path) throws JavaScriptModelException; + + /** + * Returns the IJavaScriptElement corresponding to the given + * includepath-relative path, or null if no such + * IJavaScriptElement is found. The result is one of an + * IJavaScriptUnit, IClassFile, or + * IPackageFragment. If it is an IJavaScriptUnit, + * its owner is the given owner. + *

+ * When looking for a package fragment, there might be several potential + * matches; only one of them is returned. + * + *

For example, the path "java/lang/Object.js", would result in the + * IJavaScriptUnit or IClassFile corresponding to + * "java.lang.Object". The path "java/lang" would result in the + * IPackageFragment for "java.lang". + * @param path the given includepath-relative path + * @param owner the owner of the returned javaScript unit, ignored if it is + * not a javaScript unit. + * @exception JavaScriptModelException if the given path is null + * or absolute + * @return the IJavaScriptElement corresponding to the given + * includepath-relative path, or null if no such + * IJavaScriptElement is found + */ + IJavaScriptElement findElement(IPath path, WorkingCopyOwner owner) throws JavaScriptModelException; + + /** + * Returns the first existing package fragment on this project's includepath + * whose path matches the given (absolute) path, or null if none + * exist. + * The path can be: + * - internal to the workbench: "/Project/src" + * - external to the workbench: "c:/jdk/classes.zip/java/lang" + * @param path the given absolute path + * @exception JavaScriptModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the first existing package fragment on this project's includepath + * whose path matches the given (absolute) path, or null if none + * exist + */ + IPackageFragment findPackageFragment(IPath path) throws JavaScriptModelException; + + /** + * Returns the existing package fragment root on this project's includepath + * whose path matches the given (absolute) path, or null if + * one does not exist. + * The path can be: + * - internal to the workbench: "/Compiler/src" + * - external to the workbench: "c:/jdk/classes.zip" + * @param path the given absolute path + * @exception JavaScriptModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the existing package fragment root on this project's includepath + * whose path matches the given (absolute) path, or null if + * one does not exist + */ + IPackageFragmentRoot findPackageFragmentRoot(IPath path) + throws JavaScriptModelException; + /** + * Returns the existing package fragment roots identified by the given entry. + * Note that a includepath entry that refers to another project may + * have more than one root (if that project has more than on root + * containing source), and includepath entries within the current + * project identify a single root. + *

+ * If the includepath entry denotes a variable, it will be resolved and return + * the roots of the target entry (empty if not resolvable). + *

+ * If the includepath entry denotes a container, it will be resolved and return + * the roots corresponding to the set of container entries (empty if not resolvable). + * + * @param entry the given entry + * @return the existing package fragment roots identified by the given entry + * @see IJsGlobalScopeContainer + */ + IPackageFragmentRoot[] findPackageFragmentRoots(IIncludePathEntry entry); + /** + * Returns the first type found following this project's includepath + * with the given fully qualified name or null if none is found. + * The fully qualified name is a dot-separated name. For example, + * a class B defined as a member type of a class A in package x.y should have a + * the fully qualified name "x.y.A.B". + * + * Note that in order to be found, a type name (or its toplevel enclosing + * type name) must match its corresponding javaScript unit name. As a + * consequence, secondary types cannot be found using this functionality. + * To find secondary types use {@link #findType(String, IProgressMonitor)} instead. + * + * @param fullyQualifiedName the given fully qualified name + * @exception JavaScriptModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the first type found following this project's includepath + * with the given fully qualified name or null if none is found + * @see IType#getFullyQualifiedName(char) + */ + IType findType(String fullyQualifiedName) throws JavaScriptModelException; + + /** + * Returns all the types found following this project's include path with + * the given fully qualified name. The fully qualified name is a + * dot-separated name. + * + * @param fullyQualifiedName + * the given fully qualified name + * @exception JavaScriptModelException + * if this project does not exist or if an exception occurs + * while accessing its corresponding resource + * @return the types found following this project's include path with the + * given fully qualified name + * @see IType#getFullyQualifiedName(char) + */ + IType[] findTypes(String fullyQualifiedName) throws JavaScriptModelException; + + /** + * Same functionality as {@link #findType(String)} but also look for secondary + * types if given name does not match a javaScript unit name. + * + * @param fullyQualifiedName the given fully qualified name + * @param progressMonitor the progress monitor to report progress to, + * or null if no progress monitor is provided + * @exception JavaScriptModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the first type found following this project's includepath + * with the given fully qualified name or null if none is found + * @see IType#getFullyQualifiedName(char) + */ + IType findType(String fullyQualifiedName, IProgressMonitor progressMonitor) throws JavaScriptModelException; + /** + * Returns the first type found following this project's includepath + * with the given fully qualified name or null if none is found. + * The fully qualified name is a dot-separated name. For example, + * a class B defined as a member type of a class A in package x.y should have a + * the fully qualified name "x.y.A.B". + * If the returned type is part of a javaScript unit, its owner is the given + * owner. + * + * Note that in order to be found, a type name (or its toplevel enclosing + * type name) must match its corresponding javaScript unit name. As a + * consequence, secondary types cannot be found using this functionality. + * To find secondary types use {@link #findType(String, WorkingCopyOwner, IProgressMonitor)} + * instead. + * + * @param fullyQualifiedName the given fully qualified name + * @param owner the owner of the returned type's javaScript unit + * @exception JavaScriptModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the first type found following this project's includepath + * with the given fully qualified name or null if none is found + * @see IType#getFullyQualifiedName(char) + */ + IType findType(String fullyQualifiedName, WorkingCopyOwner owner) throws JavaScriptModelException; + + /** + * Returns all the types found following this project's include path with + * the given fully qualified name. The fully qualified name is a + * dot-separated name. + * + * @param fullyQualifiedName + * the given fully qualified name + * @param owner + * the owner of the returned type's javaScript unit + * @exception JavaScriptModelException + * if this project does not exist or if an exception occurs + * while accessing its corresponding resource + * @return the types found following this project's include path with the + * given fully qualified name + * @see IType#getFullyQualifiedName(char) + */ + IType[] findTypes(String fullyQualifiedName, WorkingCopyOwner owner) throws JavaScriptModelException; + /** + * Same functionality as {@link #findType(String, WorkingCopyOwner)} + * but also look for secondary types if given name does not match + * a javaScript unit name. + * + * @param fullyQualifiedName the given fully qualified name + * @param owner the owner of the returned type's javaScript unit + * @param progressMonitor the progress monitor to report progress to, + * or null if no progress monitor is provided + * @exception JavaScriptModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the first type found following this project's includepath + * with the given fully qualified name or null if none is found + * @see IType#getFullyQualifiedName(char) + */ + IType findType(String fullyQualifiedName, WorkingCopyOwner owner, IProgressMonitor progressMonitor) throws JavaScriptModelException; + /** + * Returns the first type found following this project's includepath + * with the given package name and type qualified name + * or null if none is found. + * The package name is a dot-separated name. + * The type qualified name is also a dot-separated name. For example, + * a class B defined as a member type of a class A should have the + * type qualified name "A.B". + * + * Note that in order to be found, a type name (or its toplevel enclosing + * type name) must match its corresponding javaScript unit name. As a + * consequence, secondary types cannot be found using this functionality. + * To find secondary types use {@link #findType(String, String, IProgressMonitor)} + * instead. + * + * @param packageName the given package name + * @param typeQualifiedName the given type qualified name + * @exception JavaScriptModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the first type found following this project's includepath + * with the given package name and type qualified name + * or null if none is found + * @see IType#getTypeQualifiedName(char) + */ + IType findType(String packageName, String typeQualifiedName) throws JavaScriptModelException; + /** + * Same functionality as {@link #findType(String, String)} but also look for + * secondary types if given name does not match a javaScript unit name. + * + * @param packageName the given package name + * @param typeQualifiedName the given type qualified name + * @param progressMonitor the progress monitor to report progress to, + * or null if no progress monitor is provided + * @exception JavaScriptModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the first type found following this project's includepath + * with the given fully qualified name or null if none is found + * @see IType#getFullyQualifiedName(char) + */ + IType findType(String packageName, String typeQualifiedName, IProgressMonitor progressMonitor) throws JavaScriptModelException; + /** + * Returns the first type found following this project's includepath + * with the given package name and type qualified name + * or null if none is found. + * The package name is a dot-separated name. + * The type qualified name is also a dot-separated name. For example, + * a class B defined as a member type of a class A should have the + * type qualified name "A.B". + * If the returned type is part of a javaScript unit, its owner is the given + * owner. + * + * Note that in order to be found, a type name (or its toplevel enclosing + * type name) must match its corresponding javaScript unit name. As a + * consequence, secondary types cannot be found using this functionality. + * To find secondary types use {@link #findType(String, String, WorkingCopyOwner, IProgressMonitor)} + * instead. + * + * @param packageName the given package name + * @param typeQualifiedName the given type qualified name + * @param owner the owner of the returned type's javaScript unit + * @exception JavaScriptModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the first type found following this project's includepath + * with the given package name and type qualified name + * or null if none is found + * @see IType#getTypeQualifiedName(char) + */ + IType findType(String packageName, String typeQualifiedName, WorkingCopyOwner owner) throws JavaScriptModelException; + /** + * Same functionality as {@link #findType(String, String, WorkingCopyOwner)} + * but also look for secondary types if given name does not match a javaScript unit name. + * + * @param packageName the given package name + * @param typeQualifiedName the given type qualified name + * @param owner the owner of the returned type's javaScript unit + * @param progressMonitor the progress monitor to report progress to, + * or null if no progress monitor is provided + * @exception JavaScriptModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the first type found following this project's includepath + * with the given fully qualified name or null if none is found + * @see IType#getFullyQualifiedName(char) + */ + IType findType(String packageName, String typeQualifiedName, WorkingCopyOwner owner, IProgressMonitor progressMonitor) throws JavaScriptModelException; + + /** + * Returns all of the existing package fragment roots that exist + * on the includepath, in the order they are defined by the includepath. + * + * @return all of the existing package fragment roots that exist + * on the includepath + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + */ + IPackageFragmentRoot[] getAllPackageFragmentRoots() throws JavaScriptModelException; + + /** + * Returns an array of non-JavaScript resources directly contained in this project. + * It does not transitively answer non-JavaScript resources contained in folders; + * these would have to be explicitly iterated over. + *

+ * Non-JavaScript resources includes other files and folders located in the + * project not accounted for by any of it source or binary package fragment + * roots. If the project is a source folder itself, resources excluded from the + * corresponding source includepath entry by one or more exclusion patterns + * are considered non-JavaScript resources and will appear in the result + * (possibly in a folder) + *

+ * + * @return an array of non-JavaScript resources (IFiles and/or + * IFolders) directly contained in this project + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + */ + Object[] getNonJavaScriptResources() throws JavaScriptModelException; + + /** + * Helper method for returning one option value only. Equivalent to (String)this.getOptions(inheritJavaCoreOptions).get(optionName) + * Note that it may answer null if this option does not exist, or if there is no custom value for it. + *

+ * For a complete description of the configurable options, see JavaScriptCore#getDefaultOptions. + *

+ * + * @param optionName the name of an option + * @param inheritJavaCoreOptions - boolean indicating whether JavaScriptCore options should be inherited as well + * @return the String value of a given option + * @see JavaScriptCore#getDefaultOptions() + */ + String getOption(String optionName, boolean inheritJavaCoreOptions); + + /** + * Returns the table of the current custom options for this project. Projects remember their custom options, + * in other words, only the options different from the the JavaScriptCore global options for the workspace. + * A boolean argument allows to directly merge the project options with global ones from JavaScriptCore. + *

+ * For a complete description of the configurable options, see JavaScriptCore#getDefaultOptions. + *

+ * + * @param inheritJavaCoreOptions - boolean indicating whether JavaScriptCore options should be inherited as well + * @return table of current settings of all options + * (key type: String; value type: String) + * @see JavaScriptCore#getDefaultOptions() + */ + Map getOptions(boolean inheritJavaCoreOptions); + + /** + * Returns a package fragment root for the file at the specified file system path. + * This is a handle-only method. The underlying java.io.File + * may or may not exist. No resource is associated with this local file + * package fragment root. + * + * @param filePath the file system path + * @return a package fragment root for the file at the specified file system path + */ + IPackageFragmentRoot getPackageFragmentRoot(String filePath); + + /** + * Returns a package fragment root for the given resource, which + * must either be a folder representing the top of a package hierarchy, + * or a javaScript file. + * This is a handle-only method. The underlying resource may or may not exist. + * + * @param resource the given resource + * @return a package fragment root for the given resource, which + * must either be a folder representing the top of a package hierarchy, + * or a javaScript file + */ + IPackageFragmentRoot getPackageFragmentRoot(IResource resource); + + /** + * Returns all of the package fragment roots contained in this + * project, identified on this project's resolved includepath. The result + * does not include package fragment roots in other projects referenced + * on this project's includepath. + * + *

NOTE: This is equivalent to getChildren(). + * + * @return all of the package fragment roots contained in this + * project, identified on this project's resolved includepath + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + */ + IPackageFragmentRoot[] getPackageFragmentRoots() throws JavaScriptModelException; + + /** + * Returns all package fragments in all package fragment roots contained + * in this project. This is a convenience method. + * + * Note that the package fragment roots corresponds to the resolved + * includepath of the project. + * + * @return all package fragments in all package fragment roots contained + * in this project + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + */ + IPackageFragment[] getPackageFragments() throws JavaScriptModelException; + + /** + * Returns the IProject on which this IJavaScriptProject + * was created. This is handle-only method. + * + * @return the IProject on which this IJavaScriptProject + * was created + */ + IProject getProject(); + + /** + * Returns the raw includepath for the project, as a list of includepath + * entries. This corresponds to the exact set of entries which were assigned + * using setRawIncludepath, in particular such a includepath may + * contain includepath variable and includepath container entries. Includepath + * variable and includepath container entries can be resolved using the + * helper method getResolvedIncludepath; includepath variable + * entries also can be resolved individually using + * JavaScriptCore#getIncludepathVariable). + *

+ * Both includepath containers and includepath variables provides a level of + * indirection that can make the .jsdtScope file stable across + * workspaces. + *

+ *

+ * Note that in case the project isn't yet opened, the includepath will + * be read directly from the associated .jsdtScope file. + *

+ * + * @return the raw includepath for the project, as a list of includepath entries + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + * @see IIncludePathEntry + */ + IIncludePathEntry[] getRawIncludepath() throws JavaScriptModelException; + + /** + * Returns the names of the projects that are directly required by this + * project. A project is required if it is in its includepath. + *

+ * The project names are returned in the order they appear on the includepath. + * + * @return the names of the projects that are directly required by this + * project in includepath order + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + */ + String[] getRequiredProjectNames() throws JavaScriptModelException; + + /** + * This is a helper method returning the resolved includepath for the project + * as a list of simple (non-variable, non-container) includepath entries. + * All includepath variable and includepath container entries in the project's + * raw includepath will be replaced by the simple includepath entries they + * resolve to. + *

+ * The resulting resolved includepath is accurate for the given point in time. + * If the project's raw includepath is later modified, or if includepath + * variables are changed, the resolved includepath can become out of date. + * Because of this, hanging on resolved includepath is not recommended. + *

+ * + * @param ignoreUnresolvedEntry indicates how to handle unresolvable + * variables and containers; true indicates that missing + * variables and unresolvable includepath containers should be silently + * ignored, and that the resulting list should consist only of the + * entries that could be successfully resolved; false indicates + * that a JavaScriptModelException should be thrown for the first + * unresolved variable or container + * @return the resolved includepath for the project as a list of simple + * includepath entries, where all includepath variable and container entries + * have been resolved and substituted with their final target entries + * @exception JavaScriptModelException in one of the corresponding situation: + *
    + *
  • this element does not exist
  • + *
  • an exception occurs while accessing its corresponding resource
  • + *
  • a includepath variable or includepath container was not resolvable + * and ignoreUnresolvedEntry is false.
  • + *
+ * @see IIncludePathEntry + */ + IIncludePathEntry[] getResolvedIncludepath(boolean ignoreUnresolvedEntry) + throws JavaScriptModelException; + + /** + * Returns whether this project has been built at least once and thus whether it has a build state. + * @return true if this project has been built at least once, false otherwise + */ + boolean hasBuildState(); + + /** + * Returns whether setting this project's includepath to the given includepath entries + * would result in a cycle. + * + * If the set of entries contains some variables, those are resolved in order to determine + * cycles. + * + * @param entries the given includepath entries + * @return true if the given includepath entries would result in a cycle, false otherwise + */ + boolean hasIncludepathCycle(IIncludePathEntry[] entries); + /** + * Returns whether the given element is on the includepath of this project, + * that is, referenced from a includepath entry and not explicitly excluded + * using an exclusion pattern. + * + * @param element the given element + * @return true if the given element is on the includepath of + * this project, false otherwise + * @see IIncludePathEntry#getInclusionPatterns() + * @see IIncludePathEntry#getExclusionPatterns() + */ + boolean isOnIncludepath(IJavaScriptElement element); + /** + * Returns whether the given resource is on the includepath of this project, + * that is, referenced from a includepath entry and not explicitly excluded + * using an exclusion pattern. + * + * @param resource the given resource + * @return true if the given resource is on the includepath of + * this project, false otherwise + * @see IIncludePathEntry#getInclusionPatterns() + * @see IIncludePathEntry#getExclusionPatterns() + */ + boolean isOnIncludepath(IResource resource); + + /** + * Creates a new evaluation context. + * @return a new evaluation context. + */ + IEvaluationContext newEvaluationContext(); + + /** + * Creates and returns a type hierarchy for all types in the given + * region, considering subtypes within that region. + * + * @param monitor the given progress monitor + * @param region the given region + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + * @exception IllegalArgumentException if region is null + * @return a type hierarchy for all types in the given + * region, considering subtypes within that region + */ + ITypeHierarchy newTypeHierarchy(IRegion region, IProgressMonitor monitor) + throws JavaScriptModelException; + + /** + * Creates and returns a type hierarchy for all types in the given + * region, considering subtypes within that region and considering types in the + * working copies with the given owner. + * In other words, the owner's working copies will take + * precedence over their original javaScript units in the workspace. + *

+ * Note that if a working copy is empty, it will be as if the original javaScript + * unit had been deleted. + *

+ * + * @param monitor the given progress monitor + * @param region the given region + * @param owner the owner of working copies that take precedence over their original javaScript units + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + * @exception IllegalArgumentException if region is null + * @return a type hierarchy for all types in the given + * region, considering subtypes within that region + */ + ITypeHierarchy newTypeHierarchy(IRegion region, WorkingCopyOwner owner, IProgressMonitor monitor) + throws JavaScriptModelException; + + /** + * Creates and returns a type hierarchy for the given type considering + * subtypes in the specified region. + * + * @param type the given type + * @param region the given region + * @param monitor the given monitor + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + * + * @exception IllegalArgumentException if type or region is null + * @return a type hierarchy for the given type considering + * subtypes in the specified region + */ + ITypeHierarchy newTypeHierarchy( + IType type, + IRegion region, + IProgressMonitor monitor) + throws JavaScriptModelException; + + /** + * Creates and returns a type hierarchy for the given type considering + * subtypes in the specified region and considering types in the + * working copies with the given owner. + * In other words, the owner's working copies will take + * precedence over their original javaScript units in the workspace. + *

+ * Note that if a working copy is empty, it will be as if the original javaScript + * unit had been deleted. + *

+ * + * @param type the given type + * @param region the given region + * @param monitor the given monitor + * @param owner the owner of working copies that take precedence over their original javaScript units + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + * + * @exception IllegalArgumentException if type or region is null + * @return a type hierarchy for the given type considering + * subtypes in the specified region + */ + ITypeHierarchy newTypeHierarchy( + IType type, + IRegion region, + WorkingCopyOwner owner, + IProgressMonitor monitor) + throws JavaScriptModelException; + + /** + * Returns the raw includepath for the project as defined by its + * .jsdtScope file from disk, or null + * if unable to read the file. + *

+ * This includepath may differ from the in-memory includepath returned by + * getRawIncludepath, in case the automatic reconciliation + * mechanism has not been performed yet. Usually, any change to the + * .jsdtScope file is automatically noticed and reconciled at + * the next resource change notification event. However, if the file is + * modified within an operation, where this change needs to be taken into + * account before the operation ends, then the includepath from disk can be + * read using this method, and further assigned to the project using + * setRawIncludepath(...). + *

+ *

+ * Includepath variable and includepath container entries can be resolved using + * the helper method getResolvedIncludepath; includepath variable + * entries also can be resolved individually using + * JavaScriptCore#getIncludepathVariable). + *

+ *

+ * Note that no check is performed whether the project has the JavaScript nature + * set, allowing an existing .jsdtScope file to be considered + * independantly (unlike getRawIncludepath which requires the + * JavaScript nature to be associated with the project). + *

+ *

+ * In order to manually force a project includepath refresh, one can simply + * assign the project includepath using the result of this method, as follows: + * proj.setRawIncludepath(proj.readRawIncludepath(), monitor) + * (note that the readRawIncludepath method + * could return null). + *

+ * + * @return the raw includepath from disk for the project, as a list of + * includepath entries + * @see #getRawIncludepath() + * @see IIncludePathEntry + */ + IIncludePathEntry[] readRawIncludepath(); + + /** + * Helper method for setting one option value only. Equivalent to Map options = this.getOptions(false); map.put(optionName, optionValue); this.setOptions(map) + *

+ * For a complete description of the configurable options, see JavaScriptCore#getDefaultOptions. + *

+ * + * @param optionName the name of an option + * @param optionValue the value of the option to set + * @see JavaScriptCore#getDefaultOptions() + */ + void setOption(String optionName, String optionValue); + + /** + * Sets the project custom options. All and only the options explicitly included in the given table + * are remembered; all previous option settings are forgotten, including ones not explicitly + * mentioned. + *

+ * For a complete description of the configurable options, see JavaScriptCore#getDefaultOptions. + *

+ * + * @param newOptions the new options (key type: String; value type: String), + * or null to flush all custom options (clients will automatically get the global JavaScriptCore options). + * @see JavaScriptCore#getDefaultOptions() + */ + void setOptions(Map newOptions); + + /** + * Sets the includepath of this project using a list of includepath entries. In particular such a includepath may contain + * includepath variable entries. Includepath variable entries can be resolved individually ({@link JavaScriptCore#getIncludepathVariable(String)}), + * or the full includepath can be resolved at once using the helper method {@link #getResolvedIncludepath(boolean)}. + *

+ *

+ * If it is specified that this operation cannot modify resources, the .jsdtScope file will not be written to disk + * and no error marker will be generated. To synchronize the .jsdtScope with the in-memory includepath, + * one can use setRawIncludepath(readRawIncludepath(), true, monitor). + *

+ * Setting the includepath to null specifies a default includepath + * (the project root). Setting the includepath to an empty array specifies an + * empty includepath. + *

+ * If a cycle is detected while setting this includepath (and if resources can be modified), an error marker will be added + * to the project closing the cycle. + * To avoid this problem, use {@link #hasIncludepathCycle(IIncludePathEntry[])} + * before setting the includepath. + *

+ * This operation acquires a lock on the workspace's root. + * + * @param entries a list of includepath entries + * @param canModifyResources whether resources should be written to disk if needed + * @param monitor the given progress monitor + * @exception JavaScriptModelException if the includepath could not be set. Reasons include: + *

    + *
  • This JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • The includepath is being modified during resource change event notification (CORE_EXCEPTION) + *
  • The includepath failed the validation check as defined by {@link JavaScriptConventions#validateIncludepath(IJavaScriptProject, IIncludePathEntry[], IPath)} + *
+ * @see IIncludePathEntry + */ + void setRawIncludepath(IIncludePathEntry[] entries, boolean canModifyResources, IProgressMonitor monitor) throws JavaScriptModelException; + + /** + * Sets the includepath of this project using a list of includepath entries. In particular such a includepath may contain + * includepath variable entries. Includepath variable entries can be resolved individually ({@link JavaScriptCore#getIncludepathVariable(String)}), + * or the full includepath can be resolved at once using the helper method {@link #getResolvedIncludepath(boolean)}. + *

+ *

+ * Setting the includepath to null specifies a default includepath + * (the project root). Setting the includepath to an empty array specifies an + * empty includepath. + *

+ * If a cycle is detected while setting this includepath, an error marker will be added + * to the project closing the cycle. + * To avoid this problem, use {@link #hasIncludepathCycle(IIncludePathEntry[])} + * before setting the includepath. + *

+ * This operation acquires a lock on the workspace's root. + * + * @param entries a list of includepath entries + * @param monitor the given progress monitor + * @exception JavaScriptModelException if the includepath could not be set. Reasons include: + *

    + *
  • This JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • The includepath is being modified during resource change event notification (CORE_EXCEPTION) + *
  • The includepath failed the validation check as defined by {@link JavaScriptConventions#validateIncludepath(IJavaScriptProject, IIncludePathEntry[], IPath)} + *
+ * @see IIncludePathEntry + */ + void setRawIncludepath(IIncludePathEntry[] entries, IProgressMonitor monitor) + throws JavaScriptModelException; + + ITypeRoot findTypeRoot(String fullyQualifiedName) throws JavaScriptModelException; + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptUnit.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptUnit.java new file mode 100644 index 0000000..c6fd2b5 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptUnit.java @@ -0,0 +1,753 @@ +/******************************************************************************* + * Copyright (c) 2000, 2010 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * IBM Corporation - added J2SE 1.5 support + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.wst.jsdt.core.dom.AST; +import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit; + + +/** + * Represents an entire JavaScript file (source file with one of the + * {@link JavaScriptCore#getJavaScriptLikeExtensions() JavaScript-like extensions}). + * JavaScriptUnit elements need to be opened before they can be navigated or manipulated. + * The children are of type {@link IPackageDeclaration}, + * {@link IImportContainer},{@link IFunction},{@link IField}, and {@link IType}, + * and appear in the order in which they are declared in the source. + * If a source file cannot be parsed, its structure remains unknown. + * Use {@link IJavaScriptElement#isStructureKnown} to determine whether this is + * the case. + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IJavaScriptUnit extends ITypeRoot, ISourceManipulation { +/** + * Constant indicating that a reconcile operation should not return an AST. + */ +public static final int NO_AST = 0; + +/** + * Constant indicating that a reconcile operation should recompute the problems + * even if the source hasn't changed. + */ +public static final int FORCE_PROBLEM_DETECTION = 0x01; + +/** + * Constant indicating that a reconcile operation should enable the statements recovery. + * @see org.eclipse.wst.jsdt.core.dom.ASTParser#setStatementsRecovery(boolean) + */ +public static final int ENABLE_STATEMENTS_RECOVERY = 0x02; + +/** + * Constant indicating that a reconcile operation should enable the bindings recovery + * @see org.eclipse.wst.jsdt.core.dom.ASTParser#setBindingsRecovery(boolean) + * @see org.eclipse.wst.jsdt.core.dom.IBinding#isRecovered() + */ +public static final int ENABLE_BINDINGS_RECOVERY = 0x04; + + +/** + * Changes this javaScript file handle into a working copy. A new {@link IBuffer} is + * created using this javaScript file handle's owner. Uses the primary owner is none was + * specified when this javaScript file handle was created. + *

+ * When switching to working copy mode, problems are reported to given + * {@link IProblemRequestor}. Note that once in working copy mode, the given + * {@link IProblemRequestor} is ignored. Only the original {@link IProblemRequestor} + * is used to report subsequent problems. + *

+ *

+ * Once in working copy mode, changes to this javaScript file or its children are done in memory. + * Only the new buffer is affected. Using {@link #commitWorkingCopy(boolean, IProgressMonitor)} + * will bring the underlying resource in sync with this javaScript file. + *

+ *

+ * If this JavaScript file was already in working copy mode, an internal counter is incremented and no + * other action is taken on this javaScript file. To bring this javaScript file back into the original mode + * (where it reflects the underlying resource), {@link #discardWorkingCopy} must be call as many + * times as {@link #becomeWorkingCopy(IProblemRequestor, IProgressMonitor)}. + *

+ * + * @param problemRequestor a requestor which will get notified of problems detected during + * reconciling as they are discovered. The requestor can be set to null indicating + * that the client is not interested in problems. + * @param monitor a progress monitor used to report progress while opening this javaScript file + * or null if no progress should be reported + * @throws JavaScriptModelException if this javaScript file could not become a working copy. + * @see #discardWorkingCopy() + * + * @deprecated Use {@link #becomeWorkingCopy(IProgressMonitor)} instead. + * Note that if this deprecated method is used, problems will be reported to the given problem requestor + * as well as the problem requestor returned by the working copy owner (if not null). While this may + * be desired in some situations, by and large it is not. +*/ +void becomeWorkingCopy(IProblemRequestor problemRequestor, IProgressMonitor monitor) throws JavaScriptModelException; +/** + * Changes this javaScript file handle into a working copy. A new {@link IBuffer} is + * created using this javaScript file handle's owner. Uses the primary owner if none was + * specified when this javaScript file handle was created. + *

+ * When switching to working copy mode, problems are reported to the {@link IProblemRequestor + * problem requestor} of the {@link WorkingCopyOwner working copy owner}. + *

+ * Once in working copy mode, changes to this javaScript file or its children are done in memory. + * Only the new buffer is affected. Using {@link #commitWorkingCopy(boolean, IProgressMonitor)} + * will bring the underlying resource in sync with this javaScript file. + *

+ * If this javaScript file was already in working copy mode, an internal counter is incremented and no + * other action is taken on this javaScript file. To bring this javaScript file back into the original mode + * (where it reflects the underlying resource), {@link #discardWorkingCopy} must be call as many + * times as {@link #becomeWorkingCopy(IProblemRequestor, IProgressMonitor)}. + *

+ * + * @param monitor a progress monitor used to report progress while opening this javaScript file + * or null if no progress should be reported + * @throws JavaScriptModelException if this javaScript file could not become a working copy. + * @see #discardWorkingCopy() + */ +void becomeWorkingCopy(IProgressMonitor monitor) throws JavaScriptModelException; +/** + * Commits the contents of this working copy to its underlying resource. + * + *

It is possible that the contents of the original resource have changed + * since this working copy was created, in which case there is an update conflict. + * The value of the force parameter effects the resolution of + * such a conflict:

    + *
  • true - in this case the contents of this working copy are applied to + * the underlying resource even though this working copy was created before + * a subsequent change in the resource
  • + *
  • false - in this case a {@link JavaScriptModelException} is thrown
  • + *
+ * @param force a flag to handle the cases when the contents of the original resource have changed + * since this working copy was created + * @param monitor the given progress monitor + * @throws JavaScriptModelException if this working copy could not commit. Reasons include: + *
    + *
  • A {@link org.eclipse.core.runtime.CoreException} occurred while updating an underlying resource + *
  • This element is not a working copy (INVALID_ELEMENT_TYPES) + *
  • A update conflict (described above) (UPDATE_CONFLICT) + *
+ */ +void commitWorkingCopy(boolean force, IProgressMonitor monitor) throws JavaScriptModelException; +/** + * Creates and returns an non-static import declaration in this javaScript file + * with the given name. This method is equivalent to + * createImport(name, Flags.AccDefault, sibling, monitor). + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param name the name of the import declaration to add + * @param sibling the existing element which the import declaration will be inserted immediately before (if + * null , then this import will be inserted as the last import declaration. + * @param monitor the progress monitor to notify + * @return the newly inserted import declaration (or the previously existing one in case attempting to create a duplicate) + * + * @throws JavaScriptModelException if the element could not be created. Reasons include: + *
    + *
  • This JavaScript element does not exist or the specified sibling does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A {@link org.eclipse.core.runtime.CoreException} occurred while updating an underlying resource + *
  • The specified sibling is not a child of this javaScript file (INVALID_SIBLING) + *
  • The name is not a valid import name (INVALID_NAME) + *
+ * @see #createImport(String, IJavaScriptElement, int, IProgressMonitor) + * + */ +IImportDeclaration createImport(String name, IJavaScriptElement sibling, IProgressMonitor monitor) throws JavaScriptModelException; + +/** + * Creates and returns an import declaration in this javaScript file + * with the given name. + *

+ * Optionally, the new element can be positioned before the specified + * sibling. If no sibling is specified, the element will be inserted + * as the last import declaration in this javaScript file. + *

+ * If the javaScript file already includes the specified import declaration, + * the import is not generated (it does not generate duplicates). + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param name the name of the import declaration + * @param sibling the existing element which the import declaration will be inserted immediately before (if + * null , then this import will be inserted as the last import declaration. + * @param flags {@link Flags#AccStatic} for static imports, or + * {@link Flags#AccDefault} for regular imports; other modifier flags + * are ignored + * @param monitor the progress monitor to notify + * @return the newly inserted import declaration (or the previously existing one in case attempting to create a duplicate) + * + * @throws JavaScriptModelException if the element could not be created. Reasons include: + *
    + *
  • This JavaScript element does not exist or the specified sibling does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A {@link org.eclipse.core.runtime.CoreException} occurred while updating an underlying resource + *
  • The specified sibling is not a child of this javaScript file (INVALID_SIBLING) + *
  • The name is not a valid import name (INVALID_NAME) + *
+ * @see Flags + */ +IImportDeclaration createImport(String name, IJavaScriptElement sibling, int flags, IProgressMonitor monitor) throws JavaScriptModelException; + +/** + * Creates and returns a type in this javaScript file with the + * given contents. If this javaScript file does not exist, one + * will be created with an appropriate package declaration. + *

+ * Optionally, the new type can be positioned before the specified + * sibling. If sibling is null, the type will be appended + * to the end of this javaScript file. + * + *

It is possible that a type with the same name already exists in this javaScript file. + * The value of the force parameter effects the resolution of + * such a conflict:

    + *
  • true - in this case the type is created with the new contents
  • + *
  • false - in this case a {@link JavaScriptModelException} is thrown
  • + *
+ * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * + * @param contents the source contents of the type declaration to add. + * @param sibling the existing element which the type will be inserted immediately before (if + * null, then this type will be inserted as the last type declaration. + * @param force a boolean flag indicating how to deal with duplicates + * @param monitor the progress monitor to notify + * @return the newly inserted type + * + * @throws JavaScriptModelException if the element could not be created. Reasons include: + *
    + *
  • The specified sibling element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A {@link org.eclipse.core.runtime.CoreException} occurred while updating an underlying resource + *
  • The specified sibling is not a child of this javaScript file (INVALID_SIBLING) + *
  • The contents could not be recognized as a type declaration (INVALID_CONTENTS) + *
  • There was a naming collision with an existing type (NAME_COLLISION) + *
+ */ +IType createType(String contents, IJavaScriptElement sibling, boolean force, IProgressMonitor monitor) throws JavaScriptModelException; + +/** + * Creates and returns a var in this javaScript file with the + * given contents. If this javaScript file does not exist, one + * will be created with an appropriate package declaration. + *

+ * Optionally, the new var can be positioned before the specified + * sibling. If sibling is null, the var will be appended + * to the end of this javaScript file. + * + *

It is possible that a var with the same name already exists in this javaScript file. + * The value of the force parameter effects the resolution of + * such a conflict:

    + *
  • true - in this case the var is created with the new contents
  • + *
  • false - in this case a {@link JavaScriptModelException} is thrown
  • + *
+ * + * @param contents the source contents of the var declaration to add. + * @param sibling the existing element which the var will be inserted immediately before (if + * null, then this var will be inserted as the last var declaration. + * @param force a boolean flag indicating how to deal with duplicates + * @param monitor the progress monitor to notify + * @return the newly inserted var + * + * @throws JavaScriptModelException if the element could not be created. Reasons include: + *
    + *
  • The specified sibling element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A {@link org.eclipse.core.runtime.CoreException} occurred while updating an underlying resource + *
  • The specified sibling is not a child of this javaScript file (INVALID_SIBLING) + *
  • The contents could not be recognized as a var declaration (INVALID_CONTENTS) + *
  • There was a naming collision with an existing var (NAME_COLLISION) + *
+ */ +IField createField(String contents, IJavaScriptElement sibling, boolean force, IProgressMonitor monitor) +throws JavaScriptModelException; + + +/** + * Creates and returns a function in this javaScript file with the + * given contents. If this javaScript file does not exist, one + * will be created with an appropriate package declaration. + *

+ * Optionally, the new function can be positioned before the specified + * sibling. If sibling is null, the function will be appended + * to the end of this javaScript file. + * + *

It is possible that a function with the same name already exists in this javaScript file. + * The value of the force parameter effects the resolution of + * such a conflict:

    + *
  • true - in this case the function is created with the new contents
  • + *
  • false - in this case a {@link JavaScriptModelException} is thrown
  • + *
+ * + * @param contents the source contents of the function declaration to add. + * @param sibling the existing element which the function will be inserted immediately before (if + * null, then this function will be inserted as the last function declaration. + * @param force a boolean flag indicating how to deal with duplicates + * @param monitor the progress monitor to notify + * @return the newly inserted function + * + * @throws JavaScriptModelException if the element could not be created. Reasons include: + *
    + *
  • The specified sibling element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A {@link org.eclipse.core.runtime.CoreException} occurred while updating an underlying resource + *
  • The specified sibling is not a child of this javaScript file (INVALID_SIBLING) + *
  • The contents could not be recognized as a function declaration (INVALID_CONTENTS) + *
  • There was a naming collision with an existing function (NAME_COLLISION) + *
+ */ +IFunction createMethod(String contents, IJavaScriptElement sibling, boolean force, IProgressMonitor monitor) +throws JavaScriptModelException; + +/** + * Changes this javaScript file in working copy mode back to its original mode. + *

+ * This has no effect if this javaScript file was not in working copy mode. + *

+ *

+ * If {@link #becomeWorkingCopy} was called several times on this + * javaScript file, {@link #discardWorkingCopy} must be called as + * many times before it switches back to the original mode. + *

+ * + * @throws JavaScriptModelException if this working copy could not return in its original mode. + * @see #becomeWorkingCopy(IProblemRequestor, IProgressMonitor) + */ +void discardWorkingCopy() throws JavaScriptModelException; +/** + * Finds the elements in this javaScript file that correspond to + * the given element. + * An element A corresponds to an element B if: + *
    + *
  • A has the same element name as B. + *
  • If A is a method, A must have the same number of arguments as + * B and the simple names of the argument types must be equals. + *
  • The parent of A corresponds to the parent of B recursively up to + * their respective javaScript files. + *
  • A exists. + *
+ * Returns null if no such javaScript elements can be found + * or if the given element is not included in a javaScript file. + * + * @param element the given element + * @return the found elements in this javaScript file that correspond to the given element + */ +IJavaScriptElement[] findElements(IJavaScriptElement element); +/** + * Finds the working copy for this javaScript file, given a {@link WorkingCopyOwner}. + * If no working copy has been created for this javaScript file associated with this + * working copy owner, returns null. + *

+ * Users of this method must not destroy the resulting working copy. + * + * @param owner the given {@link WorkingCopyOwner} + * @return the found working copy for this javaScript file, null if none + * @see WorkingCopyOwner + */ +IJavaScriptUnit findWorkingCopy(WorkingCopyOwner owner); +/** + * Returns all types declared in this javaScript file in the order + * in which they appear in the source. + * This includes all top-level types and nested member types. + * It does NOT include local types (types defined in methods). + * + * @return the array of top-level and member types defined in a javaScript file, in declaration order. + * @throws JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + */ +IType[] getAllTypes() throws JavaScriptModelException; +/** + * Returns the first import declaration in this javaScript file with the given name. + * This is a handle-only method. The import declaration may or may not exist. This + * is a convenience method - imports can also be accessed from a javaScript file's + * import container. + * + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param name the name of the import to find + * @return a handle onto the corresponding import declaration. The import declaration may or may not exist. + */ +IImportDeclaration getImport(String name) ; +/** + * Returns the import container for this javaScript file. + * This is a handle-only method. The import container may or + * may not exist. The import container can used to access the + * imports. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @return a handle onto the corresponding import container. The + * import contain may or may not exist. + */ +IImportContainer getImportContainer(); +/** + * Returns the import declarations in this javaScript file + * in the order in which they appear in the source. This is + * a convenience method - import declarations can also be + * accessed from a javaScript file's import container. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @return the import declarations in this javaScript file + * @throws JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + */ +IImportDeclaration[] getImports() throws JavaScriptModelException; +/** + * Returns the primary javaScript file (whose owner is the primary owner) + * this working copy was created from, or this javaScript file if this a primary + * javaScript file. + *

+ * Note that the returned primary javaScript file can be in working copy mode. + *

+ * + * @return the primary javaScript file this working copy was created from, + * or this javaScript file if it is primary + */ +IJavaScriptUnit getPrimary(); +/** + * Returns the working copy owner of this working copy. + * Returns null if it is not a working copy or if it has no owner. + * + * @return WorkingCopyOwner the owner of this working copy or null + */ +WorkingCopyOwner getOwner(); +/** + * Returns the top-level types declared in this javaScript file + * in the order in which they appear in the source. + * + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @return the top-level types declared in this javaScript file + * @throws JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + */ +IType[] getTypes() throws JavaScriptModelException; +/** + * Returns a new working copy of this javaScript file if it is a primary javaScript file, + * or this javaScript file if it is already a non-primary working copy. + *

+ * Note: if intending to share a working copy amongst several clients, then + * {@link #getWorkingCopy(WorkingCopyOwner, IProblemRequestor, IProgressMonitor)} + * should be used instead. + *

+ * When the working copy instance is created, an ADDED IJavaScriptElementDelta is + * reported on this working copy. + *

+ * Once done with the working copy, users of this method must discard it using + * {@link #discardWorkingCopy()}. + *

+ * Since 2.1, a working copy can be created on a not-yet existing compilation + * unit. In particular, such a working copy can then be committed in order to create + * the corresponding javaScript file. + *

+ * @param monitor a progress monitor used to report progress while opening this javaScript file + * or null if no progress should be reported + * @throws JavaScriptModelException if the contents of this element can + * not be determined. + * @return a new working copy of this element if this element is not + * a working copy, or this element if this element is already a working copy + */ +IJavaScriptUnit getWorkingCopy(IProgressMonitor monitor) throws JavaScriptModelException; +/** + * Returns a shared working copy on this javaScript file using the given working copy owner to create + * the buffer, or this javaScript file if it is already a non-primary working copy. + * This API can only answer an already existing working copy if it is based on the same + * original javaScript file AND was using the same working copy owner (that is, as defined by {@link Object#equals}). + *

+ * The life time of a shared working copy is as follows: + *

    + *
  • The first call to {@link #getWorkingCopy(WorkingCopyOwner, IProblemRequestor, IProgressMonitor)} + * creates a new working copy for this element
  • + *
  • Subsequent calls increment an internal counter.
  • + *
  • A call to {@link #discardWorkingCopy()} decrements the internal counter.
  • + *
  • When this counter is 0, the working copy is discarded. + *
+ * So users of this method must discard exactly once the working copy. + *

+ * Note that the working copy owner will be used for the life time of this working copy, that is if the + * working copy is closed then reopened, this owner will be used. + * The buffer will be automatically initialized with the original's javaScript file content + * upon creation. + *

+ * When the shared working copy instance is created, an ADDED IJavaScriptElementDelta is reported on this + * working copy. + *

+ * Since 2.1, a working copy can be created on a not-yet existing compilation + * unit. In particular, such a working copy can then be committed in order to create + * the corresponding javaScript file. + *

+ * @param owner the working copy owner that creates a buffer that is used to get the content + * of the working copy + * @param problemRequestor a requestor which will get notified of problems detected during + * reconciling as they are discovered. The requestor can be set to null indicating + * that the client is not interested in problems. + * @param monitor a progress monitor used to report progress while opening this javaScript file + * or null if no progress should be reported + * @throws JavaScriptModelException if the contents of this element can + * not be determined. + * @return a new working copy of this element using the given factory to create + * the buffer, or this element if this element is already a working copy + * @deprecated Use {@link ITypeRoot#getWorkingCopy(WorkingCopyOwner, IProgressMonitor)} instead. + * Note that if this deprecated method is used, problems will be reported on the passed problem requester + * as well as on the problem requestor returned by the working copy owner (if not null). +*/ +IJavaScriptUnit getWorkingCopy(WorkingCopyOwner owner, IProblemRequestor problemRequestor, IProgressMonitor monitor) throws JavaScriptModelException; +/** + * Returns whether the resource of this working copy has changed since the + * inception of this working copy. + * Returns false if this javaScript file is not in working copy mode. + * + * @return whether the resource has changed + */ +public boolean hasResourceChanged(); +/** + * Returns whether this element is a working copy. + * + * @return true if this element is a working copy, false otherwise + */ +boolean isWorkingCopy(); + +/** + * Reconciles the contents of this working copy, sends out a JavaScript delta + * notification indicating the nature of the change of the working copy since + * the last time it was either reconciled or made consistent + * ({@link IOpenable#makeConsistent(IProgressMonitor)}), and returns a + * javaScript file AST if requested. + *

+ * It performs the reconciliation by locally caching the contents of + * the working copy, updating the contents, then creating a delta + * over the cached contents and the new contents, and finally firing + * this delta. + *

+ * The boolean argument allows to force problem detection even if the + * working copy is already consistent. + *

+ *

+ * This functionality allows to specify a working copy owner which is used + * during problem detection. All references contained in the working copy are + * resolved against other units; for which corresponding owned working copies + * are going to take precedence over their original javaScript files. If + * null is passed in, then the primary working copy owner is used. + *

+ *

+ * Compilation problems found in the new contents are notified through the + * {@link IProblemRequestor} interface which was passed at + * creation, and no longer as transient markers. + *

+ *

+ * Note: Since 3.0, added/removed/changed inner types generate change deltas. + *

+ *

+ * If requested, a DOM AST representing the javaScript file is returned. + * Its bindings are computed only if the problem requestor is active, or if the + * problem detection is forced. This method returns null if the + * creation of the DOM AST was not requested, or if the requested level of AST + * API is not supported, or if the working copy was already consistent. + *

+ * + *

+ * This method doesn't perform statements recovery. To recover statements with syntax + * errors, {@link #reconcile(int, boolean, boolean, WorkingCopyOwner, IProgressMonitor)} must be use. + *

+ * + * @param astLevel either {@link #NO_AST} if no AST is wanted, + * or the {@linkplain AST#newAST(int) AST API level} of the AST if one is wanted + * @param forceProblemDetection boolean indicating whether problem should be + * recomputed even if the source hasn't changed + * @param owner the owner of working copies that take precedence over the + * original javaScript files, or null if the primary working + * copy owner should be used + * @param monitor a progress monitor + * @return the javaScript file AST or null if not requested, + * or if the requested level of AST API is not supported, + * or if the working copy was consistent + * @throws JavaScriptModelException if the contents of the original element + * cannot be accessed. Reasons include: + *
    + *
  • The original JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
+ */ +JavaScriptUnit reconcile(int astLevel, boolean forceProblemDetection, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaScriptModelException; + +/** + * Reconciles the contents of this working copy, sends out a JavaScript delta + * notification indicating the nature of the change of the working copy since + * the last time it was either reconciled or made consistent + * ({@link IOpenable#makeConsistent(IProgressMonitor)}), and returns a + * javaScript file AST if requested. + *

+ * It performs the reconciliation by locally caching the contents of + * the working copy, updating the contents, then creating a delta + * over the cached contents and the new contents, and finally firing + * this delta. + *

+ * The boolean argument allows to force problem detection even if the + * working copy is already consistent. + *

+ *

+ * This functionality allows to specify a working copy owner which is used + * during problem detection. All references contained in the working copy are + * resolved against other units; for which corresponding owned working copies + * are going to take precedence over their original javaScript files. If + * null is passed in, then the primary working copy owner is used. + *

+ *

+ * Compilation problems found in the new contents are notified through the + * {@link IProblemRequestor} interface which was passed at + * creation, and no longer as transient markers. + *

+ *

+ * Note: Since 3.0, added/removed/changed inner types generate change deltas. + *

+ *

+ * If requested, a DOM AST representing the javaScript file is returned. + * Its bindings are computed only if the problem requestor is active, or if the + * problem detection is forced. This method returns null if the + * creation of the DOM AST was not requested, or if the requested level of AST + * API is not supported, or if the working copy was already consistent. + *

+ * + *

+ * If statements recovery is enabled then this method tries to rebuild statements + * with syntax error. Otherwise statements with syntax error won't be present in + * the returning DOM AST. + *

+ * + * @param astLevel either {@link #NO_AST} if no AST is wanted, + * or the {@linkplain org.eclipse.wst.jsdt.core.dom.AST#newAST(int) AST API level} of the AST if one is wanted + * @param forceProblemDetection boolean indicating whether problem should be + * recomputed even if the source hasn't changed + * @param enableStatementsRecovery if true statements recovery is enabled. + * @param owner the owner of working copies that take precedence over the + * original javaScript files, or null if the primary working + * copy owner should be used + * @param monitor a progress monitor + * @return the javaScript file AST or null if not requested, + * or if the requested level of AST API is not supported, + * or if the working copy was consistent + * @throws JavaScriptModelException if the contents of the original element + * cannot be accessed. Reasons include: + *
    + *
  • The original JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
+ */ +JavaScriptUnit reconcile(int astLevel, boolean forceProblemDetection, boolean enableStatementsRecovery, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaScriptModelException; + +/** + * Reconciles the contents of this working copy, sends out a JavaScript delta + * notification indicating the nature of the change of the working copy since + * the last time it was either reconciled or made consistent + * ({@link IOpenable#makeConsistent(IProgressMonitor)}), and returns a + * javaScript file AST if requested. + * + *

+ * If the problem detection is forced by passing the {@link #FORCE_PROBLEM_DETECTION} bit in the given reconcile flag, + * problem detection is run even if the working copy is already consistent. + *

+ * + *

+ * It performs the reconciliation by locally caching the contents of + * the working copy, updating the contents, then creating a delta + * over the cached contents and the new contents, and finally firing + * this delta.

+ * + *

+ * This functionality allows to specify a working copy owner which is used + * during problem detection. All references contained in the working copy are + * resolved against other units; for which corresponding owned working copies + * are going to take precedence over their original javaScript files. If + * null is passed in, then the primary working copy owner is used. + *

+ *

+ * Compilation problems found in the new contents are notified through the + * {@link IProblemRequestor} interface which was passed at + * creation, and no longer as transient markers. + *

+ *

+ * Note: Since 3.0, added/removed/changed inner types generate change deltas. + *

+ *

+ * If requested, a DOM AST representing the javaScript file is returned. + * Its bindings are computed only if the problem requestor is active, or if the + * problem detection is forced. This method returns null if the + * creation of the DOM AST was not requested, or if the requested level of AST + * API is not supported, or if the working copy was already consistent. + *

+ * + *

+ * If statements recovery is enabled by passing the {@link #ENABLE_STATEMENTS_RECOVERY} bit in the given reconcile flag + * then this method tries to rebuild statements with syntax error. Otherwise statements with syntax error won't be + * present in the returning DOM AST.

+ *

+ * If bindings recovery is enabled by passing the {@link #ENABLE_BINDINGS_RECOVERY} bit in the given reconcile flag + * then this method tries to resolve bindings even if the type resolution contains errors.

+ *

+ * The given reconcile flags is a bit-mask of the different constants ({@link #ENABLE_BINDINGS_RECOVERY}, + * {@link #ENABLE_STATEMENTS_RECOVERY}, {@link #FORCE_PROBLEM_DETECTION}). Unspecified values are left for future use. + *

+ * + * @param astLevel either {@link #NO_AST} if no AST is wanted, + * or the {@linkplain org.eclipse.wst.jsdt.core.dom.AST#newAST(int) AST API level} of the AST if one is wanted + * @param reconcileFlags the given reconcile flags + * @param owner the owner of working copies that take precedence over the + * original javaScript files, or null if the primary working + * copy owner should be used + * @param monitor a progress monitor + * @return the javaScript file AST or null if not requested, + * or if the requested level of AST API is not supported, + * or if the working copy was consistent + * @throws JavaScriptModelException if the contents of the original element + * cannot be accessed. Reasons include: + *
    + *
  • The original JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
+ * @see #FORCE_PROBLEM_DETECTION + * @see #ENABLE_BINDINGS_RECOVERY + * @see #ENABLE_STATEMENTS_RECOVERY + */ +JavaScriptUnit reconcile(int astLevel, int reconcileFlags, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaScriptModelException; + +/** + * Restores the contents of this working copy to the current contents of + * this working copy's original element. Has no effect if this element + * is not a working copy. + * + *

Note: This is the inverse of committing the content of the + * working copy to the original element with {@link #commitWorkingCopy(boolean, IProgressMonitor)}. + * + * @throws JavaScriptModelException if the contents of the original element + * cannot be accessed. Reasons include: + *

    + *
  • The original JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
+ */ +void restore() throws JavaScriptModelException; + +/** + * Finds the function in this javaScript file that correspond to + * the given function. + * Returns null if no such function can be found + * or if the given element is not included in a javaScript file. + * + * @param function the given function + * @return the found functions in this javaScript file that correspond to the given function + */ +IFunction[] findFunctions(IFunction function); + + + + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJsGlobalScopeContainer.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJsGlobalScopeContainer.java new file mode 100644 index 0000000..2976cb1 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJsGlobalScopeContainer.java @@ -0,0 +1,141 @@ +/******************************************************************************* + * Copyright (c) 2000, 2010 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.core.runtime.IPath; + +/** + * Interface of a includepath container. + * A includepath container provides a way to indirectly reference a set of includepath entries through + * a includepath entry of kind CPE_CONTAINER. Typically, a includepath container can + * be used to describe a complex library composed of filess or projects, considering also + * that containers can map to different set of entries on each project, in other words, several + * projects can reference the same generic container path, but have each of them actually bound + * to a different container object. + *

+ * The set of entries associated with a includepath container may contain any of the following: + *

    + *
  • library entries (CPE_LIBRARY)
  • + *
  • project entries (CPE_PROJECT)
  • + *
+ * In particular, a includepath container can neither reference further includepath containers or includepath variables. + *

+ * Classpath container values are persisted locally to the workspace, but are not preserved from a + * session to another. It is thus highly recommended to register a JsGlobalScopeContainerInitializer + * for each referenced container (through the extension point "org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer"). + *

+ * @see IIncludePathEntry + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IJsGlobalScopeContainer { + + /** + * Kind for a container mapping to an application library + */ + int K_APPLICATION = 1; + + /** + * Kind for a container mapping to a system library + */ + int K_SYSTEM = 2; + + /** + * Kind for a container mapping to a default system library, implicitly contributed by the runtime + */ + int K_DEFAULT_SYSTEM = 3; + + /** + * Answers the set of includepath entries this container is mapping to. + *

+ * The set of entries associated with a includepath container may contain any of the following: + *

    + *
  • library entries (CPE_LIBRARY)
  • + *
  • project entries (CPE_PROJECT)
  • + *
+ * A includepath container can neither reference further includepath containers + * or includepath variables. + *

+ *

+ * This method is called by the JavaScript model when it needs to resolve this + * includepath container entry into a list of library and project entries. + * The method is typically called exactly once for a given JavaScript project, + * and the resulting list of entries cached internally by the JavaScript model. + * This method must not be called by other clients. + *

+ * There are a wide variety of conditions under which this method may be + * invoked. To ensure that the implementation does not interfere with + * correct functioning of the JavaScript model, the implementation should use + * only the following JavaScript model APIs: + *

    + *
  • {@link JavaScriptCore#newLibraryEntry(IPath, IPath, IPath, boolean)} and variants
  • + *
  • {@link JavaScriptCore#newProjectEntry(IPath, boolean)} and variants
  • + *
  • {@link JavaScriptCore#create(org.eclipse.core.resources.IWorkspaceRoot)}
  • + *
  • {@link JavaScriptCore#create(org.eclipse.core.resources.IProject)}
  • + *
  • {@link IJavaScriptModel#getJavaScriptProjects()}
  • + *
  • {@link IJavaScriptProject#getRawIncludepath()}
  • + *
  • {@link IJavaScriptProject#readRawIncludepath()}
  • + *
  • {@link IJavaScriptProject#getOutputLocation()}
  • + *
  • {@link IJavaScriptProject#readOutputLocation()}
  • + *
  • JavaScript element operations marked as "handle-only"
  • + *
+ * The effects of using other JavaScript model APIs are unspecified. + *

+ * + * @return IIncludePathEntry[] - the includepath entries this container represents + * @see IIncludePathEntry + */ + IIncludePathEntry[] getIncludepathEntries(); + + /** + * Answers a readable description of this container + * + * @return String - a string description of the container + */ + String getDescription(); + + /** + * Answers the kind of this container. Can be either: + *
    + *
  • K_APPLICATION if this container maps to an application library
  • + *
  • K_SYSTEM if this container maps to a system library
  • + *
  • K_DEFAULT_SYSTEM if this container maps to a default system library (library + * implicitly contributed by the runtime).
  • + *
+ * Typically, system containers should be placed first on a build path. + * @return the kind of this container + */ + int getKind(); + + /** + * Answers the container path identifying this container. + * A container path is formed by a first ID segment followed with extra segments, which + * can be used as additional hints for resolving to this container. + *

+ * The container ID is also used to identify aJsGlobalScopeContainerInitializer + * registered on the extension point "org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer", which can + * be invoked if needing to resolve the container before it is explicitly set. + *

+ * @return IPath - the container path that is associated with this container + */ + IPath getPath(); + + /** + * Allows mapping between HTML imports and a toolkit's actual page imports. Implementers + * should ensure the validity of the imports before returning a value. + */ + String[] resolvedLibraryImport(String a); +} + diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJsGlobalScopeContainerInitializer.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJsGlobalScopeContainerInitializer.java new file mode 100644 index 0000000..3b47c5e --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJsGlobalScopeContainerInitializer.java @@ -0,0 +1,186 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +/** + * + */ +package org.eclipse.wst.jsdt.core; + +import java.net.URI; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.wst.jsdt.core.compiler.libraries.LibraryLocation; + +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IJsGlobalScopeContainerInitializer { + /** + * Binds a includepath container to a IJsGlobalScopeContainer for a given project, + * or silently fails if unable to do so. + *

+ * A container is identified by a container path, which must be formed of two segments. + * The first segment is used as a unique identifier (which this initializer did register onto), and + * the second segment can be used as an additional hint when performing the resolution. + *

+ * The initializer is invoked if a container path needs to be resolved for a given project, and no + * value for it was recorded so far. The implementation of the initializer would typically set the + * corresponding container using JavaScriptCore#setJsGlobalScopeContainer. + *

+ * A container initialization can be indirectly performed while attempting to resolve a project + * includepath using IJavaScriptProject#getResolvedClasspath(; or directly when using + * JavaScriptCore#getJsGlobalScopeContainer. During the initialization process, any attempt + * to further obtain the same container will simply return null so as to avoid an + * infinite regression of initializations. + *

+ * A container initialization may also occur indirectly when setting a project includepath, as the operation + * needs to resolve the includepath for validation purpose. While the operation is in progress, a referenced + * container initializer may be invoked. If the initializer further tries to access the referring project includepath, + * it will not see the new assigned includepath until the operation has completed. Note that once the JavaScript + * change notification occurs (at the end of the operation), the model has been updated, and the project + * includepath can be queried normally. + *

+ * This method is called by the JavaScript model to give the party that defined + * this particular kind of includepath container the chance to install + * includepath container objects that will be used to convert includepath + * container entries into simpler includepath entries. The method is typically + * called exactly once for a given JavaScript project and includepath container + * entry. This method must not be called by other clients. + *

+ * There are a wide variety of conditions under which this method may be + * invoked. To ensure that the implementation does not interfere with + * correct functioning of the JavaScript model, the implementation should use + * only the following JavaScript model APIs: + *

    + *
  • {@link JavaScriptCore#setJsGlobalScopeContainer(IPath, IJavaScriptProject[], IJsGlobalScopeContainer[], org.eclipse.core.runtime.IProgressMonitor)}
  • + *
  • {@link JavaScriptCore#getJsGlobalScopeContainer(IPath, IJavaScriptProject)}
  • + *
  • {@link JavaScriptCore#create(org.eclipse.core.resources.IWorkspaceRoot)}
  • + *
  • {@link JavaScriptCore#create(org.eclipse.core.resources.IProject)}
  • + *
  • {@link IJavaScriptModel#getJavaScriptProjects()}
  • + *
  • JavaScript element operations marked as "handle-only"
  • + *
+ * The effects of using other JavaScript model APIs are unspecified. + *

+ * + * @param containerPath a two-segment path (ID/hint) identifying the container that needs + * to be resolved + * @param project the JavaScript project in which context the container is to be resolved. + * This allows generic containers to be bound with project specific values. + * @throws CoreException if an exception occurs during the initialization + * + * @see JavaScriptCore#getJsGlobalScopeContainer(IPath, IJavaScriptProject) + * @see JavaScriptCore#setJsGlobalScopeContainer(IPath, IJavaScriptProject[], IJsGlobalScopeContainer[], org.eclipse.core.runtime.IProgressMonitor) + * @see IJsGlobalScopeContainer + */ + public abstract void initialize(IPath containerPath, IJavaScriptProject project) throws CoreException; + + /** + * Returns true if this container initializer can be requested to perform updates + * on its own container values. If so, then an update request will be performed using + * JsGlobalScopeContainerInitializer#requestJsGlobalScopeContainerUpdate/ + *

+ * @param containerPath the path of the container which requires to be updated + * @param project the project for which the container is to be updated + * @return returns true if the container can be updated + */ + public abstract boolean canUpdateJsGlobalScopeContainer(IPath containerPath, IJavaScriptProject project); + + /** + * Request a registered container definition to be updated according to a container suggestion. The container suggestion + * only acts as a place-holder to pass along the information to update the matching container definition(s) held by the + * container initializer. In particular, it is not expected to store the container suggestion as is, but rather adjust + * the actual container definition based on suggested changes. + *

+ * IMPORTANT: In reaction to receiving an update request, a container initializer will update the corresponding + * container definition (after reconciling changes) at its earliest convenience, using + * JavaScriptCore#setJsGlobalScopeContainer(IPath, IJavaScriptProject[], IJsGlobalScopeContainer[], IProgressMonitor). + * Until it does so, the update will not be reflected in the JavaScript Model. + *

+ * In order to anticipate whether the container initializer allows to update its containers, the predicate + * JavaScriptCore#canUpdateJsGlobalScopeContainer should be used. + *

+ * @param containerPath the path of the container which requires to be updated + * @param project the project for which the container is to be updated + * @param containerSuggestion a suggestion to update the corresponding container definition + * @throws CoreException when JavaScriptCore#setJsGlobalScopeContainer would throw any. + * @see JavaScriptCore#setJsGlobalScopeContainer(IPath, IJavaScriptProject[], IJsGlobalScopeContainer[], org.eclipse.core.runtime.IProgressMonitor) + * @see JsGlobalScopeContainerInitializer#canUpdateJsGlobalScopeContainer(IPath, IJavaScriptProject) + */ + public abstract void requestJsGlobalScopeContainerUpdate(IPath containerPath, IJavaScriptProject project, IJsGlobalScopeContainer containerSuggestion) + throws CoreException; + + /** + * Returns a readable description for a container path. A readable description for a container path can be + * used for improving the display of references to container, without actually needing to resolve them. + * A good implementation should answer a description consistent with the description of the associated + * target container (see IJsGlobalScopeContainer.getDescription()). + * + * @param containerPath the path of the container which requires a readable description + * @param project the project from which the container is referenced + * @return a string description of the container + */ + public abstract String getDescription(IPath containerPath, IJavaScriptProject project); + + /** + * Returns a includepath container that is used after this initializer failed to bind a includepath container + * to a IJsGlobalScopeContainer for the given project. A non-null + * failure container indicates that there will be no more request to initialize the given container + * for the given project. + *

+ * By default a non-null failure container with no includepath entries is returned. + * Clients wishing to get a chance to run the initializer again should override this method + * and return null. + *

+ * + * @param containerPath the path of the container which failed to initialize + * @param project the project from which the container is referenced + * @return the default failure container, or null if wishing to run the initializer again + */ + public abstract IJsGlobalScopeContainer getFailureContainer(final IPath containerPath, IJavaScriptProject project); + + /** + * Returns an object which identifies a container for comparison purpose. This allows + * to eliminate redundant containers when accumulating includepath entries (e.g. + * runtime includepath computation). When requesting a container comparison ID, one + * should ensure using its corresponding container initializer. Indeed, a random container + * initializer cannot be held responsible for determining comparison IDs for arbitrary + * containers. + *

+ * @param containerPath the path of the container which is being checked + * @param project the project for which the container is to being checked + * @return returns an Object identifying the container for comparison + */ + public abstract Object getComparisonID(IPath containerPath, IJavaScriptProject project); + + public abstract URI getHostPath(IPath path, IJavaScriptProject project); + + LibraryLocation getLibraryLocation(); + /* + * Returns if this library allows attachment of external JsDoc + */ + boolean allowAttachJsDoc(); + /** + * returns a String of all SuperTypes provided by this library. + */ + String[] containerSuperTypes(); + + /** + * Get the id of the inference provider for this library + * @return inference provider id + */ + String getInferenceID(); + + void removeFromProject(IJavaScriptProject project); +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ILocalVariable.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ILocalVariable.java new file mode 100644 index 0000000..c13248f --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ILocalVariable.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +/** + * Represents a local variable declared in a method.. + * ILocalVariable are pseudo-elements created as the result of a ICodeAssist.codeSelect(...) + * operation. They are not part of the JavaScript model (exists() returns whether the parent exists rather than + * whether the local variable exists in the parent) and they are not included in the children of an IFunction + * or an IInitializer. + *

+ * In particular such a pseudo-element should not be used as a handle. For example its name range won't be updated + * if the underlying source changes. + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface ILocalVariable extends IJavaScriptElement, ISourceReference { + + /** + * Returns the name of this local variable. + * + * @return the name of this local variable. + */ + String getElementName(); + + /** + * Returns the source range of this local variable's name. + * + * @return the source range of this local variable's name + */ + ISourceRange getNameRange(); + + /** + * Returns the type signature of this local variable. + *

+ * The type signature may be either unresolved (for source types) + * or resolved (for binary types), and either basic (for basic types) + * or rich (for parameterized types). See {@link Signature} for details. + *

+ * + * @return the type signature of this local variable. + * @see Signature + */ + String getTypeSignature(); + /** + * Returns the JSDoc range if this element is from source, null otherwise. + * + *

If this element is from source, the jsdoc range is + * extracted from the corresponding source.

+ *

If this element's openable is not consistent, then null is returned.

+ * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return a source range corresponding to the jsdoc source or null + * if no source is available, this element has no jsdoc comment or + * this element's openable is not consistent + * @see IOpenable#isConsistent() + */ + ISourceRange getJSdocRange() throws JavaScriptModelException; +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ILookupScope.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ILookupScope.java new file mode 100644 index 0000000..0abb85e --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ILookupScope.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.wst.jsdt.internal.core.NameLookup; +import org.eclipse.wst.jsdt.internal.core.SearchableEnvironment; + +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface ILookupScope { + /* + * Returns a new name lookup. This name lookup first looks in the given working copies. + */ + public NameLookup newNameLookup(IJavaScriptUnit[] workingCopies) throws JavaScriptModelException; + + /* + * Returns a new name lookup. This name lookup first looks in the working copies of the given owner. + */ + public NameLookup newNameLookup(WorkingCopyOwner owner) throws JavaScriptModelException ; + + /* + * Returns a new search name environment for this project. This name environment first looks in the given working copies. + */ + public SearchableEnvironment newSearchableNameEnvironment(IJavaScriptUnit[] workingCopies) throws JavaScriptModelException ; + + /* + * Returns a new search name environment for this project. This name environment first looks in the working copies + * of the given owner. + */ + public SearchableEnvironment newSearchableNameEnvironment(WorkingCopyOwner owner) throws JavaScriptModelException; +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IMember.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IMember.java new file mode 100644 index 0000000..b308c52 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IMember.java @@ -0,0 +1,156 @@ +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +/** + * Common protocol for JavaScript elements that can be members of javaScript files or types. + * This set consists of IType, IFunction, + * IField, and IInitializer. + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IMember extends IJavaScriptElement, ISourceReference, ISourceManipulation, IParent { +/** + * Returns the categories defined by this member's JSDoc. A category is the identifier + * following the tag @category in the member's JSDoc. + * Returns an empty array if no category is defined in this member's JSDoc. + * + * @return the categories defined by this member's doc + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + */ +String[] getCategories() throws JavaScriptModelException; +/* + * Returns the class file in which this member is declared, or null + * if this member is not declared in a class file (for example, a source type). + * This is a handle-only method. + * + * @return the class file in which this member is declared, or null + * if this member is not declared in a class file (for example, a source type) + */ +IClassFile getClassFile(); +/** + * Returns the javaScript unit in which this member is declared, or null + * if this member is not declared in a javaScript unit. + * This is a handle-only method. + * + * @return the javaScript unit in which this member is declared, or null + * if this member is not declared in a javaScript unit (for example, a binary type) + */ +IJavaScriptUnit getJavaScriptUnit(); +/** + * Returns the type in which this member is declared, or null + * if this member is not declared in a type (for example, a top-level type). + * This is a handle-only method. + * + * @return the type in which this member is declared, or null + * if this member is not declared in a type (for example, a top-level type) + */ +IType getDeclaringType(); +/** + * Returns the modifier flags for this member. The flags can be examined using class + * Flags. + *

+ * Note that only flags as indicated in the source are returned. Thus if an interface + * defines a method void myMethod(); the flags don't include the + * 'public' flag. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the modifier flags for this member + * @see Flags + */ +int getFlags() throws JavaScriptModelException; +/** + * Returns the JSDoc range if this element is from source or if this element + * is a binary element with an attached source, null otherwise. + * + *

If this element is from source, the jsdoc range is + * extracted from the corresponding source.

+ *

If this element is from a binary, the jsdoc is extracted from the + * attached source if present.

+ *

If this element's openable is not consistent, then null is returned.

+ * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return a source range corresponding to the jsdoc source or null + * if no source is available, this element has no jsdoc comment or + * this element's openable is not consistent + * @see IOpenable#isConsistent() + */ +ISourceRange getJSdocRange() throws JavaScriptModelException; +/** + * Returns the source range of this member's simple name, + * or null if this member does not have a name + * (for example, an initializer), or if this member does not have + * associated source code (for example, a binary type). + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the source range of this member's simple name, + * or null if this member does not have a name + * (for example, an initializer), or if this member does not have + * associated source code (for example, a binary type) + */ +ISourceRange getNameRange() throws JavaScriptModelException; +/** + * Returns the position relative to the order this member is defined in the source. + * Numbering starts at 1 (thus the first occurrence is occurrence 1, not occurrence 0). + *

+ * Two members m1 and m2 that are equal (e.g. 2 fields with the same name in + * the same type) can be distinguished using their occurrence counts. If member + * m1 appears first in the source, it will have an occurrence count of 1. If member + * m2 appears right after member m1, it will have an occurrence count of 2. + *

+ * The occurrence count can be used to distinguish initializers inside a type + * or anonymous types inside a method. + *

+ * This is a handle-only method. The member may or may not be present. + *

+ * + * @return the position relative to the order this member is defined in the source + */ +int getOccurrenceCount(); +/** + * Returns the JavaScript type root in which this member is declared. + * This is a handle-only method. + * + * @return the JavaScript type root in which this member is declared. + */ +ITypeRoot getTypeRoot(); +/** + * Returns the local or anonymous type declared in this source member with the given simple name and/or + * with the specified position relative to the order they are defined in the source. + * The name is empty if it is an anonymous type. + * Numbering starts at 1 (thus the first occurrence is occurrence 1, not occurrence 0). + * This is a handle-only method. The type may or may not exist. + * Throws a RuntimeException if this member is not a source member. + * + * @param name the given simple name + * @param occurrenceCount the specified position + * @return the type with the given name and/or with the specified position relative to the order they are defined in the source + */ +IType getType(String name, int occurrenceCount); +/** + * Returns whether this member is from a non-editable file. + * This is a handle-only method. + * + * @return true if from a non-editable file, and false if + * from a javaScript unit + */ +boolean isBinary(); +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IOpenable.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IOpenable.java new file mode 100644 index 0000000..2b28286 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IOpenable.java @@ -0,0 +1,193 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.core.runtime.IProgressMonitor; + +/** + * Common protocol for JavaScript elements that must be opened before they can be + * navigated or modified. Opening a textual element (such as a javaScript file) + * involves opening a buffer on its contents. While open, any changes to the buffer + * can be reflected in the element's structure; + * see {@link #isConsistent} and {@link #makeConsistent(IProgressMonitor)}. + *

+ * To reduce complexity in clients, elements are automatically opened + * by the JavaScript model as element properties are accessed. The JavaScript model maintains + * an LRU cache of open elements, and automatically closes elements as they + * are swapped out of the cache to make room for other elements. Elements with + * unsaved changes are never removed from the cache, and thus, if the client + * maintains many open elements with unsaved + * changes, the LRU cache can grow in size (in this case the cache is not + * bounded). However, as elements are saved, the cache will shrink back to its + * original bounded size. + *

+ *

+ * To open an element, all openable parent elements must be open. + * The JavaScript model automatically opens parent elements, as it automatically opens elements. + * Opening an element may provide access to direct children and other descendants, + * but does not automatically open any descendents which are themselves {@link IOpenable}. + * For example, opening a compilation unit provides access to all its constituent elements, + * but opening a package fragment does not open all compilation units in the package fragment. + *

+ *

+ * This interface is not intended to be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IOpenable { + +/** + * Closes this element and its buffer (if any). + * Closing an element which is not open has no effect. + * + *

Note: although {@link #close} is exposed in the API, clients are + * not expected to open and close elements - the JavaScript model does this automatically + * as elements are accessed. + * + * @exception JavaScriptModelException if an error occurs closing this element + */ +public void close() throws JavaScriptModelException; +/** + * Finds and returns the recommended line separator for this element. + * The element's buffer is first searched and the first line separator in this buffer is returned if any. + * Otherwise the preference {@link org.eclipse.core.runtime.Platform#PREF_LINE_SEPARATOR} + * on this element's project or workspace is returned. + * Finally if no such preference is set, the system line separator is returned. + * + * @return the recommended line separator for this element + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + */ +public String findRecommendedLineSeparator() throws JavaScriptModelException; +/** + * Returns the buffer opened for this element, or null + * if this element does not have a buffer. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the buffer opened for this element, or null + * if this element does not have a buffer + */ +public IBuffer getBuffer() throws JavaScriptModelException; +/** + * Returns true if this element is open and: + *

    + *
  • its buffer has unsaved changes, or + *
  • one of its descendants has unsaved changes, or + *
  • a working copy has been created on one of this + * element's children and has not yet destroyed + *
+ * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return true if this element is open and: + *
    + *
  • its buffer has unsaved changes, or + *
  • one of its descendants has unsaved changes, or + *
  • a working copy has been created on one of this + * element's children and has not yet destroyed + *
+ */ +boolean hasUnsavedChanges() throws JavaScriptModelException; +/** + * Returns whether the element is consistent with its underlying resource or buffer. + * The element is consistent when opened, and is consistent if the underlying resource + * or buffer has not been modified since it was last consistent. + * + *

NOTE: Child consistency is not considered. For example, a package fragment + * responds true when it knows about all of its + * compilation units present in its underlying folder. However, one or more of + * the compilation units could be inconsistent. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return true if the element is consistent with its underlying resource or buffer, false otherwise. + * @see IOpenable#makeConsistent(IProgressMonitor) + */ +boolean isConsistent() throws JavaScriptModelException; +/** + * Returns whether this openable is open. This is a handle-only method. + * @return true if this openable is open, false otherwise + */ +boolean isOpen(); +/** + * Makes this element consistent with its underlying resource or buffer + * by updating the element's structure and properties as necessary. + *

+ * Note: Using this functionality on a working copy will interfere with any + * subsequent reconciling operation. Indeed, the next + * {@link IJavaScriptUnit#reconcile(int, boolean, WorkingCopyOwner, IProgressMonitor)} or + * {@link IJavaScriptUnit#reconcile(int, boolean, boolean, WorkingCopyOwner, IProgressMonitor)} + * operation will not account for changes which occurred before an + * explicit use of {@link #makeConsistent(IProgressMonitor)} + *

+ * @param progress the given progress monitor + * @exception JavaScriptModelException if the element is unable to access the contents + * of its underlying resource. Reasons include: + *

    + *
  • This JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
+ * @see IOpenable#isConsistent() + * @see IJavaScriptUnit#reconcile(int, boolean, WorkingCopyOwner, IProgressMonitor) + */ +void makeConsistent(IProgressMonitor progress) throws JavaScriptModelException; +/** + * Opens this element and all parent elements that are not already open. + * For compilation units, a buffer is opened on the contents of the underlying resource. + * + *

Note: although {@link #open} is exposed in the API, clients are + * not expected to open and close elements - the JavaScript model does this automatically + * as elements are accessed. + * + * @param progress the given progress monitor + * @exception JavaScriptModelException if an error occurs accessing the contents + * of its underlying resource. Reasons include: + *

    + *
  • This JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
+ */ +public void open(IProgressMonitor progress) throws JavaScriptModelException; +/** + * Saves any changes in this element's buffer to its underlying resource + * via a workspace resource operation. This has no effect if the element has no underlying + * buffer, or if there are no unsaved changed in the buffer. + *

+ * The force parameter controls how this method deals with + * cases where the workbench is not completely in sync with the local file system. + * If false is specified, this method will only attempt + * to overwrite a corresponding file in the local file system provided + * it is in sync with the workbench. This option ensures there is no + * unintended data loss; it is the recommended setting. + * However, if true is specified, an attempt will be made + * to write a corresponding file in the local file system, + * overwriting any existing one if need be. + * In either case, if this method succeeds, the resource will be marked + * as being local (even if it wasn't before). + *

+ * As a result of this operation, the element is consistent with its underlying + * resource or buffer. + * + * @param progress the given progress monitor + * @param force it controls how this method deals with + * cases where the workbench is not completely in sync with the local file system + * @exception JavaScriptModelException if an error occurs accessing the contents + * of its underlying resource. Reasons include: + *

    + *
  • This JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • This JavaScript element is read-only (READ_ONLY)
  • + *
+ */ +public void save(IProgressMonitor progress, boolean force) throws JavaScriptModelException; +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IPackageFragment.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IPackageFragment.java new file mode 100644 index 0000000..edfd33b --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IPackageFragment.java @@ -0,0 +1,202 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.core.runtime.IProgressMonitor; + +/** + * A package fragment (or source folder) is a portion of the workspace corresponding to an entire package, + * or to a portion thereof. The distinction between a package fragment and a package + * is that a package with some name is the union of all package fragments in the includepath + * which have the same name. + *

+ * Package fragments elements need to be opened before they can be navigated or manipulated. + * The children are of type IJavaScriptUnit (representing a source file) or + * IClassFile (representing a read-only file). + * The children are listed in no particular order. + *

+ *

+ * This interface is not intended to be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IPackageFragment extends IParent, IJavaScriptElement, IOpenable, ISourceManipulation { + + /** + *

+ * The name of package fragment for the default package (value: the empty + * string, ""). + *

+ */ + public static final String DEFAULT_PACKAGE_NAME = ""; //$NON-NLS-1$ + /** + * Returns whether this fragment contains at least one JavaScript resource. + * @return true if this fragment contains at least one JavaScript resource, false otherwise + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + */ + boolean containsJavaResources() throws JavaScriptModelException; + /** + * Creates and returns a javaScript unit in this package fragment + * with the specified name and contents. No verification is performed + * on the contents. + * + *

It is possible that a javaScript unit with the same name already exists in this + * package fragment. + * The value of the force parameter effects the resolution of + * such a conflict:

    + *
  • true - in this case the compilation is created with the new contents
  • + *
  • false - in this case a JavaScriptModelException is thrown
  • + *
+ * + * @param contents the given contents + * @param force specify how to handle conflict is the same name already exists + * @param monitor the given progress monitor + * @param name the given name + * @exception JavaScriptModelException if the element could not be created. Reasons include: + *
    + *
  • This JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A CoreException occurred while creating an underlying resource + *
  • The name is not a valid javaScript unit name (INVALID_NAME) + *
  • The contents are null (INVALID_CONTENTS) + *
+ * @return a javaScript unit in this package fragment + * with the specified name and contents + */ + IJavaScriptUnit createCompilationUnit(String name, String contents, boolean force, IProgressMonitor monitor) throws JavaScriptModelException; + /** + * Returns the non-editable file with the specified name + * in this folder . + * This is a handle-only method. The file may or may not be present. + * @param name the given name + * @return the file with the specified name in this package + */ + IClassFile getClassFile(String name); + /** + * Returns all of the non-editable files in this source folder. + * + *

Note: it is possible that a package fragment contains only + * javaScript units (in other words, its kind is K_SOURCE), in + * which case this method returns an empty collection. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return all of the files in this source folder + */ + IClassFile[] getClassFiles() throws JavaScriptModelException; + /** + * Returns the javaScript unit with the specified name + * in this package (for example, "Object.js"). + * The name has to be a valid javaScript unit name. + * This is a handle-only method. The javaScript unit may or may not be present. + * + * @param name the given name + * @return the javaScript unit with the specified name in this package + * @see JavaScriptConventions#validateCompilationUnitName(String name, String sourceLevel, String complianceLevel) + */ + IJavaScriptUnit getJavaScriptUnit(String name); + /** + * Returns all of the javaScript units in this source folder. + * + *

Note: it is possible that a source folder contains only + * read-only files (in other words, its kind is K_BINARY), in which + * case this method returns an empty collection. + *

+ * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return all of the javaScript units in this source folder + */ + IJavaScriptUnit[] getJavaScriptUnits() throws JavaScriptModelException; + /** + * Returns all of the javaScript units in this source folder that are + * in working copy mode and that have the given owner. + *

+ * Only existing working copies are returned. So a javaScript unit handle that has no + * corresponding resource on disk will be included if and only if is in working copy mode. + *

+ *

Note: it is possible that a source folder contains only + * read-only files (in other words, its kind is K_BINARY), in which + * case this method returns an empty collection. + *

+ * + * @param owner the owner of the returned javaScript units + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return all of the javaScript units in this source folder + */ + IJavaScriptUnit[] getJavaScriptUnits(WorkingCopyOwner owner) throws JavaScriptModelException; + /** + * Returns the dot-separated package name of this fragment, for example + * "java.lang", or "" (the empty string), + * for the default package. + * + * @return the dot-separated package name of this fragment + */ + String getElementName(); + /** + * Returns this package fragment's root kind encoded as an integer. + * A package fragment can contain source files (i.e. files with one of + * the {@link JavaScriptCore#getJavaScriptLikeExtensions() JavaScript-like extensions}), + * or .class files. This is a convenience method. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return this package fragment's root kind encoded as an integer + * @see IPackageFragmentRoot#K_SOURCE + * @see IPackageFragmentRoot#K_BINARY + */ + int getKind() throws JavaScriptModelException; + /** + * Returns an array of non-JavaScript resources contained in this source folder. + *

+ * Non-JavaScript resources includes other files and folders located in the same + * directory as the javaScript units for this package + * fragment. Source files excluded from this package by virtue of + * inclusion/exclusion patterns on the corresponding source includepath entry + * are considered non-JavaScript resources and will appear in the result + * (possibly in a folder). + *

+ * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return an array of non-JavaScript resources (IFiles, + * IFolders, or IStorages if the + * package fragment is in an archive) contained in this package + * fragment + * @see IIncludePathEntry#getInclusionPatterns() + * @see IIncludePathEntry#getExclusionPatterns() + */ + Object[] getNonJavaScriptResources() throws JavaScriptModelException; + /** + * Returns whether this package fragment's name is + * a prefix of other package fragments in this package fragment's + * root. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return true if this package fragment's name is a prefix of other package fragments in this package fragment's root, false otherwise + */ + boolean hasSubpackages() throws JavaScriptModelException; + /** + * Returns whether this package fragment is a default package. + * This is a handle-only method. + * + * @return true if this package fragment is a default package + */ + boolean isDefaultPackage(); + + boolean isSource(); +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IPackageFragmentRoot.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IPackageFragmentRoot.java new file mode 100644 index 0000000..1679049 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IPackageFragmentRoot.java @@ -0,0 +1,432 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * IBM Corporation - specified that a source archive or a source folder can be attached to a binary + * package fragment root. + * IBM Corporation - added root manipulation APIs: copy, delete, move + * IBM Corporation - added DESTINATION_PROJECT_INCLUDEPATH + * IBM Corporation - added OTHER_REFERRING_PROJECTS_INCLUDEPATH + * IBM Corporation - added NO_RESOURCE_MODIFICATION + * IBM Corporation - added REPLACE + * IBM Corporation - added ORIGINATING_PROJECT_INCLUDEPATH + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; + +/** + * A package fragment root (or source folder root) contains a set of source folders (package fragments). + * It corresponds to an underlying resource which is either folder. All descendant folders represent + * package fragments. For a given child folder representing a package fragment, + * the corresponding package name is composed of the folder names between the folder + * for this root and the child folder representing the package, separated by '.'. + * Package fragment roots need to be opened before they can be navigated or manipulated. + * The children are of type IPackageFragment, and are in no particular order. + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IPackageFragmentRoot + extends IParent, IJavaScriptElement, IOpenable { + /** + * Kind constant for a source path root. Indicates this root + * only contains source files. + */ + int K_SOURCE = 1; + /** + * Kind constant for a binary path root. Indicates this + * root only contains binary (non-editable) files. + */ + int K_BINARY = 2; + /** + * Empty root path + */ + String DEFAULT_PACKAGEROOT_PATH = ""; //$NON-NLS-1$ + /** + * Update model flag constant (bit mask value 1) indicating that the operation + * is to not copy/move/delete the package fragment root resource. + */ + int NO_RESOURCE_MODIFICATION = 1; + /** + * Update model flag constant (bit mask value 2) indicating that the operation + * is to update the includepath of the originating project. + */ + int ORIGINATING_PROJECT_INCLUDEPATH = 2; + /** + * Update model flag constant (bit mask value 4) indicating that the operation + * is to update the includepath of all referring projects except the originating project. + */ + int OTHER_REFERRING_PROJECTS_INCLUDEPATH = 4; + /** + * Update model flag constant (bit mask value 8) indicating that the operation + * is to update the includepath of the destination project. + */ + int DESTINATION_PROJECT_INCLUDEPATH = 8; + /** + * Update model flag constant (bit mask value 16) indicating that the operation + * is to replace the resource and the destination project's includepath entry. + */ + int REPLACE = 16; + /* + * Attaches the source archive identified by the given absolute path to this + * binary package fragment root. rootPath specifies the location + * of the root within the archive or folder (empty specifies the default root + * and null specifies the root path should be detected). + * Once a source archive or folder is attached to the package fragment root, + * the getSource and getSourceRange + * methods become operational for binary types/members. + * To detach a source archive or folder from a package fragment root, specify + * null as the source path. + * + * @param sourcePath the given absolute path to the source archive or folder + * @param rootPath specifies the location of the root within the archive + * (empty specifies the default root and null specifies + * automatic detection of the root path) + * @param monitor the given progress monitor + * @exception JavaScriptModelException if this operation fails. Reasons include: + *
    + *
  • This JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A CoreException occurred while updating a server property + *
  • This package fragment root is not of kind binary (INVALID_ELEMENT_TYPES) + *
  • The path provided is not absolute (RELATIVE_PATH) + *
+ */ + void attachSource(IPath sourcePath, IPath rootPath, IProgressMonitor monitor) + throws JavaScriptModelException; + + /** + * Copies the resource of this package fragment root to the destination path + * as specified by IResource.copy(IPath, int, IProgressMonitor) + * but excluding nested source folders. + *

+ * If NO_RESOURCE_MODIFICATION is specified in + * updateModelFlags or if this package fragment root is external, + * this operation doesn't copy the resource. updateResourceFlags + * is then ignored. + *

+ * If DESTINATION_PROJECT_INCLUDEPATH is specified in + * updateModelFlags, updates the includepath of the + * destination's project (if it is a JavaScript project). If a non-null + * sibling is specified, a copy of this root's includepath entry is inserted before the + * sibling on the destination project's raw includepath. If null is + * specified, the includepath entry is added at the end of the raw includepath. + *

+ * If REPLACE is specified in updateModelFlags, + * overwrites the resource at the destination path if any. + * If the same includepath entry already exists on the destination project's raw + * includepath, then the sibling is ignored and the new includepath entry replaces the + * existing one. + *

+ * If no flags is specified in updateModelFlags (using + * IResource.NONE), the default behavior applies: the + * resource is copied (if this package fragment root is not external) and the + * includepath is not updated. + *

+ * + * @param destination the destination path + * @param updateResourceFlags bit-wise or of update resource flag constants + * (IResource.FORCE and IResource.SHALLOW) + * @param updateModelFlags bit-wise or of update resource flag constants + * (DESTINATION_PROJECT_INCLUDEPATH and + * NO_RESOURCE_MODIFICATION) + * @param sibling the includepath entry before which a copy of the includepath + * entry should be inserted or null if the includepath entry should + * be inserted at the end + * @param monitor a progress monitor + * + * @exception JavaScriptModelException if this root could not be copied. Reasons + * include: + *
    + *
  • This root does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A CoreException occurred while copying the + * resource or updating a includepath
  • + *
  • + * The destination is not inside an existing project and updateModelFlags + * has been specified as DESTINATION_PROJECT_INCLUDEPATH + * (INVALID_DESTINATION)
  • + *
  • The sibling is not a includepath entry on the destination project's + * raw includepath (INVALID_SIBLING)
  • + *
  • The same includepath entry already exists on the destination project's + * includepath (NAME_COLLISION) and updateModelFlags + * has not been specified as REPLACE
  • + *
+ * @see org.eclipse.core.resources.IResource#copy(IPath, boolean, IProgressMonitor) + */ + void copy(IPath destination, int updateResourceFlags, int updateModelFlags, IIncludePathEntry sibling, IProgressMonitor monitor) throws JavaScriptModelException; + /** + * Creates and returns a package fragment in this root with the + * given dot-separated package name. An empty string specifies the default package. + * This has the side effect of creating all package + * fragments that are a prefix of the new package fragment which + * do not exist yet. If the package fragment already exists, this + * has no effect. + * + * For a description of the force flag, see IFolder.create. + * + * @param name the given dot-separated package name + * @param force a flag controlling how to deal with resources that + * are not in sync with the local file system + * @param monitor the given progress monitor + * @exception JavaScriptModelException if the element could not be created. Reasons include: + *
    + *
  • This JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A CoreException occurred while creating an underlying resource + *
  • This package fragment root is read only (READ_ONLY) + *
  • The name is not a valid package name (INVALID_NAME) + *
+ * @return a package fragment in this root with the given dot-separated package name + * @see org.eclipse.core.resources.IFolder#create(boolean, boolean, IProgressMonitor) + */ + IPackageFragment createPackageFragment( + String name, + boolean force, + IProgressMonitor monitor) + throws JavaScriptModelException; + /** + * Deletes the resource of this package fragment root as specified by + * IResource.delete(int, IProgressMonitor) but excluding nested + * source folders. + *

+ * If NO_RESOURCE_MODIFICATION is specified in + * updateModelFlags or if this package fragment root is external, + * this operation doesn't delete the resource. updateResourceFlags + * is then ignored. + *

+ * If ORIGINATING_PROJECT_INCLUDEPATH is specified in + * updateModelFlags, update the raw includepath of this package + * fragment root's project by removing the corresponding includepath entry. + *

+ * If OTHER_REFERRING_PROJECTS_INCLUDEPATH is specified in + * updateModelFlags, update the raw includepaths of all other JavaScript + * projects referring to this root's resource by removing the corresponding includepath + * entries. + *

+ * If no flags is specified in updateModelFlags (using + * IResource.NONE), the default behavior applies: the + * resource is deleted (if this package fragment root is not external) and no + * includepaths are updated. + *

+ * + * @param updateResourceFlags bit-wise or of update resource flag constants + * (IResource.FORCE and IResource.KEEP_HISTORY) + * @param updateModelFlags bit-wise or of update resource flag constants + * (ORIGINATING_PROJECT_INCLUDEPATH, + * OTHER_REFERRING_PROJECTS_INCLUDEPATH and + * NO_RESOURCE_MODIFICATION) + * @param monitor a progress monitor + * + * @exception JavaScriptModelException if this root could not be deleted. Reasons + * include: + *
    + *
  • This root does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A CoreException occurred while deleting the resource + * or updating a includepath + *
  • + *
+ * @see org.eclipse.core.resources.IResource#delete(boolean, IProgressMonitor) + */ + void delete(int updateResourceFlags, int updateModelFlags, IProgressMonitor monitor) throws JavaScriptModelException; + /** + * Returns this package fragment root's kind encoded as an integer. + * A package fragment root can contain source files (i.e. files with one + * of the {@link JavaScriptCore#getJavaScriptLikeExtensions() JavaScript-like extensions}, + * or .class files, but not both. + * If the underlying folder or archive contains other kinds of files, they are ignored. + * In particular, .class files are ignored under a source package fragment root, + * and source files are ignored under a binary package fragment root. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return this package fragment root's kind encoded as an integer + * @see IPackageFragmentRoot#K_SOURCE + * @see IPackageFragmentRoot#K_BINARY + */ + int getKind() throws JavaScriptModelException; + + /** + * Returns an array of non-JavaScript resources contained in this package fragment root. + *

+ * Non-JavaScript resources includes other files and folders located in the same + * directories as the compilation units or class files under this package + * fragment root. Resources excluded from this package fragment root + * by virtue of inclusion/exclusion patterns on the corresponding source includepath + * entry are considered non-JavaScript resources and will appear in the result + * (possibly in a folder). Thus when a nested source folder is excluded, it will appear + * in the non-JavaScript resources of the outer folder. + *

+ * @return an array of non-JavaScript resources (IFiles, + * IFolders, or IStorages if the + * package fragment root is in archive) contained in this package + * fragment root + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @see IIncludePathEntry#getInclusionPatterns() + * @see IIncludePathEntry#getExclusionPatterns() + */ + Object[] getNonJavaScriptResources() throws JavaScriptModelException; + + /** + * Returns the package fragment with the given package name. + * An empty string indicates the default package. + * This is a handle-only operation. The package fragment + * may or may not exist. + * + * @param packageName the given package name + * @return the package fragment with the given package name + */ + IPackageFragment getPackageFragment(String packageName); + + + /** + * Returns the first raw includepath entry that corresponds to this package + * fragment root. + * A raw includepath entry corresponds to a package fragment root if once resolved + * this entry's path is equal to the root's path. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the first raw includepath entry that corresponds to this package fragment root + */ + IIncludePathEntry getRawIncludepathEntry() throws JavaScriptModelException; + + /** + * Returns the absolute path to the source archive attached to + * this package fragment root's binary archive. + * + * @return the absolute path to the corresponding source archive, + * or null if this package fragment root's binary archive + * has no corresponding source archive, or if this package fragment root + * is not a binary archive + * @exception JavaScriptModelException if this operation fails + */ + IPath getSourceAttachmentPath() throws JavaScriptModelException; + + /** + * Returns the path within this package fragment root's source archive. + * An empty path indicates that packages are located at the root of the + * source archive. + * + * @return the path within the corresponding source archive, + * or null if this package fragment root's binary archive + * has no corresponding source archive, or if this package fragment root + * is not a binary archive + * @exception JavaScriptModelException if this operation fails + */ + IPath getSourceAttachmentRootPath() throws JavaScriptModelException; + + /** + * Returns whether this package fragment root's underlying + * resource is a binary archive (a JAR or zip file). + *

+ * This is a handle-only method. + *

+ * + * @return true if this package fragment root's underlying resource is a binary archive, false otherwise + */ + public boolean isArchive(); + + public boolean isLanguageRuntime(); + /** + * Returns whether this package fragment root is external + * to the workbench (that is, a local file), and has no + * underlying resource. + *

+ * This is a handle-only method. + *

+ * + * @return true if this package fragment root is external + * to the workbench (that is, a local file), and has no + * underlying resource, false otherwise + */ + boolean isExternal(); + + /** + * Moves the resource of this package fragment root to the destination path + * as specified by IResource.move(IPath,int,IProgressMonitor) + * but excluding nested source folders. + *

+ * If NO_RESOURCE_MODIFICATION is specified in + * updateModelFlags or if this package fragment root is external, + * this operation doesn't move the resource. updateResourceFlags + * is then ignored. + *

+ * If DESTINATION_PROJECT_INCLUDEPATH is specified in + * updateModelFlags, updates the includepath of the + * destination's project (if it is a JavaScript project). If a non-null + * sibling is specified, a copy of this root's includepath entry is inserted before the + * sibling on the destination project's raw includepath. If null is + * specified, the includepath entry is added at the end of the raw includepath. + *

+ * If ORIGINATING_PROJECT_INCLUDEPATH is specified in + * updateModelFlags, update the raw includepath of this package + * fragment root's project by removing the corresponding includepath entry. + *

+ * If OTHER_REFERRING_PROJECTS_INCLUDEPATH is specified in + * updateModelFlags, update the raw includepaths of all other JavaScript + * projects referring to this root's resource by removing the corresponding includepath + * entries. + *

+ * If REPLACE is specified in updateModelFlags, + * overwrites the resource at the destination path if any. + * If the same includepath entry already exists on the destination project's raw + * includepath, then the sibling is ignored and the new includepath entry replaces the + * existing one. + *

+ * If no flags is specified in updateModelFlags (using + * IResource.NONE), the default behavior applies: the + * resource is moved (if this package fragment root is not external) and no + * includepaths are updated. + *

+ * + * @param destination the destination path + * @param updateResourceFlags bit-wise or of update flag constants + * (IResource.FORCE, IResource.KEEP_HISTORY + * and IResource.SHALLOW) + * @param updateModelFlags bit-wise or of update resource flag constants + * (DESTINATION_PROJECT_INCLUDEPATH, + * ORIGINATING_PROJECT_INCLUDEPATH, + * OTHER_REFERRING_PROJECTS_INCLUDEPATH and + * NO_RESOURCE_MODIFICATION) + * @param sibling the includepath entry before which a copy of the includepath + * entry should be inserted or null if the includepath entry should + * be inserted at the end + * @param monitor a progress monitor + * + * @exception JavaScriptModelException if this root could not be moved. Reasons + * include: + *
    + *
  • This root does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A CoreException occurred while copying the + * resource or updating a includepath
  • + *
  • + * The destination is not inside an existing project and updateModelFlags + * has been specified as DESTINATION_PROJECT_INCLUDEPATH + * (INVALID_DESTINATION)
  • + *
  • The sibling is not a includepath entry on the destination project's + * raw includepath (INVALID_SIBLING)
  • + *
  • The same includepath entry already exists on the destination project's + * includepath (NAME_COLLISION) and updateModelFlags + * has not been specified as REPLACE
  • + *
+ * @see org.eclipse.core.resources.IResource#move(IPath, boolean, IProgressMonitor) + */ + void move(IPath destination, int updateResourceFlags, int updateModelFlags, IIncludePathEntry sibling, IProgressMonitor monitor) throws JavaScriptModelException; + + public IIncludePathAttribute[] getIncludepathAttributes(); + + public IIncludePathEntry getResolvedIncludepathEntry() throws JavaScriptModelException; + + public boolean isLibrary(); +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IParent.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IParent.java new file mode 100644 index 0000000..dfd7622 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IParent.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +/** + * Common protocol for JavaScript elements that contain other JavaScript elements. + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IParent { +/** + * Returns the immediate children of this element. + * Unless otherwise specified by the implementing element, + * the children are in no particular order. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the immediate children of this element + */ +IJavaScriptElement[] getChildren() throws JavaScriptModelException; +/** + * Returns whether this element has one or more immediate children. + * This is a convenience method, and may be more efficient than + * testing whether getChildren is an empty array. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + * @return true if the immediate children of this element, false otherwise + */ +boolean hasChildren() throws JavaScriptModelException; +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IProblemRequestor.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IProblemRequestor.java new file mode 100644 index 0000000..0902752 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IProblemRequestor.java @@ -0,0 +1,58 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.wst.jsdt.core.compiler.IProblem; + +/** + * A callback interface for receiving javaScript problem as they are discovered + * by some JavaScript operation. + * + * @see IProblem + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IProblemRequestor { + + /** + * Notification of a JavaScript problem. + * + * @param problem IProblem - The discovered JavaScript problem. + */ + void acceptProblem(IProblem problem); + + /** + * Notification sent before starting the problem detection process. + * Typically, this would tell a problem collector to clear previously recorded problems. + */ + void beginReporting(); + + /** + * Notification sent after having completed problem detection process. + * Typically, this would tell a problem collector that no more problems should be expected in this + * iteration. + */ + void endReporting(); + + /** + * Predicate allowing the problem requestor to signal whether or not it is currently + * interested by problem reports. When answering false, problem will + * not be discovered any more until the next iteration. + * + * This predicate will be invoked once prior to each problem detection iteration. + * + * @return boolean - indicates whether the requestor is currently interested by problems. + */ + boolean isActive(); +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IRegion.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IRegion.java new file mode 100644 index 0000000..7164652 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IRegion.java @@ -0,0 +1,72 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +/** + * A JavaScript model region describes a hierarchical set of elements. + * Regions are often used to describe a set of elements to be considered + * when performing operations; for example, the set of elements to be + * considered during a search. A region may include elements from different + * projects. + *

+ * When an element is included in a region, all of its children + * are considered to be included. Children of an included element + * cannot be selectively excluded. + *

+ *

+ * This interface is not intended to be implemented by clients. + * Instances can be created via the JavaScriptCore.newRegion. + *

+ * + * @see JavaScriptCore#newRegion() + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IRegion { + /** + * Adds the given element and all of its descendents to this region. + * If the specified element is already included, or one of its + * ancestors is already included, this has no effect. If the element + * being added is an ancestor of an element already contained in this + * region, the ancestor subsumes the descendent. + * + * @param element the given element + */ + void add(IJavaScriptElement element); + /** + * Returns whether the given element is contained in this region. + * + * @param element the given element + * @return true if the given element is contained in this region, false otherwise + */ + boolean contains(IJavaScriptElement element); + /** + * Returns the top level elements in this region. + * All descendents of these elements are also included in this region. + * + * @return the top level elements in this region + */ + IJavaScriptElement[] getElements(); + /** + * Removes the specified element from the region and returns + * true if successful, false if the remove + * fails. If an ancestor of the given element is included, the + * remove fails (in other words, it is not possible to selectively + * exclude descendants of included ancestors). + * + * @param element the given element + * @return true if successful, false if the remove fails + */ + boolean remove(IJavaScriptElement element); +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ISourceManipulation.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ISourceManipulation.java new file mode 100644 index 0000000..2a237bd --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ISourceManipulation.java @@ -0,0 +1,118 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.core.runtime.IProgressMonitor; + +/** + * Common protocol for JavaScript elements that support source code manipulations such + * as copy, move, rename, and delete. + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface ISourceManipulation { +/** + * Copies this element to the given container. + * + * @param container the container + * @param sibling the sibling element before which the copy should be inserted, + * or null if the copy should be inserted as the last child of + * the container + * @param rename the new name for the element, or null if the copy + * retains the name of this element + * @param replace true if any existing child in the container with + * the target name should be replaced, and false to throw an + * exception in the event of a name collision + * @param monitor a progress monitor + * @exception JavaScriptModelException if this element could not be copied. Reasons include: + *
    + *
  • This JavaScript element, container element, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A CoreException occurred while updating an underlying resource + *
  • The container is of an incompatible type (INVALID_DESTINATION) + *
  • The sibling is not a child of the given container (INVALID_SIBLING) + *
  • The new name is invalid (INVALID_NAME) + *
  • A child in the container already exists with the same name (NAME_COLLISION) + * and replace has been specified as false + *
  • The container or this element is read-only (READ_ONLY) + *
+ * + * @exception IllegalArgumentException if container is null + */ +void copy(IJavaScriptElement container, IJavaScriptElement sibling, String rename, boolean replace, IProgressMonitor monitor) throws JavaScriptModelException; +/** + * Deletes this element, forcing if specified and necessary. + * + * @param force a flag controlling whether underlying resources that are not + * in sync with the local file system will be tolerated (same as the force flag + * in IResource operations). + * @param monitor a progress monitor + * @exception JavaScriptModelException if this element could not be deleted. Reasons include: + *
    + *
  • This JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A CoreException occurred while updating an underlying resource (CORE_EXCEPTION)
  • + *
  • This element is read-only (READ_ONLY)
  • + *
+ */ +void delete(boolean force, IProgressMonitor monitor) throws JavaScriptModelException; +/** + * Moves this element to the given container. + * + * @param container the container + * @param sibling the sibling element before which the element should be inserted, + * or null if the element should be inserted as the last child of + * the container + * @param rename the new name for the element, or null if the + * element retains its name + * @param replace true if any existing child in the container with + * the target name should be replaced, and false to throw an + * exception in the event of a name collision + * @param monitor a progress monitor + * @exception JavaScriptModelException if this element could not be moved. Reasons include: + *
    + *
  • This JavaScript element, container element, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A CoreException occurred while updating an underlying resource + *
  • The container is of an incompatible type (INVALID_DESTINATION) + *
  • The sibling is not a child of the given container (INVALID_SIBLING) + *
  • The new name is invalid (INVALID_NAME) + *
  • A child in the container already exists with the same name (NAME_COLLISION) + * and replace has been specified as false + *
  • The container or this element is read-only (READ_ONLY) + *
+ * + * @exception IllegalArgumentException if container is null + */ +void move(IJavaScriptElement container, IJavaScriptElement sibling, String rename, boolean replace, IProgressMonitor monitor) throws JavaScriptModelException; +/** + * Renames this element to the given name. + * + * @param name the new name for the element + * @param replace true if any existing element with the target name + * should be replaced, and false to throw an exception in the + * event of a name collision + * @param monitor a progress monitor + * @exception JavaScriptModelException if this element could not be renamed. Reasons include: + *
    + *
  • This JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A CoreException occurred while updating an underlying resource + *
  • The new name is invalid (INVALID_NAME) + *
  • A child in the container already exists with the same name (NAME_COLLISION) + * and replace has been specified as false + *
  • This element is read-only (READ_ONLY) + *
+ */ +void rename(String name, boolean replace, IProgressMonitor monitor) throws JavaScriptModelException; +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ISourceRange.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ISourceRange.java new file mode 100644 index 0000000..cfe0677 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ISourceRange.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +/** + * A source range defines an element's source coordinates relative to + * its source buffer. + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface ISourceRange { + +/** + * Returns the number of characters of the source code for this element, + * relative to the source buffer in which this element is contained. + * + * @return the number of characters of the source code for this element, + * relative to the source buffer in which this element is contained + */ +int getLength(); +/** + * Returns the 0-based index of the first character of the source code for this element, + * relative to the source buffer in which this element is contained. + * + * @return the 0-based index of the first character of the source code for this element, + * relative to the source buffer in which this element is contained + */ +int getOffset(); +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ISourceReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ISourceReference.java new file mode 100644 index 0000000..7f84bad --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ISourceReference.java @@ -0,0 +1,61 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +/** + * Common protocol for JavaScript elements that have associated source code. + * This set consists of IClassFile, IJavaScriptUnit, + * IPackageDeclaration, IImportDeclaration, + * IImportContainer, IType, IField, + * IFunction, and IInitializer. + *

+ * Source reference elements may be working copies if they were created from + * a compilation unit that is a working copy. + *

+ *

+ * This interface is not intended to be implemented by clients. + *

+ * + * @see IPackageFragmentRoot#attachSource(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IProgressMonitor) + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface ISourceReference { +/** + * Returns whether this element exists in the model. + * + * @return true if this element exists in the JavaScript model + */ +boolean exists(); + +/** + * Returns the source code associated with this element. + * This extracts the substring from the source buffer containing this source + * element. This corresponds to the source range that would be returned by + * getSourceRange. + * + * @return the source code, or null if this element has no + * associated source code + * @exception JavaScriptModelException if an exception occurs while accessing its corresponding resource + */ +String getSource() throws JavaScriptModelException; +/** + * Returns the source range associated with this element. + * + * @return the source range, or null if this element has no + * associated source code + * @exception JavaScriptModelException if an exception occurs while accessing its corresponding resource + */ +ISourceRange getSourceRange() throws JavaScriptModelException; +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IType.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IType.java new file mode 100644 index 0000000..4cf7706 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IType.java @@ -0,0 +1,716 @@ +/******************************************************************************* + * Copyright (c) 2000, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * IBM Corporation - added J2SE 1.5 support + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import java.io.InputStream; + +import org.eclipse.core.runtime.IProgressMonitor; + +/** + * Represents a source type in a JavaScript file (either a top-level + * type, a member type, or a local type) + *

+ *

+ * The children are of type IMember, which includes IField, + * IFunction, IInitializer and IType. + * The children are listed in the order in which they appear in the source file. + *

+ *

+ * This interface is not intended to be implemented by clients. + *

+ *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + *

+ */ +public interface IType extends IMember, IFunctionContainer { + + /** + * Do code completion inside a code snippet in the context of the current type. + * + * If the type can access to his source code and the insertion position is valid, + * then completion is performed against source. Otherwise the completion is performed + * against type structure and given locals variables. + * + * @param snippet the code snippet + * @param insertion the position with in source where the snippet + * is inserted. This position must not be in comments. + * A possible value is -1, if the position is not known. + * @param position the position within snippet where the user + * is performing code assist. + * @param localVariableTypeNames an array (possibly empty) of fully qualified + * type names of local variables visible at the current scope + * @param localVariableNames an array (possibly empty) of local variable names + * that are visible at the current scope + * @param localVariableModifiers an array (possible empty) of modifiers for + * local variables + * @param isStatic whether the current scope is in a static context + * @param requestor the completion requestor + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + */ + void codeComplete( + char[] snippet, + int insertion, + int position, + char[][] localVariableTypeNames, + char[][] localVariableNames, + int[] localVariableModifiers, + boolean isStatic, + CompletionRequestor requestor) + throws JavaScriptModelException; + + /** + * Do code completion inside a code snippet in the context of the current type. + * It considers types in the working copies with the given owner first. In other words, + * the owner's working copies will take precedence over their original compilation units + * in the workspace. + *

+ * Note that if a working copy is empty, it will be as if the original compilation + * unit had been deleted. + *

+ * If the type can access to his source code and the insertion position is valid, + * then completion is performed against source. Otherwise the completion is performed + * against type structure and given locals variables. + *

+ * + * @param snippet the code snippet + * @param insertion the position with in source where the snippet + * is inserted. This position must not be in comments. + * A possible value is -1, if the position is not known. + * @param position the position with in snippet where the user + * is performing code assist. + * @param localVariableTypeNames an array (possibly empty) of fully qualified + * type names of local variables visible at the current scope + * @param localVariableNames an array (possibly empty) of local variable names + * that are visible at the current scope + * @param localVariableModifiers an array (possible empty) of modifiers for + * local variables + * @param isStatic whether the current scope is in a static context + * @param requestor the completion requestor + * @param owner the owner of working copies that take precedence over their original compilation units + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + */ + void codeComplete( + char[] snippet, + int insertion, + int position, + char[][] localVariableTypeNames, + char[][] localVariableNames, + int[] localVariableModifiers, + boolean isStatic, + CompletionRequestor requestor, + WorkingCopyOwner owner) + throws JavaScriptModelException; + + + /** + * Creates and returns a field in this type with the + * given contents. + *

+ * Optionally, the new element can be positioned before the specified + * sibling. If no sibling is specified, the element will be inserted + * as the last field declaration in this type.

+ * + *

It is possible that a field with the same name already exists in this type. + * The value of the force parameter effects the resolution of + * such a conflict:

    + *
  • true - in this case the field is created with the new contents
  • + *
  • false - in this case a JavaScriptModelException is thrown
  • + *

+ * + * @param contents the given contents + * @param sibling the given sibling + * @param force a flag in case the same name already exists in this type + * @param monitor the given progress monitor + * @exception JavaScriptModelException if the element could not be created. Reasons include: + *
    + *
  • This JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A CoreException occurred while updating an underlying resource + *
  • The specified sibling is not a child of this type (INVALID_SIBLING) + *
  • The contents could not be recognized as a field declaration (INVALID_CONTENTS) + *
  • This type is read-only (binary) (READ_ONLY) + *
  • There was a naming collision with an existing field (NAME_COLLISION) + *
+ * @return a field in this type with the given contents + */ + IField createField(String contents, IJavaScriptElement sibling, boolean force, IProgressMonitor monitor) + throws JavaScriptModelException; + + + /** + * Creates and returns a method or constructor in this type with the + * given contents. + *

+ * Optionally, the new element can be positioned before the specified + * sibling. If no sibling is specified, the element will be appended + * to this type. + * + *

It is possible that a method with the same signature already exists in this type. + * The value of the force parameter effects the resolution of + * such a conflict:

    + *
  • true - in this case the method is created with the new contents
  • + *
  • false - in this case a JavaScriptModelException is thrown
  • + *

+ * + * @param contents the given contents + * @param sibling the given sibling + * @param force a flag in case the same name already exists in this type + * @param monitor the given progress monitor + * @exception JavaScriptModelException if the element could not be created. Reasons include: + *
    + *
  • This JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A CoreException occurred while updating an underlying resource + *
  • The specified sibling is not a child of this type (INVALID_SIBLING) + *
  • The contents could not be recognized as a method or constructor + * declaration (INVALID_CONTENTS) + *
  • This type is read-only (binary) (READ_ONLY) + *
  • There was a naming collision with an existing method (NAME_COLLISION) + *
+ * @return a method or constructor in this type with the given contents + */ + IFunction createMethod(String contents, IJavaScriptElement sibling, boolean force, IProgressMonitor monitor) + throws JavaScriptModelException; + + /** + * Creates and returns a type in this type with the + * given contents. + *

+ * Optionally, the new type can be positioned before the specified + * sibling. If no sibling is specified, the type will be appended + * to this type.

+ * + *

It is possible that a type with the same name already exists in this type. + * The value of the force parameter effects the resolution of + * such a conflict:

    + *
  • true - in this case the type is created with the new contents
  • + *
  • false - in this case a JavaScriptModelException is thrown
  • + *

+ * + * @param contents the given contents + * @param sibling the given sibling + * @param force a flag in case the same name already exists in this type + * @param monitor the given progress monitor + * @exception JavaScriptModelException if the element could not be created. Reasons include: + *
    + *
  • This JavaScript element does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
  • A CoreException occurred while updating an underlying resource + *
  • The specified sibling is not a child of this type (INVALID_SIBLING) + *
  • The contents could not be recognized as a type declaration (INVALID_CONTENTS) + *
  • This type is read-only (binary) (READ_ONLY) + *
  • There was a naming collision with an existing field (NAME_COLLISION) + *
+ * @return a type in this type with the given contents + */ + IType createType(String contents, IJavaScriptElement sibling, boolean force, IProgressMonitor monitor) + throws JavaScriptModelException; + + /** + * Finds the methods in this type that correspond to + * the given method. + * A method m1 corresponds to another method m2 if: + *
    + *
  • m1 has the same element name as m2. + *
  • m1 has the same number of arguments as m2 and + * the simple names of the argument types must be equals. + *
  • m1 exists. + *
+ * @param method the given method + * @return the found method or null if no such methods can be found. + * + */ + IFunction[] findMethods(IFunction method); + + /** + * Returns the children of this type that have the given category as a @category tag. + * Returns an empty array if no children with this category exist. + * + * @return the children for the given category. + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + */ + IJavaScriptElement[] getChildrenForCategory(String category) throws JavaScriptModelException; + + /** + * Returns the simple name of this type, unqualified by package or enclosing type. + * This is a handle-only method. + * + * @return the simple name of this type + */ + String getElementName(); + + /** + * Returns the field with the specified name + * in this type (for example, "bar"). + * This is a handle-only method. The field may or may not exist. + * + * @param name the given name + * @return the field with the specified name in this type + */ + IField getField(String name); + + /** + * Returns the fields declared by this type. + * If this is a source type, the results are listed in the order + * in which they appear in the source, otherwise, the results are + * in no particular order. For binary types, this includes synthetic fields. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the fields declared by this type + */ + IField[] getFields() throws JavaScriptModelException; + + /** + * Returns the fully qualified name of this type, + * including qualification for any containing types and packages. + * This is the name of the package, followed by '.', + * followed by the type-qualified name. + * This is a handle-only method. + * + * @see IType#getTypeQualifiedName() + * @return the fully qualified name of this type + */ + String getFullyQualifiedName(); + + /** + * Returns the fully qualified name of this type, + * including qualification for any containing types and packages. + * This is the name of the package, followed by '.', + * followed by the type-qualified name using the enclosingTypeSeparator. + * + * + * This is a handle-only method. + * + * @param enclosingTypeSeparator the given enclosing type separator + * @return the fully qualified name of this type, including qualification for any containing types and packages + * @see IType#getTypeQualifiedName(char) + */ + String getFullyQualifiedName(char enclosingTypeSeparator); + + /** + * Returns this type's fully qualified name + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the fully qualified parameterized representation of this type + */ + String getFullyQualifiedParameterizedName() throws JavaScriptModelException; + + /** + * Returns the initializer with the specified position relative to + * the order they are defined in the source. + * Numbering starts at 1 (thus the first occurrence is occurrence 1, not occurrence 0). + * This is a handle-only method. The initializer may or may not be present. + * + * @param occurrenceCount the specified position + * @return the initializer with the specified position relative to the order they are defined in the source + */ + IInitializer getInitializer(int occurrenceCount); + + /** + * Returns the initializers declared by this type. + * For binary types this is an empty collection. + * If this is a source type, the results are listed in the order + * in which they appear in the source. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the initializers declared by this type + */ + IInitializer[] getInitializers() throws JavaScriptModelException; + + /** + * Returns the binding key for this type. A binding key is a key that uniquely + * identifies this type. It allows access to generic info for parameterized + * types. + * + * @return the binding key for this type + * @see org.eclipse.wst.jsdt.core.dom.IBinding#getKey() + * @see BindingKey + */ + String getKey(); + + /** + * Returns the method with the specified name and parameter types + * in this type (for example, "foo", {"I", "QString;"}). + * To get the handle for a constructor, the name specified must be the + * simple name of the enclosing type. + * This is a handle-only method. The method may or may not be present. + *

+ * The type signatures may be either unresolved (for source types) + * or resolved (for binary types), and either basic (for basic types) + * or rich (for parameterized types). See {@link Signature} for details. + *

+ * + * @param name the given name + * @param parameterTypeSignatures the given parameter types + * @return the method with the specified name and parameter types in this type + */ + IFunction getFunction(String name, String[] parameterTypeSignatures); + + /** + * Returns the methods and constructors declared by this type. + * For binary types, this may include the special <clinit>; method + * and synthetic methods. + * If this is a source type, the results are listed in the order + * in which they appear in the source, otherwise, the results are + * in no particular order. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the methods and constructors declared by this type + */ + IFunction[] getFunctions() throws JavaScriptModelException; + + /** + * Returns the source folder (package fragment) in which this element is defined. + * This is a handle-only method. + * + * @return the package fragment in which this element is defined + */ + IPackageFragment getPackageFragment(); + + /** + * Returns the name of this type's superclass, or null + * for source types that do not specify a superclass. + *

+ * For interfaces, the superclass name is always "java.lang.Object". + * For source types, the name as declared is returned, for binary types, + * the resolved, qualified name is returned. + * For anonymous types, the superclass name is the name appearing after the 'new' keyword'. + * If the superclass is a parameterized type, the string + * may include its type arguments enclosed in "<>". + * If the returned string is needed for anything other than display + * purposes, use {@link #getSuperclassTypeSignature()} which returns + * a structured type signature string containing more precise information. + *

+ * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the name of this type's superclass, or null for source types that do not specify a superclass + */ + String getSuperclassName() throws JavaScriptModelException; + + /** + * Returns the type signature of this type's superclass, or + * null if none. + *

+ * The type signature may be either unresolved (for source types) + * or resolved (for binary types), and either basic (for basic types) + * or rich (for parameterized types). See {@link Signature} for details. + *

+ * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the type signature of this type's superclass, or + * null if none + */ + String getSuperclassTypeSignature() throws JavaScriptModelException; + + /** + * Returns the member type declared in this type with the given simple name. + * This is a handle-only method. The type may or may not exist. + * + * @param name the given simple name + * @return the member type declared in this type with the given simple name + */ + IType getType(String name); + + /** + * Returns the type-qualified name of this type, + * including qualification for any enclosing types, + * but not including package qualification. + * This is a handle-only method. + * + * @return the type-qualified name of this type + */ + String getTypeQualifiedName(); + + /** + * Returns the type-qualified name of this type, + * including qualification for any enclosing types, + * but not including package qualification. + * + * This is a handle-only method. + * + * @param enclosingTypeSeparator the specified enclosing type separator + * @return the type-qualified name of this type + */ + String getTypeQualifiedName(char enclosingTypeSeparator); + + /** + * Returns the immediate member types declared by this type. + * The results are listed in the order in which they appear in the source or class file. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the immediate member types declared by this type + */ + IType[] getTypes() throws JavaScriptModelException; + + /** + * Returns whether this type represents an anonymous type. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return true if this type represents an anonymous type, false otherwise + */ + boolean isAnonymous() throws JavaScriptModelException; + + /** + * Returns whether this type is read-only. + *

+ * Note that a class can neither be an interface, an enumeration class, nor an annotation type. + *

+ * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return true if this type represents a class, false otherwise + */ + boolean isClass() throws JavaScriptModelException; + + /** + * Returns whether this type represents a local type. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return true if this type represents a local type, false otherwise + */ + boolean isLocal() throws JavaScriptModelException; + + /** + * Returns whether this type represents a member type. + * + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return true if this type represents a member type, false otherwise + */ + boolean isMember() throws JavaScriptModelException; + /** + * Returns whether this type represents a resolved type. + * If a type is resolved, its key contains resolved information. + * + * @return whether this type represents a resolved type. + */ + boolean isResolved(); + /** + * Loads a previously saved ITypeHierarchy from an input stream. A type hierarchy can + * be stored using ITypeHierachy#store(OutputStream). + * + * Only hierarchies originally created by the following methods can be loaded: + *
    + *
  • IType#newSupertypeHierarchy(IProgressMonitor)
  • + *
  • IType#newTypeHierarchy(IJavaScriptProject, IProgressMonitor)
  • + *
  • IType#newTypeHierarchy(IProgressMonitor)
  • + *
+ * + * @param input stream where hierarchy will be read + * @param monitor the given progress monitor + * @return the stored hierarchy + * @exception JavaScriptModelException if the hierarchy could not be restored, reasons include: + * - type is not the focus of the hierarchy or + * - unable to read the input stream (wrong format, IOException during reading, ...) + * @see ITypeHierarchy#store(java.io.OutputStream, IProgressMonitor) + */ + ITypeHierarchy loadTypeHierachy(InputStream input, IProgressMonitor monitor) throws JavaScriptModelException; + /** + * Creates and returns a type hierarchy for this type containing + * this type and all of its supertypes. + * + * @param monitor the given progress monitor + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return a type hierarchy for this type containing this type and all of its supertypes + */ + ITypeHierarchy newSupertypeHierarchy(IProgressMonitor monitor) throws JavaScriptModelException; + + /** + * Creates and returns a type hierarchy for this type containing + * this type and all of its supertypes, considering types in the given + * working copies. In other words, the list of working copies will take + * precedence over their original compilation units in the workspace. + *

+ * Note that passing an empty working copy will be as if the original compilation + * unit had been deleted. + *

+ * + * @param workingCopies the working copies that take precedence over their original compilation units + * @param monitor the given progress monitor + * @return a type hierarchy for this type containing this type and all of its supertypes + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + */ + ITypeHierarchy newSupertypeHierarchy(IJavaScriptUnit[] workingCopies, IProgressMonitor monitor) + throws JavaScriptModelException; + + /** + * Creates and returns a type hierarchy for this type containing + * this type and all of its supertypes, considering types in the + * working copies with the given owner. + * In other words, the owner's working copies will take + * precedence over their original compilation units in the workspace. + *

+ * Note that if a working copy is empty, it will be as if the original compilation + * unit had been deleted. + *

+ * + * @param owner the owner of working copies that take precedence over their original compilation units + * @param monitor the given progress monitor + * @return a type hierarchy for this type containing this type and all of its supertypes + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + */ + ITypeHierarchy newSupertypeHierarchy(WorkingCopyOwner owner, IProgressMonitor monitor) + throws JavaScriptModelException; + + /** + * Creates and returns a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes + * in the context of the given project. + * + * @param project the given project + * @param monitor the given progress monitor + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes + * in the context of the given project + */ + ITypeHierarchy newTypeHierarchy(IJavaScriptProject project, IProgressMonitor monitor) throws JavaScriptModelException; + + /** + * Creates and returns a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes + * in the context of the given project, considering types in the + * working copies with the given owner. + * In other words, the owner's working copies will take + * precedence over their original compilation units in the workspace. + *

+ * Note that if a working copy is empty, it will be as if the original compilation + * unit had been deleted. + *

+ * + * @param project the given project + * @param owner the owner of working copies that take precedence over their original compilation units + * @param monitor the given progress monitor + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes + * in the context of the given project + */ + ITypeHierarchy newTypeHierarchy(IJavaScriptProject project, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaScriptModelException; + + /** + * Creates and returns a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes in the workspace. + * + * @param monitor the given progress monitor + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes in the workspace + */ + ITypeHierarchy newTypeHierarchy(IProgressMonitor monitor) throws JavaScriptModelException; + + /** + * Creates and returns a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes in the workspace, + * considering types in the given working copies. In other words, the list of working + * copies that will take precedence over their original compilation units in the workspace. + *

+ * Note that passing an empty working copy will be as if the original compilation + * unit had been deleted. + * + * @param workingCopies the working copies that take precedence over their original compilation units + * @param monitor the given progress monitor + * @return a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes in the workspace + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + */ + ITypeHierarchy newTypeHierarchy(IJavaScriptUnit[] workingCopies, IProgressMonitor monitor) throws JavaScriptModelException; + + /** + * Creates and returns a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes in the workspace, + * considering types in the working copies with the given owner. + * In other words, the owner's working copies will take + * precedence over their original compilation units in the workspace. + *

+ * Note that if a working copy is empty, it will be as if the original compilation + * unit had been deleted. + *

+ * + * @param owner the owner of working copies that take precedence over their original compilation units + * @param monitor the given progress monitor + * @return a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes in the workspace + * @exception JavaScriptModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + */ + ITypeHierarchy newTypeHierarchy(WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaScriptModelException; + + /** + * Resolves the given type name within the context of this type (depending on the type hierarchy + * and its imports). + *

+ * Multiple answers might be found in case there are ambiguous matches. + *

+ *

+ * Each matching type name is decomposed as an array of two strings, the first denoting the package + * name (dot-separated) and the second being the type name. The package name is empty if it is the + * default package. The type name is the type qualified name using a '.' enclosing type separator. + *

+ *

+ * Returns null if unable to find any matching type. + *

+ * + * @param typeName the given type name + * @exception JavaScriptModelException if code resolve could not be performed. + * @return the resolved type names or null if unable to find any matching type + * @see #getTypeQualifiedName(char) + */ + String[][] resolveType(String typeName) throws JavaScriptModelException; + + /** + * Resolves the given type name within the context of this type (depending on the type hierarchy + * and its imports) and using the given owner's working copies, considering types in the + * working copies with the given owner. In other words, the owner's working copies will take + * precedence over their original compilation units in the workspace. + *

+ * Note that if a working copy is empty, it will be as if the original compilation + * unit had been deleted. + *

+ *

Multiple answers might be found in case there are ambiguous matches. + *

+ *

+ * Each matching type name is decomposed as an array of two strings, the first denoting the package + * name (dot-separated) and the second being the type name. The package name is empty if it is the + * default package. The type name is the type qualified name using a '.' enclosing type separator. + *

+ *

+ * Returns null if unable to find any matching type. + *

+ * + * @param typeName the given type name + * @param owner the owner of working copies that take precedence over their original compilation units + * @exception JavaScriptModelException if code resolve could not be performed. + * @return the resolved type names or null if unable to find any matching type + * @see #getTypeQualifiedName(char) + */ + String[][] resolveType(String typeName, WorkingCopyOwner owner) throws JavaScriptModelException; +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ITypeHierarchy.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ITypeHierarchy.java new file mode 100644 index 0000000..9706826 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ITypeHierarchy.java @@ -0,0 +1,180 @@ +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import java.io.OutputStream; + +import org.eclipse.core.runtime.IProgressMonitor; + +/** + * A type hierarchy provides navigations between a type and its resolved + * supertypes and subtypes for a specific type or for all types within a region. + * Supertypes may extend outside of the type hierarchy's region in which it was + * created such that the root of the hierarchy is always included. + *

+ * A type hierarchy is static and can become stale. Although consistent when + * created, it does not automatically track changes in the model. + * As changes in the model potentially invalidate the hierarchy, change notifications + * are sent to registered ITypeHierarchyChangedListeners. Listeners should + * use the exists method to determine if the hierarchy has become completely + * invalid (for example, when the type or project the hierarchy was created on + * has been removed). To refresh a hierarchy, use the refresh method. + *

+ *

+ * The type hierarchy may contain cycles due to malformed supertype declarations. + * Most type hierarchy queries are oblivious to cycles; the getAll* + * methods are implemented such that they are unaffected by cycles. + *

+ *

+ * This interface is not intended to be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface ITypeHierarchy { +/** + * Adds the given listener for changes to this type hierarchy. Listeners are + * notified when this type hierarchy changes and needs to be refreshed. + * Has no effect if an identical listener is already registered. + * + * @param listener the listener + */ +void addTypeHierarchyChangedListener(ITypeHierarchyChangedListener listener); +/** + * Returns whether the given type is part of this hierarchy. + * + * @param type the given type + * @return true if the given type is part of this hierarchy, false otherwise + */ +boolean contains(IType type); +/** + * Returns whether the type and project this hierarchy was created on exist. + * @return true if the type and project this hierarchy was created on exist, false otherwise + */ +boolean exists(); +/** + * Returns all classes in this type hierarchy's graph, in no particular + * order. Any classes in the creation region which were not resolved to + * have any subtypes or supertypes are not included in the result. + * + * @return all classes in this type hierarchy's graph + */ +IType[] getAllClasses(); +/** + * Returns all resolved subtypes (direct and indirect) of the + * given type, in no particular order, limited to the + * types in this type hierarchy's graph. An empty array + * is returned if there are no resolved subtypes for the + * given type. + * + * @param type the given type + * @return all resolved subtypes (direct and indirect) of the given type + */ +IType[] getAllSubtypes(IType type); +/** + * Returns all resolved superclasses of the + * given class, in bottom-up order. An empty array + * is returned if there are no resolved superclasses for the + * given class. + * + *

NOTE: once a type hierarchy has been created, it is more efficient to + * query the hierarchy for superclasses than to query a class recursively up + * the superclass chain. Querying an element performs a dynamic resolution, + * whereas the hierarchy returns a pre-computed result. + * + * @param type the given type + * @return all resolved superclasses of the given class, in bottom-up order, an empty + * array if none. + */ +IType[] getAllSuperclasses(IType type); +/** + * Return the flags associated with the given type (would be equivalent to IMember.getFlags()), + * or -1 if this information wasn't cached on the hierarchy during its computation. + * + * @param type the given type + * @return the modifier flags for this member + * @see Flags + */ +int getCachedFlags(IType type); +/** + * Returns all classes in the graph which have no resolved superclass, + * in no particular order. + * + * @return all classes in the graph which have no resolved superclass + */ +IType[] getRootClasses(); +/** + * Returns the direct resolved subclasses of the given class, + * in no particular order, limited to the classes in this + * type hierarchy's graph. + * Returns an empty collection if no classes were resolved to be subclasses of the given + * class. + * + * @param type the given type + * @return the direct resolved subclasses of the given class limited to the classes in this + * type hierarchy's graph, an empty collection if none. + */ +IType[] getSubclasses(IType type); +/** + * Returns the resolved superclass of the given class, + * or null if the given class has no superclass or + * the superclass could not be resolved. + * + * @param type the given type + * @return the resolved superclass of the given class, + * or null if the given class has no superclass or + * the superclass could not be resolved. + */ +IType getSuperclass(IType type); +/** + * Returns the type this hierarchy was computed for. + * Returns null if this hierarchy was computed for a region. + * + * @return the type this hierarchy was computed for + */ +IType getType(); +/** + * Re-computes the type hierarchy reporting progress. + * + * @param monitor the given progress monitor + * @exception JavaScriptModelException if unable to refresh the hierarchy + */ +void refresh(IProgressMonitor monitor) throws JavaScriptModelException; +/** + * Removes the given listener from this type hierarchy. + * Has no affect if an identical listener is not registered. + * + * @param listener the listener + */ +void removeTypeHierarchyChangedListener(ITypeHierarchyChangedListener listener); +/** + * Stores the type hierarchy in an output stream. This stored hierarchy can be load by + * IType#loadTypeHierachy(IJavaScriptProject, InputStream, IProgressMonitor). + * Listeners of this hierarchy are not stored. + * + * Only hierarchies created by the following methods can be store: + *

    + *
  • IType#newSupertypeHierarchy(IProgressMonitor)
  • + *
  • IType#newTypeHierarchy(IJavaScriptProject, IProgressMonitor)
  • + *
  • IType#newTypeHierarchy(IProgressMonitor)
  • + *
+ * + * @param outputStream output stream where the hierarchy will be stored + * @param monitor the given progress monitor + * @exception JavaScriptModelException if unable to store the hierarchy in the ouput stream + * @see IType#loadTypeHierachy(java.io.InputStream, IProgressMonitor) + * @since 2.1 + */ +void store(OutputStream outputStream, IProgressMonitor monitor) throws JavaScriptModelException; +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ITypeHierarchyChangedListener.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ITypeHierarchyChangedListener.java new file mode 100644 index 0000000..a831f14 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ITypeHierarchyChangedListener.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +/** + * A listener which gets notified when a particular type hierarchy object + * changes. + *

+ * This interface may be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface ITypeHierarchyChangedListener { + /** + * Notifies that the given type hierarchy has changed in some way and should + * be refreshed at some point to make it consistent with the current state of + * the JavaScript model. + * + * @param typeHierarchy the given type hierarchy + */ + void typeHierarchyChanged(ITypeHierarchy typeHierarchy); +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ITypeRoot.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ITypeRoot.java new file mode 100644 index 0000000..01a99be --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ITypeRoot.java @@ -0,0 +1,103 @@ +/******************************************************************************* + * Copyright (c) 2007, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.core.runtime.IProgressMonitor; + + +/** + * Represents an entire JavaScript type root (either an IJavaScriptUnit + * or an IClassFile). + * + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * @see IJavaScriptUnit Note that methods {@link #findPrimaryType()} and {@link #getElementAt(int)} + * were already implemented in this interface respectively since version 3.0 and version 1.0. + * @see IClassFile Note that method {@link #getWorkingCopy(WorkingCopyOwner, IProgressMonitor)} + * was already implemented in this interface since version 3.0. + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface ITypeRoot extends IJavaScriptElement, IParent, IOpenable, ISourceReference, ICodeAssist, IFunctionContainer { + +/** + * Finds the primary type of this JavaScript type root (that is, the type with the same name as the + * javascript file), or null if no such a type exists. + * + * @return the found primary type of this JavaScript type root, or null if no such a type exists + */ +IType findPrimaryType(); + +/** + * Returns the smallest element within this JavaScript type root that + * includes the given source position (that is, a method, field, etc.), or + * null if there is no element other than the JavaScript type root + * itself at the given position, or if the given position is not + * within the source range of the source of this JavaScript type root. + * + * @param position a source position inside the JavaScript type root + * @return the innermost JavaScript element enclosing a given source position or null + * if none (excluding the JavaScript type root). + * @throws JavaScriptModelException if the JavaScript type root does not exist or if an + * exception occurs while accessing its corresponding resource + */ +IJavaScriptElement getElementAt(int position) throws JavaScriptModelException; + +/** + * Returns a shared working copy on this javaScirpt file using the given working copy owner to create + * the buffer. If this is already a working copy of the given owner, the element itself is returned. + * This API can only answer an already existing working copy if it is based on the same + * original JavaScript type root AND was using the same working copy owner (that is, as defined by {@link Object#equals}). + *

+ * The life time of a shared working copy is as follows: + *

    + *
  • The first call to {@link #getWorkingCopy(WorkingCopyOwner, IProgressMonitor)} + * creates a new working copy for this element
  • + *
  • Subsequent calls increment an internal counter.
  • + *
  • A call to {@link IJavaScriptUnit#discardWorkingCopy()} decrements the internal counter.
  • + *
  • When this counter is 0, the working copy is discarded. + *
+ * So users of this method must discard exactly once the working copy. + *

+ * Note that the working copy owner will be used for the life time of the shared working copy, that is if the + * working copy is closed then reopened, this owner will be used. + * The buffer will be automatically initialized with the original's JavaScript type root content upon creation. + *

+ * When the shared working copy instance is created, an ADDED IJavaScriptElementDelta is reported on this + * working copy. + *

+ * A working copy can be created on a not-yet existing compilation unit. + * In particular, such a working copy can then be committed in order to create + * the corresponding compilation unit. + *

+ * Note that possible problems of this working copy are reported using this method. only + * if the given working copy owner returns a problem requestor for this working copy + * (see {@link WorkingCopyOwner#getProblemRequestor(IJavaScriptUnit)}). + *

+ * + * @param owner the working copy owner that creates a buffer that is used to get the content + * of the working copy + * @param monitor a progress monitor used to report progress while opening this compilation unit + * or null if no progress should be reported + * @throws JavaScriptModelException if the contents of this element can + * not be determined. + * @return a new working copy of this JavaScript type root using the given owner to create + * the buffer, or this JavaScript type root if it is already a working copy + */ +IJavaScriptUnit getWorkingCopy(WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaScriptModelException; + + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JSDScopeUtil.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JSDScopeUtil.java new file mode 100644 index 0000000..9fc632e --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JSDScopeUtil.java @@ -0,0 +1,86 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +/** + * + */ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.core.runtime.IPath; +import org.eclipse.wst.jsdt.internal.core.ClassFile; + +/** + * (mostly) static methods to figure out includepath entries and container initializers * + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public class JSDScopeUtil { + + + + + + public static JsGlobalScopeContainerInitializer getContainerInitializer(IPath classPathEntry) { + if(classPathEntry==null ) return null; + JsGlobalScopeContainerInitializer initializer= JavaScriptCore.getJsGlobalScopeContainerInitializer(classPathEntry.segment(0)); + return initializer ; + } + + public IIncludePathEntry[] getIncludepathEntries(IJsGlobalScopeContainer container) { + + + if(container!=null) return container.getIncludepathEntries(); + + return new IIncludePathEntry[0]; + } + + public IJsGlobalScopeContainer getLibraryContainer(IPath cpEntry, IJavaScriptProject javaProject) { + IJsGlobalScopeContainer container=null; + try { + container = JavaScriptCore.getJsGlobalScopeContainer(cpEntry, javaProject); + } catch (JavaScriptModelException ex) { + // TODO Auto-generated catch block + ex.printStackTrace(); + } + return container; + } + + public static JsGlobalScopeContainerInitializer findLibraryInitializer(IPath compUnitPath, IJavaScriptProject javaProject) { + IPackageFragmentRoot[] roots = new IPackageFragmentRoot[0]; + try { + roots = javaProject.getAllPackageFragmentRoots(); + } catch (JavaScriptModelException ex) { + // TODO Auto-generated catch block + ex.printStackTrace(); + } + for (int i = 0;i + * This class provides static methods and constants only; it is not intended to be + * instantiated or subclassed by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. +*/ +public final class JavaScriptConventions { + + private static final char DOT= '.'; + private static final Scanner SCANNER = new Scanner(false /*comment*/, true /*whitespace*/, false /*nls*/, ClassFileConstants.JDK1_3 /*sourceLevel*/, null/*taskTag*/, null/*taskPriorities*/, true /*taskCaseSensitive*/); + + private JavaScriptConventions() { + // Not instantiable + } + + /* + * Returns the current identifier extracted by the scanner (without unicode + * escapes) from the given id and for the given source and compliance levels. + * Returns null if the id was not valid + */ + private static synchronized char[] scannedIdentifier(String id, String sourceLevel, String complianceLevel) { + if (id == null) { + return null; + } + // Set scanner for given source and compliance levels + SCANNER.sourceLevel = sourceLevel == null ? ClassFileConstants.JDK1_3 : CompilerOptions.versionToJdkLevel(sourceLevel); + SCANNER.complianceLevel = complianceLevel == null ? ClassFileConstants.JDK1_3 : CompilerOptions.versionToJdkLevel(complianceLevel); + + try { + SCANNER.setSource(id.toCharArray()); + int token = SCANNER.scanIdentifier(); + if (token != TerminalTokens.TokenNameIdentifier) return null; + if (SCANNER.currentPosition == SCANNER.eofPosition) { // to handle case where we had an ArrayIndexOutOfBoundsException + try { + return SCANNER.getCurrentIdentifierSource(); + } catch (ArrayIndexOutOfBoundsException e) { + return null; + } + } else { + return null; + } + } + catch (InvalidInputException e) { + return null; + } + } + + /** + * Validate the given javaScript unit name. + *

+ * A javaScript unit name must obey the following rules: + *

    + *
  • it must not be null + *
  • it must be suffixed by a dot ('.') followed by one of the + * {@link JavaScriptCore#getJavaScriptLikeExtensions() JavaScript-like extensions} + *
  • its prefix must be a valid identifier + *
  • it must not contain any characters or substrings that are not valid + * on the file system on which workspace root is located. + *
+ *

+ * @param name the name of a javaScript unit + * @return a status object with code IStatus.OK if + * the given name is valid as a javaScript unit name, otherwise a status + * object indicating what is wrong with the name + * @deprecated Use {@link #validateCompilationUnitName(String id, String sourceLevel, String complianceLevel)} instead + */ + public static IStatus validateCompilationUnitName(String name) { + return validateCompilationUnitName(name,CompilerOptions.VERSION_1_3,CompilerOptions.VERSION_1_3); + } + + /** + * Validate the given javaScript unit name for the given source and compliance levels. + *

+ * A javaScript unit name must obey the following rules: + *

    + *
  • it must not be null + *
  • it must be suffixed by a dot ('.') followed by one of the + * {@link JavaScriptCore#getJavaScriptLikeExtensions() JavaScript-like extensions} + *
  • its prefix must be a valid identifier + *
  • it must not contain any characters or substrings that are not valid + * on the file system on which workspace root is located. + *
+ *

+ * @param name the name of a javaScript unit + * @param sourceLevel the source level + * @param complianceLevel the compliance level + * @return a status object with code IStatus.OK if + * the given name is valid as a javaScript unit name, otherwise a status + * object indicating what is wrong with the name + */ + public static IStatus validateCompilationUnitName(String name, String sourceLevel, String complianceLevel) { + if (name == null) { + return new Status(IStatus.ERROR, JavaScriptCore.PLUGIN_ID, -1, Messages.convention_unit_nullName, null); + } + if (!org.eclipse.wst.jsdt.internal.core.util.Util.isJavaLikeFileName(name)) { + return new Status(IStatus.ERROR, JavaScriptCore.PLUGIN_ID, -1, Messages.convention_unit_notJavaName, null); + } +// String identifier; + int index; + index = name.lastIndexOf('.'); + if (index == -1) { + return new Status(IStatus.ERROR, JavaScriptCore.PLUGIN_ID, -1, Messages.convention_unit_notJavaName, null); + } +// identifier = name.substring(0, index); + // JSR-175 metadata strongly recommends "package-info.js" as the + // file in which to store package annotations and + // the package-level spec (replaces package.html) +// if (!identifier.equals(PACKAGE_INFO)) { +// IStatus status = validateIdentifier(identifier, sourceLevel, complianceLevel); +// if (!status.isOK()) { +// return status; +// } +// } +// IStatus status = ResourcesPlugin.getWorkspace().validateName(name, IResource.FILE); +// if (!status.isOK()) { +// return status; +// } + return JavaModelStatus.VERIFIED_OK; + } + + /* + * Validate the given .class file name for the given source and compliance levels. + *

+ * A .class file name must obey the following rules: + *

    + *
  • it must not be null + *
  • it must include the ".class" suffix + *
  • its prefix must be a valid identifier + *
  • it must not contain any characters or substrings that are not valid + * on the file system on which workspace root is located. + *
+ *

+ * @param name the name of a .class file + * @param sourceLevel the source level + * @param complianceLevel the compliance level + * @return a status object with code IStatus.OK if + * the given name is valid as a .class file name, otherwise a status + * object indicating what is wrong with the name + */ + public static IStatus validateClassFileName(String name, String sourceLevel, String complianceLevel) { + if (name == null) { + return new Status(IStatus.ERROR, JavaScriptCore.PLUGIN_ID, -1, Messages.convention_classFile_nullName, null); } + if (!org.eclipse.wst.jsdt.internal.compiler.util.Util.isClassFileName(name)) { + return new Status(IStatus.ERROR, JavaScriptCore.PLUGIN_ID, -1, Messages.convention_classFile_notClassFileName, null); + } +// String identifier; + int index; + index = name.lastIndexOf('.'); + if (index == -1) { + return new Status(IStatus.ERROR, JavaScriptCore.PLUGIN_ID, -1, Messages.convention_classFile_notClassFileName, null); + } +// identifier = name.substring(0, index); + // JSR-175 metadata strongly recommends "package-info.js" as the + // file in which to store package annotations and + // the package-level spec (replaces package.html) +// if (!identifier.equals(PACKAGE_INFO)) { +// IStatus status = validateIdentifier(identifier, sourceLevel, complianceLevel); +// if (!status.isOK()) { +// return status; +// } +// } + IStatus status = ResourcesPlugin.getWorkspace().validateName(name, IResource.FILE); + if (!status.isOK()) { + return status; + } + return JavaModelStatus.VERIFIED_OK; + } + + /** + * Validate the given var or field name. + *

+ * Syntax of a field name corresponds to VariableDeclaratorId (JLS2 8.3). + * For example, "x". + * + * @param name the name of a field + * @return a status object with code IStatus.OK if + * the given name is valid as a field name, otherwise a status + * object indicating what is wrong with the name + * @deprecated Use {@link #validateFieldName(String id, String sourceLevel, String complianceLevel)} instead + */ + public static IStatus validateFieldName(String name) { + return validateIdentifier(name, CompilerOptions.VERSION_1_3,CompilerOptions.VERSION_1_3); + } + + /** + * Validate the given var or field name for the given source and compliance levels. + *

+ * Syntax of a field name corresponds to VariableDeclaratorId (JLS2 8.3). + * For example, "x". + * + * @param name the name of a field + * @param sourceLevel the source level + * @param complianceLevel the compliance level + * @return a status object with code IStatus.OK if + * the given name is valid as a field name, otherwise a status + * object indicating what is wrong with the name + */ + public static IStatus validateFieldName(String name, String sourceLevel, String complianceLevel) { + return validateIdentifier(name, sourceLevel, complianceLevel); + } + + /** + * Validate the given JavaScript identifier. + * The identifier must not have the same spelling as a JavaScript keyword, + * boolean literal ("true", "false"), or null literal ("null"). + * A valid identifier can act as a simple type name, method name or field name. + * + * @param id the JavaScript identifier + * @return a status object with code IStatus.OK if + * the given identifier is a valid JavaScript identifier, otherwise a status + * object indicating what is wrong with the identifier + * @deprecated Use {@link #validateIdentifier(String id, String sourceLevel, String complianceLevel)} instead + */ + public static IStatus validateIdentifier(String id) { + return validateIdentifier(id,CompilerOptions.VERSION_1_3,CompilerOptions.VERSION_1_3); + } + + /** + * Validate the given JavaScript identifier for the given source and compliance levels + * The identifier must not have the same spelling as a JavaScript keyword, + * boolean literal ("true", "false"), or null literal ("null"). + * A valid identifier can act as a simple type name, method name or field name. + * + * @param id the JavaScript identifier + * @param sourceLevel the source level + * @param complianceLevel the compliance level + * @return a status object with code IStatus.OK if + * the given identifier is a valid JavaScript identifier, otherwise a status + * object indicating what is wrong with the identifier + */ + public static IStatus validateIdentifier(String id, String sourceLevel, String complianceLevel) { + if (scannedIdentifier(id, sourceLevel, complianceLevel) != null) { + return JavaModelStatus.VERIFIED_OK; + } else { + return new Status(IStatus.ERROR, JavaScriptCore.PLUGIN_ID, -1, Messages.bind(Messages.convention_illegalIdentifier, id), null); + } + } + + /** + * Validate the given import declaration name for the given source and compliance levels. + *

+ * The name of an import corresponds to a fully qualified type name. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param name the import declaration + * @param sourceLevel the source level + * @param complianceLevel the compliance level + * @return a status object with code IStatus.OK if + * the given name is valid as an import declaration, otherwise a status + * object indicating what is wrong with the name + */ + public static IStatus validateImportDeclaration(String name, String sourceLevel, String complianceLevel) { + if (name == null || name.length() == 0) { + return new Status(IStatus.ERROR, JavaScriptCore.PLUGIN_ID, -1, Messages.convention_import_nullImport, null); + } + if (name.charAt(name.length() - 1) == '*') { + if (name.charAt(name.length() - 2) == '.') { + return validatePackageName(name.substring(0, name.length() - 2), sourceLevel, complianceLevel); + } else { + return new Status(IStatus.ERROR, JavaScriptCore.PLUGIN_ID, -1, Messages.convention_import_unqualifiedImport, null); + } + } + return validatePackageName(name, sourceLevel, complianceLevel); + } + + /** + * Validate the given JavaScript type name, either simple or qualified. + *

+ * + * @param name the name of a type + * @return a status object with code IStatus.OK if + * the given name is valid as a JavaScript type name, + * a status with code IStatus.WARNING + * indicating why the given name is discouraged, + * otherwise a status object indicating what is wrong with + * the name + * @deprecated Use {@link #validateJavaScriptTypeName(String id, String sourceLevel, String complianceLevel)} instead + */ + public static IStatus validateJavaScriptTypeName(String name) { + return validateJavaScriptTypeName(name, CompilerOptions.VERSION_1_3,CompilerOptions.VERSION_1_3); + } + + /** + * Validate the given JavaScript type name, either simple or qualified, for the given source and compliance levels. + *

+ * + * @param name the name of a type + * @param sourceLevel the source level + * @param complianceLevel the compliance level + * @return a status object with code IStatus.OK if + * the given name is valid as a JavaScript type name, + * a status with code IStatus.WARNING + * indicating why the given name is discouraged, + * otherwise a status object indicating what is wrong with + * the name + */ + public static IStatus validateJavaScriptTypeName(String name, String sourceLevel, String complianceLevel) { + if (name == null) { + return new Status(IStatus.ERROR, JavaScriptCore.PLUGIN_ID, -1, Messages.convention_type_nullName, null); + } + String trimmed = name.trim(); + if (!name.equals(trimmed)) { + return new Status(IStatus.ERROR, JavaScriptCore.PLUGIN_ID, -1, Messages.convention_type_nameWithBlanks, null); + } + int index = name.lastIndexOf('.'); + char[] scannedID; + if (index == -1) { + // simple name + scannedID = scannedIdentifier(name, sourceLevel, complianceLevel); + } else { + // qualified name + String pkg = name.substring(0, index).trim(); + IStatus status = validatePackageName(pkg, sourceLevel, complianceLevel); + if (!status.isOK()) { + return status; + } + String type = name.substring(index + 1).trim(); + scannedID = scannedIdentifier(type, sourceLevel, complianceLevel); + } + + if (scannedID != null) { + IStatus status = ResourcesPlugin.getWorkspace().validateName(new String(scannedID), IResource.FILE); + if (!status.isOK()) { + return status; + } + if (CharOperation.contains('$', scannedID)) { + return new Status(IStatus.WARNING, JavaScriptCore.PLUGIN_ID, -1, Messages.convention_type_dollarName, null); + } + if ((scannedID.length > 0 && ScannerHelper.isLowerCase(scannedID[0]))) { + return new Status(IStatus.WARNING, JavaScriptCore.PLUGIN_ID, -1, Messages.convention_type_lowercaseName, null); + } + return JavaModelStatus.VERIFIED_OK; + } else { + return new Status(IStatus.ERROR, JavaScriptCore.PLUGIN_ID, -1, Messages.bind(Messages.convention_type_invalidName, name), null); + } + } + + /** + * Validate the given function name. + *

+ * + * @param name the name of a method + * @return a status object with code IStatus.OK if + * the given name is valid as a method name, otherwise a status + * object indicating what is wrong with the name + * @deprecated Use {@link #validateFunctionName(String id, String sourceLevel, String complianceLevel)} instead + */ + public static IStatus validateFunctionName(String name) { + return validateFunctionName(name, CompilerOptions.VERSION_1_3,CompilerOptions.VERSION_1_3); + } + + + /** + * Validate the given function name for the given source and compliance levels. + *

+ * + * @param name the name of a method + * @param sourceLevel the source level + * @param complianceLevel the compliance level + * @return a status object with code IStatus.OK if + * the given name is valid as a method name, otherwise a status + * object indicating what is wrong with the name + */ + public static IStatus validateFunctionName(String name, String sourceLevel, String complianceLevel) { + return validateIdentifier(name, sourceLevel,complianceLevel); + } + + /** + * Validate the given package name. + *

+ * The syntax of a package name corresponds to PackageName as + * defined by PackageDeclaration. + *

+ * Note that the given name must be a non-empty package name (that is, attempting to + * validate the default package will return an error status.) + * Also it must not contain any characters or substrings that are not valid + * on the file system on which workspace root is located. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param name the name of a package + * @return a status object with code IStatus.OK if + * the given name is valid as a package name, otherwise a status + * object indicating what is wrong with the name + * @deprecated Use {@link #validatePackageName(String id, String sourceLevel, String complianceLevel)} instead + */ + public static IStatus validatePackageName(String name) { + return validatePackageName(name, CompilerOptions.VERSION_1_3,CompilerOptions.VERSION_1_3); + } + + /** + * Validate the given package name for the given source and compliance levels. + *

+ * The syntax of a package name corresponds to PackageName as + * defined by PackageDeclaration. + *

+ * Note that the given name must be a non-empty package name (that is, attempting to + * validate the default package will return an error status.) + * Also it must not contain any characters or substrings that are not valid + * on the file system on which workspace root is located. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param name the name of a package + * @param sourceLevel the source level + * @param complianceLevel the compliance level + * @return a status object with code IStatus.OK if + * the given name is valid as a package name, otherwise a status + * object indicating what is wrong with the name + */ + public static IStatus validatePackageName(String name, String sourceLevel, String complianceLevel) { + + if (name == null) { + return new Status(IStatus.ERROR, JavaScriptCore.PLUGIN_ID, -1, Messages.convention_package_nullName, null); + } + int length; + if ((length = name.length()) == 0) { + return new Status(IStatus.ERROR, JavaScriptCore.PLUGIN_ID, -1, Messages.convention_package_emptyName, null); + } + if (name.charAt(0) == DOT || name.charAt(length-1) == DOT) { + return new Status(IStatus.ERROR, JavaScriptCore.PLUGIN_ID, -1, Messages.convention_package_dotName, null); + } + if (CharOperation.isWhitespace(name.charAt(0)) || CharOperation.isWhitespace(name.charAt(name.length() - 1))) { + return new Status(IStatus.ERROR, JavaScriptCore.PLUGIN_ID, -1, Messages.convention_package_nameWithBlanks, null); + } + int dot = 0; + while (dot != -1 && dot < length-1) { + if ((dot = name.indexOf(DOT, dot+1)) != -1 && dot < length-1 && name.charAt(dot+1) == DOT) { + return new Status(IStatus.ERROR, JavaScriptCore.PLUGIN_ID, -1, Messages.convention_package_consecutiveDotsName, null); + } + } + IWorkspace workspace = ResourcesPlugin.getWorkspace(); + IStatus status = workspace.validateName(new String(name), IResource.FOLDER); + if (!status.isOK()) { + return status; + } + StringTokenizer st = new StringTokenizer(name, "."); //$NON-NLS-1$ + boolean firstToken = true; + IStatus warningStatus = null; + while (st.hasMoreTokens()) { + String typeName = st.nextToken(); + typeName = typeName.trim(); // grammar allows spaces + char[] scannedID = scannedIdentifier(typeName, sourceLevel, complianceLevel); + if (scannedID == null) { + return new Status(IStatus.WARNING, JavaScriptCore.PLUGIN_ID, -1, Messages.bind(Messages.convention_illegalIdentifier, typeName), null); + } + status = workspace.validateName(new String(name), IResource.FOLDER); + if (!status.isOK()) { + return status; + } + if (firstToken && scannedID.length > 0 && ScannerHelper.isUpperCase(scannedID[0])) { + if (warningStatus == null) { + warningStatus = new Status(IStatus.WARNING, JavaScriptCore.PLUGIN_ID, -1, Messages.convention_package_uppercaseName, null); + } + } + firstToken = false; + } + if (warningStatus != null) { + return warningStatus; + } + return JavaModelStatus.VERIFIED_OK; + } + + /** + * Validate a given includepath location for a project, using the following rules: + *
    + *
  • Includepath entries cannot collide with each other; that is, all entry paths must be unique. + *
  • A project entry cannot refer to itself directly (that is, a project cannot prerequisite itself). + *
  • Includepath entries cannot coincidate or be nested in each other, except for the following scenarii listed below: + *
  • A source/library folder can be nested in any source folder as long as the nested folder is excluded from the enclosing one.
  • + *
+ * + * + * Note that the includepath entries are not validated automatically. Only bound variables or containers are considered + * in the checking process (this allows to perform a consistency check on a includepath which has references to + * yet non existing projects, folders, ...). + *

+ * This validation is intended to anticipate includepath issues prior to assigning it to a project. In particular, it will automatically + * be performed during the includepath setting operation (if validation fails, the includepath setting will not complete). + *

+ * @param javaProject the given javaScript project + * @param rawClasspath the given includepath + * @return a status object with code IStatus.OK if + * the given includepath are compatible, otherwise a status + * object indicating what is wrong with the includepath + */ + public static IJavaScriptModelStatus validateClasspath(IJavaScriptProject javaProject, IIncludePathEntry[] rawClasspath) { + + return ClasspathEntry.validateClasspath(javaProject, rawClasspath); + } + + /** + * Returns a JavaScript model status describing the problem related to this includepath entry if any, + * a status object with code IStatus.OK if the entry is fine (that is, if the + * given includepath entry denotes a valid element to be referenced onto a includepath). + * + * @param project the given javaScript project + * @param entry the given includepath entry + * @param checkSourceAttachment a flag to determine if source attachement should be checked + * @return a javaScript model status describing the problem related to this includepath entry if any, a status object with code IStatus.OK if the entry is fine + */ + public static IJavaScriptModelStatus validateClasspathEntry(IJavaScriptProject project, IIncludePathEntry entry, boolean checkSourceAttachment){ + IJavaScriptModelStatus status = ClasspathEntry.validateClasspathEntry(project, entry, checkSourceAttachment, true/*recurse in container*/); + if (status.getCode() == IJavaScriptModelStatusConstants.INVALID_INCLUDEPATH && ((ClasspathEntry) entry).isOptional()) + return JavaModelStatus.VERIFIED_OK; + return status; + } + + /** + * Validate the given type variable name. + *

+ * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param name the name of a type variable + * @return a status object with code IStatus.OK if + * the given name is valid as a type variable name, otherwise a status + * object indicating what is wrong with the name + * @deprecated Use {@link #validateTypeVariableName(String id, String sourceLevel, String complianceLevel)} instead + */ + public static IStatus validateTypeVariableName(String name) { + return validateIdentifier(name, CompilerOptions.VERSION_1_3,CompilerOptions.VERSION_1_3); + } + + /** + * Validate the given type variable name for the given source and compliance levels. + *

+ *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param name the name of a type variable + * @param sourceLevel the source level + * @param complianceLevel the compliance level + * @return a status object with code IStatus.OK if + * the given name is valid as a type variable name, otherwise a status + * object indicating what is wrong with the name + */ + public static IStatus validateTypeVariableName(String name, String sourceLevel, String complianceLevel) { + return validateIdentifier(name, sourceLevel, complianceLevel); + } + + /* + * Validate that all compiler options of the given project match keys and values + * described in {@link JavaScriptCore#getDefaultOptions()} method. + * + * @param javaProject the given javaScript project + * @param inheritJavaCoreOptions inherit project options from JavaScriptCore or not. + * @return a status object with code IStatus.OK if all project + * compiler options are valid, otherwise a status object indicating what is wrong + * with the keys and their value. + */ + /* + public static IStatus validateCompilerOptions(IJavaScriptProject javaProject, boolean inheritJavaCoreOptions) { + return validateCompilerOptions(javaProject.getOptions(inheritJavaCoreOptions)); + } + */ + + /* + * Validate that all compiler options of the given project match keys and values + * described in {@link JavaScriptCore#getDefaultOptions()} method. + * + * @param compilerOptions Map of options + * @return a status object with code IStatus.OK if all + * compiler options are valid, otherwise a status object indicating what is wrong + * with the keys and their value. + */ + /* + public static IStatus validateCompilerOptions(Map compilerOptions) { + + // Get current options + String compliance = (String) compilerOptions.get(JavaScriptCore.COMPILER_COMPLIANCE); + String source = (String) compilerOptions.get(JavaScriptCore.COMPILER_SOURCE); + String target = (String) compilerOptions.get(JavaScriptCore.COMPILER_CODEGEN_TARGET_PLATFORM); + if (compliance == null && source == null && target == null) { + return JavaModelStatus.VERIFIED_OK; // default is OK + } + + // Initialize multi-status + List errors = new ArrayList(); + + // Set default for compliance if necessary (not set on project and not inherited...) + if (compliance == null) { + compliance = JavaScriptCore.getOption(JavaScriptCore.COMPILER_COMPLIANCE); + } + + // Verify compliance level value and set source and target default if necessary + long complianceLevel = 0; + long sourceLevel = 0; + long targetLevel = 0; + if (JavaScriptCore.VERSION_1_3.equals(compliance)) { + complianceLevel = ClassFileConstants.JDK1_3; + if (source == null) { + source = JavaScriptCore.VERSION_1_3; + sourceLevel = ClassFileConstants.JDK1_3; + } + if (target == null) { + target = JavaScriptCore.VERSION_1_1; + targetLevel = ClassFileConstants.JDK1_1; + } + } else if (JavaScriptCore.VERSION_1_4.equals(compliance)) { + complianceLevel = ClassFileConstants.JDK1_4; + if (source == null) { + source = JavaScriptCore.VERSION_1_3; + sourceLevel = ClassFileConstants.JDK1_3; + } + if (target == null) { + target = JavaScriptCore.VERSION_1_2; + targetLevel = ClassFileConstants.JDK1_2; + } + } else if (JavaScriptCore.VERSION_1_5.equals(compliance)) { + complianceLevel = ClassFileConstants.JDK1_5; + if (source == null) { + source = JavaScriptCore.VERSION_1_5; + sourceLevel = ClassFileConstants.JDK1_5; + } + if (target == null) { + target = JavaScriptCore.VERSION_1_5; + targetLevel = ClassFileConstants.JDK1_5; + } + } else { + // compliance is not valid + errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.invalidCompilerOption", compliance==null?"":compliance, JavaScriptCore.COMPILER_COMPLIANCE))); //$NON-NLS-1$ //$NON-NLS-2$ + } + + // Verify source value and set default for target if necessary + if (JavaScriptCore.VERSION_1_4.equals(source)) { + sourceLevel = ClassFileConstants.JDK1_4; + if (target == null) { + target = JavaScriptCore.VERSION_1_4; + targetLevel = ClassFileConstants.JDK1_4; + } + } else if (JavaScriptCore.VERSION_1_5.equals(source)) { + sourceLevel = ClassFileConstants.JDK1_5; + if (target == null) { + target = JavaScriptCore.VERSION_1_5; + targetLevel = ClassFileConstants.JDK1_5; + } + } else if (JavaScriptCore.VERSION_1_3.equals(source)) { + sourceLevel = ClassFileConstants.JDK1_3; + } else { + // source is not valid + errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.invalidCompilerOption", source==null?"":source, JavaScriptCore.COMPILER_SOURCE))); //$NON-NLS-1$ //$NON-NLS-2$ + } + + // Verify target value + if (targetLevel == 0) { + targetLevel = CompilerOptions.versionToJdkLevel(target); + if (targetLevel == 0) { + // target is not valid + errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.invalidCompilerOption", target==null?"":target, JavaScriptCore.COMPILER_CODEGEN_TARGET_PLATFORM))); //$NON-NLS-1$ //$NON-NLS-2$ + } + } + + // Check and set compliance/source/target compatibilities (only if they have valid values) + if (complianceLevel != 0 && sourceLevel != 0 && targetLevel != 0) { + // target must be 1.5 if source is 1.5 + if (sourceLevel >= ClassFileConstants.JDK1_5 && targetLevel < ClassFileConstants.JDK1_5) { + errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.incompatibleTargetForSource", target, JavaScriptCore.VERSION_1_5))); //$NON-NLS-1$ + } + else + // target must be 1.4 if source is 1.4 + if (sourceLevel >= ClassFileConstants.JDK1_4 && targetLevel < ClassFileConstants.JDK1_4) { + errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.incompatibleTargetForSource", target, JavaScriptCore.VERSION_1_4))); //$NON-NLS-1$ + } + // target cannot be greater than compliance level + if (complianceLevel < targetLevel){ + errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.incompatibleComplianceForTarget", compliance, JavaScriptCore.VERSION_1_4))); //$NON-NLS-1$ + } + // compliance must be 1.5 if source is 1.5 + if (source.equals(JavaScriptCore.VERSION_1_5) && complianceLevel < ClassFileConstants.JDK1_5) { + errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.incompatibleComplianceForSource", compliance, JavaScriptCore.VERSION_1_5))); //$NON-NLS-1$ + } else + // compliance must be 1.4 if source is 1.4 + if (source.equals(JavaScriptCore.VERSION_1_4) && complianceLevel < ClassFileConstants.JDK1_4) { + errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.incompatibleComplianceForSource", compliance, JavaScriptCore.VERSION_1_4))); //$NON-NLS-1$ + } + } + + // Return status + int size = errors.size(); + switch (size) { + case 0: + return JavaModelStatus.VERIFIED_OK; + case 1: + return (IStatus) errors.get(0); + default: + IJavaScriptModelStatus[] allStatus = new IJavaScriptModelStatus[size]; + errors.toArray(allStatus); + return JavaModelStatus.newMultiStatus(allStatus); + } + } + */ +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JavaScriptCore.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JavaScriptCore.java new file mode 100644 index 0000000..bd7147c --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JavaScriptCore.java @@ -0,0 +1,4115 @@ +/******************************************************************************* + * Copyright (c) 2000, 2010 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * IBM Corporation - added the following constants: + * COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE + * COMPILER_PB_STATIC_ACCESS_RECEIVER + * COMPILER_TASK_TAGS + * CORE_CIRCULAR_CLASSPATH + * CORE_INCOMPLETE_CLASSPATH + * IBM Corporation - added run(IWorkspaceRunnable, IProgressMonitor) + * IBM Corporation - added exclusion patterns to source includepath entries + * IBM Corporation - added specific output location to source includepath entries + * IBM Corporation - added the following constants: + * CORE_JAVA_BUILD_CLEAN_OUTPUT_FOLDER + * CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER + * CLEAN + * IBM Corporation - added getJsGlobalScopeContainerInitializer(String) + * IBM Corporation - added the following constants: + * CODEASSIST_ARGUMENT_PREFIXES + * CODEASSIST_ARGUMENT_SUFFIXES + * CODEASSIST_FIELD_PREFIXES + * CODEASSIST_FIELD_SUFFIXES + * CODEASSIST_LOCAL_PREFIXES + * CODEASSIST_LOCAL_SUFFIXES + * CODEASSIST_STATIC_FIELD_PREFIXES + * CODEASSIST_STATIC_FIELD_SUFFIXES + * COMPILER_PB_CHAR_ARRAY_IN_STRING_CONCATENATION + * IBM Corporation - added the following constants: + * COMPILER_PB_LOCAL_VARIABLE_HIDING + * COMPILER_PB_SPECIAL_PARAMETER_HIDING_FIELD + * COMPILER_PB_FIELD_HIDING + * COMPILER_PB_POSSIBLE_ACCIDENTAL_BOOLEAN_ASSIGNMENT + * CORE_INCOMPATIBLE_JDK_LEVEL + * VERSION_1_5 + * COMPILER_PB_EMPTY_STATEMENT + * IBM Corporation - added the following constants: + * COMPILER_PB_INDIRECT_STATIC_ACCESS + * COMPILER_PB_BOOLEAN_METHOD_THROWING_EXCEPTION + * COMPILER_PB_UNNECESSARY_CAST + * IBM Corporation - added the following constants: + * COMPILER_PB_INVALID_JAVADOC + * COMPILER_PB_INVALID_JAVADOC_TAGS + * COMPILER_PB_INVALID_JAVADOC_TAGS_VISIBILITY + * COMPILER_PB_MISSING_JAVADOC_TAGS + * COMPILER_PB_MISSING_JAVADOC_TAGS_VISIBILITY + * COMPILER_PB_MISSING_JAVADOC_TAGS_OVERRIDING + * COMPILER_PB_MISSING_JAVADOC_COMMENTS + * COMPILER_PB_MISSING_JAVADOC_COMMENTS_VISIBILITY + * COMPILER_PB_MISSING_JAVADOC_COMMENTS_OVERRIDING + * COMPILER_PB_DEPRECATION_WHEN_OVERRIDING_DEPRECATED_METHOD + * COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING + * IBM Corporation - added the following constants: + * TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC + * IBM Corporation - added the following constants: + * COMPILER_PB_FALLTHROUGH_CASE + * COMPILER_PB_PARAMETER_ASSIGNMENT + * COMPILER_PB_NULL_REFERENCE + * IBM Corporation - added the following constants: + * CODEASSIST_DEPRECATION_CHECK + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import java.io.File; +import java.net.URL; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Map; + +import org.eclipse.core.resources.IContainer; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IMarkerDelta; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IResourceChangeEvent; +import org.eclipse.core.resources.IResourceChangeListener; +import org.eclipse.core.resources.IWorkspace; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.IWorkspaceRunnable; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.Assert; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtension; +import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Plugin; +import org.eclipse.core.runtime.QualifiedName; +import org.eclipse.core.runtime.SubProgressMonitor; +import org.eclipse.core.runtime.jobs.ISchedulingRule; +import org.eclipse.wst.jsdt.core.compiler.CharOperation; +import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchConstants; +import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope; +import org.eclipse.wst.jsdt.core.search.SearchEngine; +import org.eclipse.wst.jsdt.core.search.SearchPattern; +import org.eclipse.wst.jsdt.core.search.TypeNameRequestor; +import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants; +import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions; +import org.eclipse.wst.jsdt.internal.compiler.util.SuffixConstants; +import org.eclipse.wst.jsdt.internal.core.BatchOperation; +import org.eclipse.wst.jsdt.internal.core.ClasspathAccessRule; +import org.eclipse.wst.jsdt.internal.core.ClasspathAttribute; +import org.eclipse.wst.jsdt.internal.core.ClasspathEntry; +import org.eclipse.wst.jsdt.internal.core.CreateTypeHierarchyOperation; +import org.eclipse.wst.jsdt.internal.core.DefaultWorkingCopyOwner; +import org.eclipse.wst.jsdt.internal.core.JavaModel; +import org.eclipse.wst.jsdt.internal.core.JavaModelManager; +import org.eclipse.wst.jsdt.internal.core.JavaProject; +import org.eclipse.wst.jsdt.internal.core.Region; +import org.eclipse.wst.jsdt.internal.core.SetContainerOperation; +import org.eclipse.wst.jsdt.internal.core.SetVariablesOperation; +import org.eclipse.wst.jsdt.internal.core.UserLibraryManager; +import org.eclipse.wst.jsdt.internal.core.builder.JavaBuilder; +import org.eclipse.wst.jsdt.internal.core.builder.State; +import org.eclipse.wst.jsdt.internal.core.util.MementoTokenizer; +import org.eclipse.wst.jsdt.internal.core.util.Messages; +import org.eclipse.wst.jsdt.internal.core.util.Util; +import org.osgi.framework.BundleContext; + +/** + * The plug-in runtime class for the JavaScript model plug-in containing the core + * (UI-free) support for JavaScript projects. + *

+ * Like all plug-in runtime classes (subclasses of Plugin), this + * class is automatically instantiated by the platform when the plug-in gets + * activated. Clients must not attempt to instantiate plug-in runtime classes + * directly. + *

+ *

+ * The single instance of this class can be accessed from any plug-in declaring + * the JavaScript model plug-in as a prerequisite via + * JavaScriptCore.getJavaCore(). The JavaScript model plug-in will be activated + * automatically if not already active. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public final class JavaScriptCore extends Plugin { + + public static final boolean IS_ECMASCRIPT4=false; + + private static final IResource[] NO_GENERATED_RESOURCES = new IResource[0]; + + + private static Plugin JAVA_CORE_PLUGIN = null; + /** + * The plug-in identifier of the JavaScript core support + * (value "org.eclipse.wst.jsdt.core"). + */ + public static final String PLUGIN_ID = "org.eclipse.wst.jsdt.core" ; //$NON-NLS-1$ + + /** + * The identifier for the JavaScript validator + * (value "org.eclipse.wst.jsdt.core.javascriptValidator"). + */ + public static final String BUILDER_ID = PLUGIN_ID + ".javascriptValidator" ; //$NON-NLS-1$ + + /** + * The identifier for the JavaScript model + * (value "org.eclipse.wst.jsdt.core.jsmodel"). + */ + public static final String MODEL_ID = PLUGIN_ID + ".jsmodel" ; //$NON-NLS-1$ + + /** + * The identifier for the JavaScript nature + * (value "org.eclipse.wst.jsdt.core.jsnature"). + * The presence of this nature on a project indicates that it is + * JavaScript-capable. + * + * @see org.eclipse.core.resources.IProject#hasNature(java.lang.String) + */ + public static final String NATURE_ID = PLUGIN_ID + ".jsNature" ; //$NON-NLS-1$ + + /** + * Name of the handle id attribute in a JavaScript marker. + */ + protected static final String ATT_HANDLE_ID = + "org.eclipse.wst.jsdt.internal.core.JavaModelManager.handleId" ; //$NON-NLS-1$ + + /** + * Name of the User Library Container id. + */ + public static final String USER_LIBRARY_CONTAINER_ID= "org.eclipse.wst.jsdt.USER_LIBRARY"; //$NON-NLS-1$ + + // *************** Possible IDs for configurable options. ******************** + + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_LOCAL_VARIABLE_ATTR = PLUGIN_ID + ".compiler.debug.localVariable"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_LINE_NUMBER_ATTR = PLUGIN_ID + ".compiler.debug.lineNumber"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_SOURCE_FILE_ATTR = PLUGIN_ID + ".compiler.debug.sourceFile"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_CODEGEN_UNUSED_LOCAL = PLUGIN_ID + ".compiler.codegen.unusedLocal"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_CODEGEN_TARGET_PLATFORM = PLUGIN_ID + ".compiler.codegen.targetPlatform"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_CODEGEN_INLINE_JSR_BYTECODE = PLUGIN_ID + ".compiler.codegen.inlineJsrBytecode"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_DOC_COMMENT_SUPPORT = PLUGIN_ID + ".compiler.doc.comment.support"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + * @deprecated - discontinued since turning off would violate language specs + */ + public static final String COMPILER_PB_UNREACHABLE_CODE = PLUGIN_ID + ".compiler.problem.unreachableCode"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + * @deprecated - discontinued since turning off would violate language specs + */ + public static final String COMPILER_PB_INVALID_IMPORT = PLUGIN_ID + ".compiler.problem.invalidImport"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_UNDEFINED_FIELD = PLUGIN_ID + ".compiler.problem.undefinedField"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME = PLUGIN_ID + ".compiler.problem.methodWithConstructorName"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_DEPRECATION = PLUGIN_ID + ".compiler.problem.deprecation"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE = PLUGIN_ID + ".compiler.problem.deprecationInDeprecatedCode"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_DEPRECATION_WHEN_OVERRIDING_DEPRECATED_METHOD = "org.eclipse.wst.jsdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_HIDDEN_CATCH_BLOCK = PLUGIN_ID + ".compiler.problem.hiddenCatchBlock"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_UNUSED_LOCAL = PLUGIN_ID + ".compiler.problem.unusedLocal"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_UNUSED_PARAMETER = PLUGIN_ID + ".compiler.problem.unusedParameter"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_UNUSED_PARAMETER_WHEN_IMPLEMENTING_ABSTRACT = PLUGIN_ID + ".compiler.problem.unusedParameterWhenImplementingAbstract"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_UNUSED_PARAMETER_WHEN_OVERRIDING_CONCRETE = PLUGIN_ID + ".compiler.problem.unusedParameterWhenOverridingConcrete"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE = PLUGIN_ID + ".compiler.problem.unusedParameterIncludeDocCommentReference"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_UNUSED_IMPORT = PLUGIN_ID + ".compiler.problem.unusedImport"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_NON_NLS_STRING_LITERAL = PLUGIN_ID + ".compiler.problem.nonExternalizedStringLiteral"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_ASSERT_IDENTIFIER = PLUGIN_ID + ".compiler.problem.assertIdentifier"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_STATIC_ACCESS_RECEIVER = PLUGIN_ID + ".compiler.problem.staticAccessReceiver"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_INDIRECT_STATIC_ACCESS = PLUGIN_ID + ".compiler.problem.indirectStaticAccess"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_NO_EFFECT_ASSIGNMENT = PLUGIN_ID + ".compiler.problem.noEffectAssignment"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_UNUSED_PRIVATE_MEMBER = PLUGIN_ID + ".compiler.problem.unusedPrivateMember"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_LOCAL_VARIABLE_HIDING = PLUGIN_ID + ".compiler.problem.localVariableHiding"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_SPECIAL_PARAMETER_HIDING_FIELD = PLUGIN_ID + ".compiler.problem.specialParameterHidingField"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_FIELD_HIDING = PLUGIN_ID + ".compiler.problem.fieldHiding"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_TYPE_PARAMETER_HIDING = PLUGIN_ID + ".compiler.problem.typeParameterHiding"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_POSSIBLE_ACCIDENTAL_BOOLEAN_ASSIGNMENT = PLUGIN_ID + ".compiler.problem.possibleAccidentalBooleanAssignment"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_FALLTHROUGH_CASE = PLUGIN_ID + ".compiler.problem.fallthroughCase"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_EMPTY_STATEMENT = PLUGIN_ID + ".compiler.problem.emptyStatement"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_BOOLEAN_METHOD_THROWING_EXCEPTION = PLUGIN_ID + ".compiler.problem.booleanMethodThrowingException"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_UNNECESSARY_TYPE_CHECK = PLUGIN_ID + ".compiler.problem.unnecessaryTypeCheck"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_UNNECESSARY_ELSE = PLUGIN_ID + ".compiler.problem.unnecessaryElse"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_UNDOCUMENTED_EMPTY_BLOCK = PLUGIN_ID + ".compiler.problem.undocumentedEmptyBlock"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_FINALLY_BLOCK_NOT_COMPLETING = PLUGIN_ID + ".compiler.problem.finallyBlockNotCompletingNormally"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION = PLUGIN_ID + ".compiler.problem.unusedDeclaredThrownException"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING = PLUGIN_ID + ".compiler.problem.unusedDeclaredThrownExceptionWhenOverriding"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_UNQUALIFIED_FIELD_ACCESS = PLUGIN_ID + ".compiler.problem.unqualifiedFieldAccess"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + * @deprecated - got renamed into {@link #COMPILER_PB_UNCHECKED_TYPE_OPERATION} + */ + public static final String COMPILER_PB_UNSAFE_TYPE_OPERATION = PLUGIN_ID + ".compiler.problem.uncheckedTypeOperation"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_UNCHECKED_TYPE_OPERATION = PLUGIN_ID + ".compiler.problem.uncheckedTypeOperation"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_RAW_TYPE_REFERENCE = PLUGIN_ID + ".compiler.problem.rawTypeReference"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_FINAL_PARAMETER_BOUND = PLUGIN_ID + ".compiler.problem.finalParameterBound"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_VARARGS_ARGUMENT_NEED_CAST = PLUGIN_ID + ".compiler.problem.varargsArgumentNeedCast"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_MISSING_OVERRIDE_ANNOTATION = PLUGIN_ID + ".compiler.problem.missingOverrideAnnotation"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_MISSING_DEPRECATED_ANNOTATION = PLUGIN_ID + ".compiler.problem.missingDeprecatedAnnotation"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_UNUSED_LABEL = PLUGIN_ID + ".compiler.problem.unusedLabel"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_INVALID_JAVADOC = PLUGIN_ID + ".compiler.problem.invalidJavadoc"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_INVALID_JAVADOC_TAGS = PLUGIN_ID + ".compiler.problem.invalidJavadocTags"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_INVALID_JAVADOC_TAGS__DEPRECATED_REF = PLUGIN_ID + ".compiler.problem.invalidJavadocTagsDeprecatedRef"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_INVALID_JAVADOC_TAGS__NOT_VISIBLE_REF = PLUGIN_ID + ".compiler.problem.invalidJavadocTagsNotVisibleRef"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_INVALID_JAVADOC_TAGS_VISIBILITY = PLUGIN_ID + ".compiler.problem.invalidJavadocTagsVisibility"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_MISSING_JAVADOC_TAGS = PLUGIN_ID + ".compiler.problem.missingJavadocTags"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_MISSING_JAVADOC_TAGS_VISIBILITY = PLUGIN_ID + ".compiler.problem.missingJavadocTagsVisibility"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_MISSING_JAVADOC_TAGS_OVERRIDING = PLUGIN_ID + ".compiler.problem.missingJavadocTagsOverriding"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_MISSING_JAVADOC_COMMENTS = PLUGIN_ID + ".compiler.problem.missingJavadocComments"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_MISSING_JAVADOC_COMMENTS_VISIBILITY = PLUGIN_ID + ".compiler.problem.missingJavadocCommentsVisibility"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_MISSING_JAVADOC_COMMENTS_OVERRIDING = PLUGIN_ID + ".compiler.problem.missingJavadocCommentsOverriding"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_MAX_PER_UNIT = PLUGIN_ID + ".compiler.maxProblemPerUnit"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_FATAL_OPTIONAL_ERROR = PLUGIN_ID + ".compiler.problem.fatalOptionalError"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_PARAMETER_ASSIGNMENT = PLUGIN_ID + ".compiler.problem.parameterAssignment"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_SEMANTIC_VALIDATION = "semanticValidation"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_SOURCE = PLUGIN_ID + ".compiler.source"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_COMPLIANCE = PLUGIN_ID + ".compiler.compliance"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_TASK_PRIORITIES = PLUGIN_ID + ".compiler.taskPriorities"; //$NON-NLS-1$ + /** + * Possible configurable option value for COMPILER_TASK_PRIORITIES. + * @see #getDefaultOptions() + */ + public static final String COMPILER_TASK_PRIORITY_HIGH = "HIGH"; //$NON-NLS-1$ + /** + * Possible configurable option value for COMPILER_TASK_PRIORITIES. + * @see #getDefaultOptions() + */ + public static final String COMPILER_TASK_PRIORITY_LOW = "LOW"; //$NON-NLS-1$ + /** + * Possible configurable option value for COMPILER_TASK_PRIORITIES. + * @see #getDefaultOptions() + */ + public static final String COMPILER_TASK_PRIORITY_NORMAL = "NORMAL"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_TASK_TAGS = PLUGIN_ID + ".compiler.taskTags"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_TASK_CASE_SENSITIVE = PLUGIN_ID + ".compiler.taskCaseSensitive"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_FORBIDDEN_REFERENCE = PLUGIN_ID + ".compiler.problem.forbiddenReference"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_DISCOURAGED_REFERENCE = PLUGIN_ID + ".compiler.problem.discouragedReference"; //$NON-NLS-1$ + + /* START -------------------------------- Bug 203292 Type/Method/Filed resolution error configuration --------------------- */ + public static final String UNRESOLVED_TYPE_REFERENCE = PLUGIN_ID + ".compiler.problem.unresolvedTypeReference"; //$NON-NLS-1$ + public static final String UNRESOLVED_FIELD_REFERENCE = PLUGIN_ID + ".compiler.problem.unresolvedFieldReference"; //$NON-NLS-1$ + public static final String UNRESOLVED_METHOD_REFERENCE = PLUGIN_ID + ".compiler.problem.unresolvedMethodReference"; //$NON-NLS-1$ + /* END -------------------------------- Bug 203292 Type/Method/Filed resolution error configuration --------------------- */ + + /* START -------------------------------- Bug 197884 Loosly defined var (for statement) and optional semi-colon --------------------- */ + public static final String LOOSE_VAR_DECL = PLUGIN_ID + ".compiler.problem.looseVarDecleration"; //$NON-NLS-1$ + public static final String OPTIONAL_SEMICOLON = PLUGIN_ID + ".compiler.problem.optionalSemicolon"; //$NON-NLS-1$ + /* END -------------------------------- Bug 197884 Loosly defined var (for statement) and optional semi-colon --------------------- */ + + + /** + + * + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_SUPPRESS_WARNINGS = PLUGIN_ID + ".compiler.problem.suppressWarnings"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_UNHANDLED_WARNING_TOKEN = PLUGIN_ID + ".compiler.problem.unhandledWarningToken"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_NULL_REFERENCE = PLUGIN_ID + ".compiler.problem.nullReference"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_POTENTIAL_NULL_REFERENCE = PLUGIN_ID + ".compiler.problem.potentialNullReference"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_DUPLICATE_LOCAL_VARIABLES = PLUGIN_ID + ".compiler.problem.duplicateLocalVariables"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_REDUNDANT_NULL_CHECK = PLUGIN_ID + ".compiler.problem.redundantNullCheck"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_UNINITIALIZED_LOCAL_VARIABLE = PLUGIN_ID + ".compiler.problem.uninitializedLocalVariable"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_UNINITIALIZED_GLOBAL_VARIABLE = PLUGIN_ID + ".compiler.problem.uninitializedGlobalVariable"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String COMPILER_PB_OVERRIDING_METHOD_WITHOUT_SUPER_INVOCATION = PLUGIN_ID + ".compiler.problem.overridingMethodWithoutSuperInvocation"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CORE_JAVA_BUILD_ORDER = PLUGIN_ID + ".computeJavaBuildOrder"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CORE_JAVA_BUILD_RESOURCE_COPY_FILTER = PLUGIN_ID + ".builder.resourceCopyExclusionFilter"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CORE_JAVA_BUILD_DUPLICATE_RESOURCE = PLUGIN_ID + ".builder.duplicateResourceTask"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CORE_JAVA_BUILD_CLEAN_OUTPUT_FOLDER = PLUGIN_ID + ".builder.cleanOutputFolder"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER = PLUGIN_ID + ".builder.recreateModifiedClassFileInOutputFolder"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CORE_INCOMPLETE_CLASSPATH = PLUGIN_ID + ".incompleteClasspath"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CORE_CIRCULAR_CLASSPATH = PLUGIN_ID + ".circularClasspath"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CORE_INCOMPATIBLE_JDK_LEVEL = PLUGIN_ID + ".incompatibleJDKLevel"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CORE_JAVA_BUILD_INVALID_CLASSPATH = PLUGIN_ID + ".builder.invalidClasspath"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CORE_ENCODING = PLUGIN_ID + ".encoding"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CORE_ENABLE_CLASSPATH_EXCLUSION_PATTERNS = PLUGIN_ID + ".classpath.exclusionPatterns"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CORE_ENABLE_CLASSPATH_MULTIPLE_OUTPUT_LOCATIONS = PLUGIN_ID + ".classpath.multipleOutputLocations"; //$NON-NLS-1$ + /** + * Default task tag + * @deprecated Use {@link #DEFAULT_TASK_TAGS} instead + */ + public static final String DEFAULT_TASK_TAG = "TODO"; //$NON-NLS-1$ + /** + * Default task priority + * @deprecated Use {@link #DEFAULT_TASK_PRIORITIES} instead + */ + public static final String DEFAULT_TASK_PRIORITY = "NORMAL"; //$NON-NLS-1$ + /** + * Default task tag + */ + public static final String DEFAULT_TASK_TAGS = "TODO,FIXME,XXX"; //$NON-NLS-1$ + /** + * Default task priority + */ + public static final String DEFAULT_TASK_PRIORITIES = "NORMAL,HIGH,NORMAL"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CODEASSIST_VISIBILITY_CHECK = PLUGIN_ID + ".codeComplete.visibilityCheck"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CODEASSIST_DEPRECATION_CHECK = PLUGIN_ID + ".codeComplete.deprecationCheck"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CODEASSIST_CAMEL_CASE_MATCH = PLUGIN_ID + ".codeComplete.camelCaseMatch"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CODEASSIST_IMPLICIT_QUALIFICATION = PLUGIN_ID + ".codeComplete.forceImplicitQualification"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CODEASSIST_FIELD_PREFIXES = PLUGIN_ID + ".codeComplete.fieldPrefixes"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CODEASSIST_STATIC_FIELD_PREFIXES = PLUGIN_ID + ".codeComplete.staticFieldPrefixes"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CODEASSIST_LOCAL_PREFIXES = PLUGIN_ID + ".codeComplete.localPrefixes"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CODEASSIST_ARGUMENT_PREFIXES = PLUGIN_ID + ".codeComplete.argumentPrefixes"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CODEASSIST_FIELD_SUFFIXES = PLUGIN_ID + ".codeComplete.fieldSuffixes"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CODEASSIST_STATIC_FIELD_SUFFIXES = PLUGIN_ID + ".codeComplete.staticFieldSuffixes"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CODEASSIST_LOCAL_SUFFIXES = PLUGIN_ID + ".codeComplete.localSuffixes"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CODEASSIST_ARGUMENT_SUFFIXES = PLUGIN_ID + ".codeComplete.argumentSuffixes"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CODEASSIST_FORBIDDEN_REFERENCE_CHECK= PLUGIN_ID + ".codeComplete.forbiddenReferenceCheck"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CODEASSIST_DISCOURAGED_REFERENCE_CHECK= PLUGIN_ID + ".codeComplete.discouragedReferenceCheck"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String CODEASSIST_SUGGEST_STATIC_IMPORTS= PLUGIN_ID + ".codeComplete.suggestStaticImports"; //$NON-NLS-1$ + /** + * Possible configurable option ID. + * @see #getDefaultOptions() + */ + public static final String TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC = PLUGIN_ID + ".timeoutForParameterNameFromAttachedJavadoc"; //$NON-NLS-1$ + + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String GENERATE = "generate"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String DO_NOT_GENERATE = "do not generate"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String PRESERVE = "preserve"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String OPTIMIZE_OUT = "optimize out"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String VERSION_1_1 = "1.1"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String VERSION_1_2 = "1.2"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String VERSION_1_3 = "1.3"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String VERSION_1_4 = "1.4"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String VERSION_1_5 = "1.5"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String VERSION_1_6 = "1.6"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String VERSION_1_7 = "1.7"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String ABORT = "abort"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String ERROR = "error"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String WARNING = "warning"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String IGNORE = "ignore"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String COMPUTE = "compute"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String INSERT = "insert"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String DO_NOT_INSERT = "do not insert"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String PRESERVE_ONE = "preserve one"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String CLEAR_ALL = "clear all"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String NORMAL = "normal"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String COMPACT = "compact"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String TAB = "tab"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String SPACE = "space"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String ENABLED = "enabled"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String DISABLED = "disabled"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String CLEAN = "clean"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String PUBLIC = "public"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String PROTECTED = "protected"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String DEFAULT = "default"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String PRIVATE = "private"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String NEVER = "never"; //$NON-NLS-1$ + + /** + * Value of the content-type for JavaScript source files. Use this value to retrieve the JavaScript content type + * from the content type manager, and to add new JavaScript-like extensions to this content type. + * + * @see org.eclipse.core.runtime.content.IContentTypeManager#getContentType(String) + * @see #getJavaScriptLikeExtensions() + */ + public static final String JAVA_SOURCE_CONTENT_TYPE = JavaScriptCore.PLUGIN_ID+".jsSource" ; //$NON-NLS-1$ + + + public static final String READ_ONLY_SOURCE_PROPERTY = "readOnlyResource" ; //$NON-NLS-1$ + + /** + * Creates the JavaScript core plug-in. + *

+ * The plug-in instance is created automatically by the + * Eclipse platform. Clients must not call. + *

+ * + */ + public JavaScriptCore() { + super(); + JAVA_CORE_PLUGIN = this; + } + + /** + * Adds the given listener for changes to JavaScript elements. + * Has no effect if an identical listener is already registered. + * + * This listener will only be notified during the POST_CHANGE resource change notification + * and any reconcile operation (POST_RECONCILE). + * For finer control of the notification, use addElementChangedListener(IElementChangedListener,int), + * which allows to specify a different eventMask. + * + * @param listener the listener + * @see ElementChangedEvent + */ + public static void addElementChangedListener(IElementChangedListener listener) { + addElementChangedListener(listener, ElementChangedEvent.POST_CHANGE | ElementChangedEvent.POST_RECONCILE); + } + + /** + * Adds the given listener for changes to JavaScript elements. + * Has no effect if an identical listener is already registered. + * After completion of this method, the given listener will be registered for exactly + * the specified events. If they were previously registered for other events, they + * will be deregistered. + *

+ * Once registered, a listener starts receiving notification of changes to + * javaScript elements in the model. The listener continues to receive + * notifications until it is replaced or removed. + *

+ *

+ * Listeners can listen for several types of event as defined in ElementChangeEvent. + * Clients are free to register for any number of event types however if they register + * for more than one, it is their responsibility to ensure they correctly handle the + * case where the same javaScript element change shows up in multiple notifications. + * Clients are guaranteed to receive only the events for which they are registered. + *

+ * + * @param listener the listener + * @param eventMask the bit-wise OR of all event types of interest to the listener + * @see IElementChangedListener + * @see ElementChangedEvent + * @see #removeElementChangedListener(IElementChangedListener) + */ + public static void addElementChangedListener(IElementChangedListener listener, int eventMask) { + JavaModelManager.getJavaModelManager().deltaState.addElementChangedListener(listener, eventMask); + } + + /** + * Configures the given marker attribute map for the given JavaScript element. + * Used for markers, which denote a JavaScript element rather than a resource. + * + * @param attributes the mutable marker attribute map (key type: String, + * value type: String) + * @param element the JavaScript element for which the marker needs to be configured + */ + public static void addJavaScriptElementMarkerAttributes( + Map attributes, + IJavaScriptElement element) { + if (element instanceof IMember) + element = ((IMember) element).getClassFile(); + if (attributes != null && element != null) + attributes.put(ATT_HANDLE_ID, element.getHandleIdentifier()); + } + + /** + * Adds the given listener for resource change events of the given types to the JavaScript core. + * The listener is guaranteed to be notified of the resource change event before + * the JavaScript core starts processing the resource change event itself. + *

+ * If an identical listener is already registered, the given event types are added to the event types + * of interest to the listener. + *

+ *

+ * Supported event types are: + *

    + *
  • {@link IResourceChangeEvent#PRE_BUILD}
  • + *
  • {@link IResourceChangeEvent#POST_BUILD}
  • + *
  • {@link IResourceChangeEvent#POST_CHANGE}
  • + *
  • {@link IResourceChangeEvent#PRE_DELETE}
  • + *
  • {@link IResourceChangeEvent#PRE_CLOSE}
  • + *
+ * This list may increase in the future. + *

+ * + * @param listener the listener + * @param eventMask the bit-wise OR of all event types of interest to the + * listener + * @see #removePreProcessingResourceChangedListener(IResourceChangeListener) + * @see IResourceChangeEvent + */ + public static void addPreProcessingResourceChangedListener(IResourceChangeListener listener, int eventMask) { + JavaModelManager.getJavaModelManager().deltaState.addPreResourceChangedListener(listener, eventMask); + } + + /** + * Configures the given marker for the given JavaScript element. + * Used for markers, which denote a JavaScript element rather than a resource. + * + * @param marker the marker to be configured + * @param element the JavaScript element for which the marker needs to be configured + * @exception CoreException if the IMarker.setAttribute on the marker fails + */ + public void configureJavaScriptElementMarker(IMarker marker, IJavaScriptElement element) + throws CoreException { + if (element instanceof IMember) + element = ((IMember) element).getClassFile(); + if (marker != null && element != null) + marker.setAttribute(ATT_HANDLE_ID, element.getHandleIdentifier()); + } + + /** + * Returns the JavaScript model element corresponding to the given handle identifier + * generated by IJavaScriptElement.getHandleIdentifier(), or + * null if unable to create the associated element. + * + * @param handleIdentifier the given handle identifier + * @return the JavaScript element corresponding to the handle identifier + */ + public static IJavaScriptElement create(String handleIdentifier) { + return create(handleIdentifier, DefaultWorkingCopyOwner.PRIMARY); + } + + /** + * Returns the JavaScript model element corresponding to the given handle identifier + * generated by IJavaScriptElement.getHandleIdentifier(), or + * null if unable to create the associated element. + * If the returned JavaScript element is an IJavaScriptUnit, its owner + * is the given owner if such a working copy exists, otherwise the javaScript unit + * is a primary javaScript unit. + * + * @param handleIdentifier the given handle identifier + * @param owner the owner of the returned javaScript unit, ignored if the returned + * element is not a javaScript unit + * @return the JavaScript element corresponding to the handle identifier + */ + public static IJavaScriptElement create(String handleIdentifier, WorkingCopyOwner owner) { + if (handleIdentifier == null) { + return null; + } + MementoTokenizer memento = new MementoTokenizer(handleIdentifier); + JavaModel model = JavaModelManager.getJavaModelManager().getJavaModel(); + return model.getHandleFromMemento(memento, owner); + } + + /** + * Returns the JavaScript element corresponding to the given file, or + * null if unable to associate the given file + * with a JavaScript element. + * + *

The file must be one of:

    + *
  • a file with one of the {@link JavaScriptCore#getJavaScriptLikeExtensions() + * JavaScript-like extensions} - the element returned is the corresponding IJavaScriptUnit
  • + *
  • a .class file - the element returned is the corresponding IClassFile
  • + *
  • a .jar file - the element returned is the corresponding IPackageFragmentRoot
  • + *
+ *

+ * Creating a JavaScript element has the side effect of creating and opening all of the + * element's parents if they are not yet open. + * + * @param file the given file + * @return the JavaScript element corresponding to the given file, or + * null if unable to associate the given file + * with a JavaScript element + */ + public static IJavaScriptElement create(IFile file) { + return JavaModelManager.create(file, null/*unknown javaScript project*/); + } + /** + * Returns the source folder (package fragment or package fragment root) corresponding to the given folder, or + * null if unable to associate the given folder with a JavaScript element. + *

+ * Note that a package fragment root is returned rather than a default package. + *

+ * Creating a JavaScript element has the side effect of creating and opening all of the + * element's parents if they are not yet open. + * + * @param folder the given folder + * @return the package fragment or package fragment root corresponding to the given folder, or + * null if unable to associate the given folder with a JavaScript element + */ + public static IJavaScriptElement create(IFolder folder) { + return JavaModelManager.create(folder, null/*unknown javaScript project*/); + } + /** + * Returns the JavaScript project corresponding to the given project. + *

+ * Creating a JavaScript Project has the side effect of creating and opening all of the + * project's parents if they are not yet open. + *

+ * Note that no check is done at this time on the existence or the javaScript nature of this project. + * + * @param project the given project + * @return the JavaScript project corresponding to the given project, null if the given project is null + */ + public static IJavaScriptProject create(IProject project) { + if (project == null) { + return null; + } + JavaModel javaModel = JavaModelManager.getJavaModelManager().getJavaModel(); + return javaModel.getJavaProject(project); + } + /** + * Returns the JavaScript element corresponding to the given resource, or + * null if unable to associate the given resource + * with a JavaScript element. + *

+ * The resource must be one of:

    + *
  • a project - the element returned is the corresponding IJavaScriptProject
  • + *
  • a file with one of the {@link JavaScriptCore#getJavaScriptLikeExtensions() + * JavaScript-like extensions} - the element returned is the corresponding IJavaScriptUnit
  • + *
  • a folder - the element returned is the corresponding IPackageFragmentRoot + * or IPackageFragment
  • + *
  • the workspace root resource - the element returned is the IJavaScriptModel
  • + *
+ *

+ * Creating a JavaScript element has the side effect of creating and opening all of the + * element's parents if they are not yet open. + * + * @param resource the given resource + * @return the JavaScript element corresponding to the given resource, or + * null if unable to associate the given resource + * with a JavaScript element + */ + public static IJavaScriptElement create(IResource resource) { + return JavaModelManager.create(resource, null/*unknown javaScript project*/); + } + /** + * Returns the JavaScript element corresponding to the given file, its project being the given + * project. Returns null if unable to associate the given resource + * with a JavaScript element. + *

+ * The resource must be one of:

    + *
  • a project - the element returned is the corresponding IJavaScriptProject
  • + *
  • a file with one of the {@link JavaScriptCore#getJavaScriptLikeExtensions() + * JavaScript-like extensions} - the element returned is the corresponding IJavaScriptUnit
  • + *
  • a folder - the element returned is the corresponding IPackageFragmentRoot + * or IPackageFragment
  • + *
  • the workspace root resource - the element returned is the IJavaScriptModel
  • + *
+ *

+ * Creating a JavaScript element has the side effect of creating and opening all of the + * element's parents if they are not yet open. + * + * @param resource the given resource + * @return the JavaScript element corresponding to the given file, or + * null if unable to associate the given file + * with a JavaScript element + */ + public static IJavaScriptElement create(IResource resource, IJavaScriptProject project) { + return JavaModelManager.create(resource, project); + } + /** + * Returns the JavaScript model. + * + * @param root the given root + * @return the JavaScript model, or null if the root is null + */ + public static IJavaScriptModel create(IWorkspaceRoot root) { + if (root == null) { + return null; + } + return JavaModelManager.getJavaModelManager().getJavaModel(); + } + /* + * Creates and returns a class file element for + * the given .class file. Returns null if unable + * to recognize the class file. + * + * @param file the given .class file + * @return a class file element for the given .class file, or null if unable + * to recognize the class file + */ + public static IClassFile createClassFileFrom(IFile file) { + return JavaModelManager.createClassFileFrom(file, null); + } + /** + * Creates and returns a javaScript unit element for + * the given source file (i.e. a file with one of the {@link JavaScriptCore#getJavaScriptLikeExtensions() + * JavaScript-like extensions}). Returns null if unable + * to recognize the javaScript unit. + * + * @param file the given source file + * @return a javaScript unit element for the given source file, or null if unable + * to recognize the javaScript unit + */ + public static IJavaScriptUnit createCompilationUnitFrom(IFile file) { + return JavaModelManager.createCompilationUnitFrom(file, null/*unknown javaScript project*/); + } + /* + * Creates and returns a handle for the given JAR file. + * The JavaScript model associated with the JAR's project may be + * created as a side effect. + * + * @param file the given JAR file + * @return a handle for the given JAR file, or null if unable to create a JAR package fragment root. + * (for example, if the JAR file represents a non-JavaScript resource) + */ + public static IPackageFragmentRoot createJarPackageFragmentRootFrom(IFile file) { + return JavaModelManager.createJarPackageFragmentRootFrom(file, null/*unknown javaScript project*/); + } + + /** + * Answers the project specific value for a given includepath container. + * In case this container path could not be resolved, then will answer null. + * Both the container path and the project context are supposed to be non-null. + *

+ * The containerPath is a formed by a first ID segment followed with extra segments, which can be + * used as additional hints for resolution. If no container was ever recorded for this container path + * onto this project (using setJsGlobalScopeContainer, then a + * JsGlobalScopeContainerInitializer will be activated if any was registered for this container + * ID onto the extension point "org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer". + *

+ * There is no assumption that the returned container must answer the exact same containerPath + * when requested IJsGlobalScopeContainer#getPath. + * Indeed, the containerPath is just an indication for resolving it to an actual container object. + *

+ * Includepath container values are persisted locally to the workspace, but + * are not preserved from a session to another. It is thus highly recommended to register a + * JsGlobalScopeContainerInitializer for each referenced container + * (through the extension point "org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer"). + *

+ * @param containerPath the name of the container, which needs to be resolved + * @param project a specific project in which the container is being resolved + * @return the corresponding includepath container or null if unable to find one. + * + * @exception JavaScriptModelException if an exception occurred while resolving the container, or if the resolved container + * contains illegal entries (contains CPE_CONTAINER entries or null entries). + * + * @see JsGlobalScopeContainerInitializer + * @see IJsGlobalScopeContainer + * @see #setJsGlobalScopeContainer(IPath, IJavaScriptProject[], IJsGlobalScopeContainer[], IProgressMonitor) + */ + public static IJsGlobalScopeContainer getJsGlobalScopeContainer(IPath containerPath, IJavaScriptProject project) throws JavaScriptModelException { + + JavaModelManager manager = JavaModelManager.getJavaModelManager(); + IJsGlobalScopeContainer container = manager.getJsGlobalScopeContainer(containerPath, project); + if (container == JavaModelManager.CONTAINER_INITIALIZATION_IN_PROGRESS) { + return manager.getPreviousSessionContainer(containerPath, project); + } + return container; + } + + /** + * Helper method finding the includepath container initializer registered for a given includepath container ID + * or null if none was found while iterating over the contributions to extension point to + * the extension point "org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer". + *

+ * A containerID is the first segment of any container path, used to identify the registered container initializer. + *

+ * @param containerID - a containerID identifying a registered initializer + * @return JsGlobalScopeContainerInitializer - the registered includepath container initializer or null if + * none was found. + */ + public static JsGlobalScopeContainerInitializer getJsGlobalScopeContainerInitializer(String containerID) { + HashMap containerInitializersCache = JavaModelManager.getJavaModelManager().containerInitializersCache; + JsGlobalScopeContainerInitializer initializer = (JsGlobalScopeContainerInitializer) containerInitializersCache.get(containerID); + if (initializer == null) { + initializer = computeJsGlobalScopeContainerInitializer(containerID); + if (initializer == null) + return null; + containerInitializersCache.put(containerID, initializer); + } + return initializer; + } + + private static JsGlobalScopeContainerInitializer computeJsGlobalScopeContainerInitializer(String containerID) { + Plugin jdtCorePlugin = JavaScriptCore.getPlugin(); + if (jdtCorePlugin == null) return null; + + IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint(JavaScriptCore.PLUGIN_ID, JavaModelManager.CPCONTAINER_INITIALIZER_EXTPOINT_ID); + if (extension != null) { + IExtension[] extensions = extension.getExtensions(); + for(int i = 0; i < extensions.length; i++){ + IConfigurationElement [] configElements = extensions[i].getConfigurationElements(); + for(int j = 0; j < configElements.length; j++){ + IConfigurationElement configurationElement = configElements[j]; + String initializerID = configurationElement.getAttribute("id"); //$NON-NLS-1$ + if (initializerID != null && initializerID.equals(containerID)){ + if (JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED) + verbose_found_container_initializer(containerID, configurationElement); + try { + Object execExt = configurationElement.createExecutableExtension("class"); //$NON-NLS-1$ + if (execExt instanceof JsGlobalScopeContainerInitializer){ + return (JsGlobalScopeContainerInitializer)execExt; + } + } catch(CoreException e) { + // executable extension could not be created: ignore this initializer + if (JavaModelManager.CP_RESOLVE_VERBOSE) { + verbose_failed_to_instanciate_container_initializer(containerID, configurationElement); + e.printStackTrace(); + } + } + } + } + } + } + return null; + } + + private static void verbose_failed_to_instanciate_container_initializer(String containerID, IConfigurationElement configurationElement) { + Util.verbose( + "CPContainer INIT - failed to instanciate initializer\n" + //$NON-NLS-1$ + " container ID: " + containerID + '\n' + //$NON-NLS-1$ + " class: " + configurationElement.getAttribute("class"), //$NON-NLS-1$ //$NON-NLS-2$ + System.err); + } + + private static void verbose_found_container_initializer(String containerID, IConfigurationElement configurationElement) { + Util.verbose( + "CPContainer INIT - found initializer\n" + //$NON-NLS-1$ + " container ID: " + containerID + '\n' + //$NON-NLS-1$ + " class: " + configurationElement.getAttribute("class")); //$NON-NLS-1$ //$NON-NLS-2$ + } + + + /** + * Returns the path held in the given includepath variable. + * Returns null if unable to bind. + *

+ * Includepath variable values are persisted locally to the workspace, and + * are preserved from session to session. + *

+ * Note that includepath variables can be contributed registered initializers for, + * using the extension point "org.eclipse.wst.jsdt.core.JsGlobalScopeVariableInitializer". + * If an initializer is registered for a variable, its persisted value will be ignored: + * its initializer will thus get the opportunity to rebind the variable differently on + * each session. + * + * @param variableName the name of the includepath variable + * @return the path, or null if none + * @see #setClasspathVariable(String, IPath) + */ + /** + * Returns the path held in the given includepath variable. + * Returns null if unable to bind. + *

+ * Includepath variable values are persisted locally to the workspace, and + * are preserved from session to session. + *

+ * Note that includepath variables can be contributed registered initializers for, + * using the extension point "org.eclipse.wst.jsdt.core.JsGlobalScopeVariableInitializer". + * If an initializer is registered for a variable, its persisted value will be ignored: + * its initializer will thus get the opportunity to rebind the variable differently on + * each session. + * + * @param variableName the name of the includepath variable + * @return the path, or null if none + * @see #setIncludepathVariable(String, IPath) + */ + public static IPath getIncludepathVariable(final String variableName) { + + JavaModelManager manager = JavaModelManager.getJavaModelManager(); + IPath variablePath = manager.variableGet(variableName); + if (variablePath == JavaModelManager.VARIABLE_INITIALIZATION_IN_PROGRESS){ + return manager.getPreviousSessionVariable(variableName); + } + + if (variablePath != null) { + if (variablePath == JavaModelManager.CP_ENTRY_IGNORE_PATH) + return null; + return variablePath; + } + + // even if persisted value exists, initializer is given priority, only if no initializer is found the persisted value is reused + final JsGlobalScopeVariableInitializer initializer = JavaScriptCore.getJsGlobalScopeVariableInitializer(variableName); + if (initializer != null){ + if (JavaModelManager.CP_RESOLVE_VERBOSE) + verbose_triggering_variable_initialization(variableName, initializer); + if (JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED) + verbose_triggering_variable_initialization_invocation_trace(); + manager.variablePut(variableName, JavaModelManager.VARIABLE_INITIALIZATION_IN_PROGRESS); // avoid initialization cycles + boolean ok = false; + try { + // let OperationCanceledException go through + // (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=59363) + initializer.initialize(variableName); + + variablePath = manager.variableGet(variableName); // initializer should have performed side-effect + if (variablePath == JavaModelManager.VARIABLE_INITIALIZATION_IN_PROGRESS) return null; // break cycle (initializer did not init or reentering call) + if (JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED) + verbose_variable_value_after_initialization(variableName, variablePath); + manager.variablesWithInitializer.add(variableName); + ok = true; + } catch (RuntimeException e) { + if (JavaModelManager.CP_RESOLVE_VERBOSE) + e.printStackTrace(); + throw e; + } catch (Error e) { + if (JavaModelManager.CP_RESOLVE_VERBOSE) + e.printStackTrace(); + throw e; + } finally { + if (!ok) JavaModelManager.getJavaModelManager().variablePut(variableName, null); // flush cache + } + } else { + if (JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED) + verbose_no_variable_initializer_found(variableName); + } + return variablePath; + } + + private static void verbose_no_variable_initializer_found(String variableName) { + Util.verbose( + "CPVariable INIT - no initializer found\n" + //$NON-NLS-1$ + " variable: " + variableName); //$NON-NLS-1$ + } + + private static void verbose_variable_value_after_initialization(String variableName, IPath variablePath) { + Util.verbose( + "CPVariable INIT - after initialization\n" + //$NON-NLS-1$ + " variable: " + variableName +'\n' + //$NON-NLS-1$ + " variable path: " + variablePath); //$NON-NLS-1$ + } + + private static void verbose_triggering_variable_initialization(String variableName, JsGlobalScopeVariableInitializer initializer) { + Util.verbose( + "CPVariable INIT - triggering initialization\n" + //$NON-NLS-1$ + " variable: " + variableName + '\n' + //$NON-NLS-1$ + " initializer: " + initializer); //$NON-NLS-1$ + } + + private static void verbose_triggering_variable_initialization_invocation_trace() { + Util.verbose( + "CPVariable INIT - triggering initialization\n" + //$NON-NLS-1$ + " invocation trace:"); //$NON-NLS-1$ + new Exception("").printStackTrace(System.out); //$NON-NLS-1$ + } + + + + /** + * Returns deprecation message of a given includepath variable. + * + * @param variableName + * @return A string if the includepath variable is deprecated, null otherwise. + */ + public static String getIncludepathVariableDeprecationMessage(String variableName) { + return (String) JavaModelManager.getJavaModelManager().deprecatedVariables.get(variableName); + } + + /** + * Helper method finding the includepath variable initializer registered for a given includepath variable name + * or null if none was found while iterating over the contributions to extension point to + * the extension point "org.eclipse.wst.jsdt.core.JsGlobalScopeVariableInitializer". + *

+ * @param variable the given variable + * @return JsGlobalScopeVariableInitializer - the registered includepath variable initializer or null if + * none was found. + */ + public static JsGlobalScopeVariableInitializer getJsGlobalScopeVariableInitializer(String variable){ + + Plugin jdtCorePlugin = JavaScriptCore.getPlugin(); + if (jdtCorePlugin == null) return null; + + IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint(JavaScriptCore.PLUGIN_ID, JavaModelManager.CPVARIABLE_INITIALIZER_EXTPOINT_ID); + if (extension != null) { + IExtension[] extensions = extension.getExtensions(); + for(int i = 0; i < extensions.length; i++){ + IConfigurationElement [] configElements = extensions[i].getConfigurationElements(); + for(int j = 0; j < configElements.length; j++){ + IConfigurationElement configElement = configElements[j]; + try { + String varAttribute = configElement.getAttribute("variable"); //$NON-NLS-1$ + if (variable.equals(varAttribute)) { + if (JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED) + verbose_found_variable_initializer(variable, configElement); + Object execExt = configElement.createExecutableExtension("class"); //$NON-NLS-1$ + if (execExt instanceof JsGlobalScopeVariableInitializer){ + JsGlobalScopeVariableInitializer initializer = (JsGlobalScopeVariableInitializer)execExt; + String deprecatedAttribute = configElement.getAttribute("deprecated"); //$NON-NLS-1$ + if (deprecatedAttribute != null) { + JavaModelManager.getJavaModelManager().deprecatedVariables.put(variable, deprecatedAttribute); + } + String readOnlyAttribute = configElement.getAttribute("readOnly"); //$NON-NLS-1$ + if (JavaModelManager.TRUE.equals(readOnlyAttribute)) { + JavaModelManager.getJavaModelManager().readOnlyVariables.add(variable); + } + return initializer; + } + } + } catch(CoreException e){ + // executable extension could not be created: ignore this initializer + if (JavaModelManager.CP_RESOLVE_VERBOSE) { + verbose_failed_to_instanciate_variable_initializer(variable, configElement); + e.printStackTrace(); + } + } + } + } + } + return null; + } + + private static void verbose_failed_to_instanciate_variable_initializer(String variable, IConfigurationElement configElement) { + Util.verbose( + "CPContainer INIT - failed to instanciate initializer\n" + //$NON-NLS-1$ + " variable: " + variable + '\n' + //$NON-NLS-1$ + " class: " + configElement.getAttribute("class"), //$NON-NLS-1$ //$NON-NLS-2$ + System.err); + } + + private static void verbose_found_variable_initializer(String variable, IConfigurationElement configElement) { + Util.verbose( + "CPVariable INIT - found initializer\n" + //$NON-NLS-1$ + " variable: " + variable + '\n' + //$NON-NLS-1$ + " class: " + configElement.getAttribute("class")); //$NON-NLS-1$ //$NON-NLS-2$ + } + + /** + * Returns the names of all known includepath variables. + *

+ * Includepath variable values are persisted locally to the workspace, and + * are preserved from session to session. + *

+ * + * @return the list of includepath variable names + * @see #setIncludepathVariable(String, IPath) + */ + public static String[] getIncludepathVariableNames() { + return JavaModelManager.getJavaModelManager().variableNames(); + } + + /** + * Returns a table of all known configurable options with their default values. + * These options allow to configure the behaviour of the underlying components. + * The client may safely use the result as a template that they can modify and + * then pass to setOptions. + * + * Helper constants have been defined on JavaScriptCore for each of the option ID and + * their possible constant values. + * + * Note: more options might be added in further releases. + *

+	 * RECOGNIZED OPTIONS:
+	 *
+	 * VALIDATOR / Setting Compliance Level
+	 *    Select the compliance level for the validator. In "1.3" mode, source and target settings
+	 *    should not go beyond "1.3" level.
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.compliance"
+	 *     - possible values:   { "1.3", "1.4", "1.5", "1.6", "1.7" }
+	 *     - default:           "1.4"
+	 *
+	 * VALIDATOR / Setting Source Compatibility Mode
+	 *    Specify whether which source level compatibility is used. From 1.4 on, 'assert' is a keyword
+	 *    reserved for assertion support. Also note, than when toggling to 1.4 mode, the target VM
+	 *   level should be set to "1.4" and the compliance mode should be "1.4".
+	 *   Source level 1.5 is necessary to enable generics, autoboxing, covariance, annotations, enumerations
+	 *   enhanced for loop, static imports and varargs. Once toggled, the target VM level should be set to "1.5"
+	 *   and the compliance mode should be "1.5".
+	 *   Source level 1.6 is necessary to enable the computation of stack map tables. Once toggled, the target
+	 *   VM level should be set to "1.6" and the compliance mode should be "1.6".
+	 *   Once the source level 1.7 is toggled, the target VM level should be set to "1.7" and the compliance mode
+	 *   should be "1.7".
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.source"
+	 *     - possible values:   { "1.3", "1.4", "1.5", "1.6", "1.7" }
+	 *     - default:           "1.3"
+	 *
+	 *
+	 * VALIDATOR / JSdoc Comment Support
+	 *    When this support is disabled, the validator will ignore all jsdoc problems options settings
+	 *    and will not report any jsdoc problem. It will also not find any reference in jsdoc comment and
+	 *    DOM AST JSdoc node will be only a flat text instead of having structured tag elements.
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.doc.comment.support"
+	 *     - possible values:   { "enabled", "disabled" }
+	 *     - default:           "enabled"
+	 *
+	 * VALIDATOR / Reporting Deprecation
+	 *    When enabled, the validator will signal use of deprecated API either as an
+	 *    error or a warning.
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.deprecation"
+	 *     - possible values:   { "error", "warning", "ignore" }
+	 *     - default:           "warning"
+	 *
+	 * VALIDATOR / Reporting Deprecation Inside Deprecated Code
+	 *    When enabled, the validator will signal use of deprecated API inside deprecated code.
+	 *    The severity of the problem is controlled with option "org.eclipse.wst.jsdt.core.compiler.problem.deprecation".
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.deprecationInDeprecatedCode"
+	 *     - possible values:   { "enabled", "disabled" }
+	 *     - default:           "disabled"
+	 *
+	 * VALIDATOR / Reporting Deprecation When Overriding Deprecated Method
+	 *    When enabled, the validator will signal the declaration of a method overriding a deprecated one.
+	 *    The severity of the problem is controlled with option "org.eclipse.wst.jsdt.core.compiler.problem.deprecation".
+	 *     - option id:        "org.eclipse.wst.jsdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod"
+	 *     - possible values:   { "enabled", "disabled" }
+	 *     - default:           "disabled"
+	 *
+	 * VALIDATOR / Reporting Unused Local
+	 *    When enabled, the validator will issue an error or a warning for unused local
+	 *    variables (that is, variables never read from)
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.unusedLocal"
+	 *     - possible values:   { "error", "warning", "ignore" }
+	 *     - default:           "ignore"
+	 *
+	 * VALIDATOR / Reporting Unused Parameter
+	 *    When enabled, the validator will issue an error or a warning for unused method
+	 *    parameters (that is, parameters never read from)
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.unusedParameter"
+	 *     - possible values:   { "error", "warning", "ignore" }
+	 *     - default:           "ignore"
+	 *
+	 * VALIDATOR / Reporting Unused Parameter if Implementing Abstract Method
+	 *    When enabled, the validator will signal unused parameters in abstract method implementations.
+	 *    The severity of the problem is controlled with option "org.eclipse.wst.jsdt.core.compiler.problem.unusedParameter".
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.unusedParameterWhenImplementingAbstract"
+	 *     - possible values:   { "enabled", "disabled" }
+	 *     - default:           "disabled"
+	 *
+	 * VALIDATOR / Reporting Unused Parameter if Overriding Concrete Method
+	 *    When enabled, the validator will signal unused parameters in methods overriding concrete ones.
+	 *    The severity of the problem is controlled with option "org.eclipse.wst.jsdt.core.compiler.problem.unusedParameter".
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.unusedParameterWhenOverridingConcrete"
+	 *     - possible values:   { "enabled", "disabled" }
+	 *     - default:           "disabled"
+	 *
+	 * VALIDATOR / Consider Reference in Doc Comment for Unused Parameter Check
+	 *    When enabled, the validator will consider doc comment references to parameters (i.e. @param clauses) for the unused
+	 *    parameter check. Thus, documented parameters will be considered as mandated as per doc contract.
+	 *    The severity of the unused parameter problem is controlled with option "org.eclipse.wst.jsdt.core.compiler.problem.unusedParameter".
+	 *    Note: this option has no effect until the doc comment support is enabled according to the
+	 *    option "org.eclipse.wst.jsdt.core.compiler.doc.comment.support".
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.unusedParameterIncludeDocReference"
+	 *     - possible values:   { "enabled", "disabled" }
+	 *     - default:           "enabled"
+	 *
+	 * VALIDATOR / Reporting Unused Import
+	 *    When enabled, the validator will issue an error or a warning for unused import
+	 *    reference
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.unusedImport"
+	 *     - possible values:   { "error", "warning", "ignore" }
+	 *     - default:           "warning"
+	 *
+	 * VALIDATOR / Reporting Unused Private Members
+	 *    When enabled, the validator will issue an error or a warning whenever a private
+	 *    method or field is declared but never used within the same unit.
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.unusedPrivateMember"
+	 *     - possible values:   { "error", "warning", "ignore" }
+	 *     - default:           "ignore"
+	 *
+	 * VALIDATOR / Reporting Assignment with no Effect
+	 *    When enabled, the validator will issue an error or a warning whenever an assignment
+	 *    has no effect (e.g 'x = x').
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.noEffectAssignment"
+	 *     - possible values:   { "error", "warning", "ignore" }
+	 *     - default:           "warning"
+	 *
+	 * VALIDATOR / Reporting Empty Statements and Unnecessary Semicolons
+	 *    When enabled, the validator will issue an error or a warning if an empty statement or a
+	 *    unnecessary semicolon is encountered.
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.emptyStatement"
+	 *     - possible values:   { "error", "warning", "ignore" }
+	 *     - default:           "ignore"
+	 *
+	 * VALIDATOR / Reporting Unnecessary Type Check
+	 *    When enabled, the validator will issue an error or a warning when a cast or an instanceof operation
+	 *    is unnecessary.
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.unnecessaryTypeCheck"
+	 *     - possible values:   { "error", "warning", "ignore" }
+	 *     - default:           "ignore"
+	 *
+	 * VALIDATOR / Reporting Unnecessary Else
+	 *    When enabled, the validator will issue an error or a warning when a statement is unnecessarily
+	 *    nested within an else clause (in situation where then clause is not completing normally).
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.unnecessaryElse"
+	 *     - possible values:   { "error", "warning", "ignore" }
+	 *     - default:           "ignore"
+	 *
+	 * VALIDATOR / Reporting Non-Externalized String Literal
+	 *    When enabled, the validator will issue an error or a warning for non externalized
+	 *    String literal (that is, not tagged with //$NON-NLS-<n>$).
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.nonExternalizedStringLiteral"
+	 *     - possible values:   { "error", "warning", "ignore" }
+	 *     - default:           "ignore"
+	 *
+	 * VALIDATOR / Reporting Non-Static Reference to a Static Member
+	 *    When enabled, the validator will issue an error or a warning whenever a static field
+	 *    or method is accessed with an expression receiver. A reference to a static member should
+	 *    be qualified with a type name.
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.staticAccessReceiver"
+	 *     - possible values:   { "error", "warning", "ignore" }
+	 *     - default:           "warning"
+	 *
+	 * VALIDATOR / Reporting Indirect Reference to a Static Member
+	 *    When enabled, the validator will issue an error or a warning whenever a static field
+	 *    or method is accessed in an indirect way. A reference to a static member should
+	 *    preferably be qualified with its declaring type name.
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.indirectStaticAccess"
+	 *     - possible values:   { "error", "warning", "ignore" }
+	 *     - default:           "ignore"
+	 *
+	 * VALIDATOR / Reporting Local Variable Declaration Hiding another Variable
+	 *    When enabled, the validator will issue an error or a warning whenever a local variable
+	 *    declaration is hiding some field or local variable (either locally, inherited or defined in enclosing type).
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.localVariableHiding"
+	 *     - possible values:   { "error", "warning", "ignore" }
+	 *     - default:           "ignore"
+	 *
+	 * VALIDATOR / Reporting Field Declaration Hiding another Variable
+	 *    When enabled, the validator will issue an error or a warning whenever a field
+	 *    declaration is hiding some field or local variable (either locally, inherited or defined in enclosing type).
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.fieldHiding"
+	 *     - possible values:   { "error", "warning", "ignore" }
+	 *     - default:           "ignore"
+	 *
+	 * VALIDATOR / Reporting Type Declaration Hiding another Type
+	 *    When enabled, the validator will issue an error or a warning in situations where a type parameter
+	 *    declaration is hiding some type, when a nested type is hiding some type parameter, or when
+	 *    a nested type is hiding another nested type defined in same unit.
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.typeParameterHiding"
+	 *     - possible values:   { "error", "warning", "ignore" }
+	 *     - default:           "warning"
+	 *
+	 * VALIDATOR / Reporting Possible Accidental Boolean Assignment
+	 *    When enabled, the validator will issue an error or a warning if a boolean assignment is acting as the condition
+	 *    of a control statement  (where it probably was meant to be a boolean comparison).
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.possibleAccidentalBooleanAssignment"
+	 *     - possible values:   { "error", "warning", "ignore" }
+	 *     - default:           "ignore"
+	 *
+	 * VALIDATOR / Reporting Undocumented Empty Block
+	 *    When enabled, the validator will issue an error or a warning when an empty block is detected and it is not
+	 *    documented with any comment.
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.undocumentedEmptyBlock"
+	 *     - possible values:   { "error", "warning", "ignore" }
+	 *     - default:           "ignore"
+	 *
+	 * VALIDATOR / Reporting Finally Blocks Not Completing Normally
+	 *    When enabled, the validator will issue an error or a warning when a finally block does not complete normally.
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.finallyBlockNotCompletingNormally"
+	 *     - possible values:   { "error", "warning", "ignore" }
+	 *     - default:           "warning"
+	 *
+	 * VALIDATOR / Reporting Unused Declared Thrown Exception
+	 *    When enabled, the validator will issue an error or a warning when a method or a constructor is declaring a
+	 *    thrown checked exception, but never actually raises it in its body.
+	 *     - option id:         "org.eclipse.wst.jsdt.core.compiler.problem.unusedDeclaredThrownException"
+	 *     - possible values:   { "error", "warning", "ignore" }
+	 *     - default:           "ignore"
+	 *
+	 * VALIDATOR / Reporting Unused Declared Thrown Exception in Overridind Method
+	 *    When disabled, the validator will not include overriding methods in its diagnosis for unused declared
+	 *    thrown exceptions.
+	 *    
+ * The severity of the problem is controlled with option "org.eclipse.wst.jsdt.core.compiler.problem.unusedDeclaredThrownException". + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding" + * - possible values: { "enabled", "disabled" } + * - default: "disabled" + * + * VALIDATOR / Reporting Unqualified Access to Field + * When enabled, the validator will issue an error or a warning when a field is access without any qualification. + * In order to improve code readability, it should be qualified, e.g. 'x' should rather be written 'this.x'. + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.unqualifiedFieldAccess" + * - possible values: { "error", "warning", "ignore" } + * - default: "ignore" + * + * VALIDATOR / Reporting Null Dereference + * When enabled, the validator will issue an error or a warning whenever a + * variable that is statically known to hold a null value is used to + * access a field or method. + * + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.nullReference" + * - possible values: { "error", "warning", "ignore" } + * - default: "ignore" + * + * VALIDATOR / Reporting Potential Null Dereference + * When enabled, the validator will issue an error or a warning whenever a + * variable that has formerly been tested against null but is not (no more) + * statically known to hold a non-null value is used to access a field or + * method. + * + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.potentialNullReference" + * - possible values: { "error", "warning", "ignore" } + * - default: "ignore" + * + * VALIDATOR / Reporting Duplicate Local Variables + * When enabled, the validator will issue an error or a warning whenever a + * two local variables with the same name have been declared. + * + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.duplicateLocalVariables" + * - possible values: { "error", "warning", "ignore" } + * - default: "ignore" + * + * VALIDATOR / Reporting Redundant Null Check + * When enabled, the validator will issue an error or a warning whenever a + * variable that is statically known to hold a null or a non-null value + * is tested against null. + * + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.redundantNullCheck" + * - possible values: { "error", "warning", "ignore" } + * - default: "ignore" + * + * VALIDATOR / Reporting Use of Annotation Type as Super Interface + * When enabled, the validator will issue an error or a warning whenever an annotation type is used + * as a super-interface. Though legal, this is discouraged. + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.annotationSuperInterface" + * - possible values: { "error", "warning", "ignore" } + * - default: "warning" + * + * VALIDATOR / Reporting Invalid Jsdoc Comment + * This is the generic control for the severity of JSdoc problems. + * When enabled, the validator will issue an error or a warning for a problem in JSdoc. + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.invalidJavadoc" + * - possible values: { "error", "warning", "ignore" } + * - default: "ignore" + * + * VALIDATOR / Visibility Level For Invalid JSdoc Tags + * Set the minimum visibility level for JSdoc tag problems. Below this level problems will be ignored. + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.invalidJavadocTagsVisibility" + * - possible values: { "public", "protected", "default", "private" } + * - default: "public" + * + * VALIDATOR / Reporting Invalid JSdoc Tags + * When enabled, the validator will signal unbound or unexpected reference tags in JSdoc. + * A 'throws' tag referencing an undeclared exception would be considered as unexpected. + *
Note that this diagnosis can be enabled based on the visibility of the construct associated with the JSDoc; + * also see the setting "org.eclipse.wst.jsdt.core.compiler.problem.invalidJavadocTagsVisibility". + *
+ * The severity of the problem is controlled with option "org.eclipse.wst.jsdt.core.compiler.problem.invalidJavadoc". + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.invalidJavadocTags" + * - possible values: { "disabled", "enabled" } + * - default: "disabled" + * + * VALIDATOR / Reporting Invalid JSdoc Tags with Deprecated References + * Specify whether the validator will report deprecated references used in JSdoc tags. + *
Note that this diagnosis can be enabled based on the visibility of the construct associated with the JSDoc; + * also see the setting "org.eclipse.wst.jsdt.core.compiler.problem.invalidJavadocTagsVisibility". + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef" + * - possible values: { "enabled", "disabled" } + * - default: "disabled" + * + * VALIDATOR / Reporting Invalid JSdoc Tags with Not Visible References + * Specify whether the validator will report non-visible references used in JSDoc tags. + *
Note that this diagnosis can be enabled based on the visibility of the construct associated with the JSDoc; + * also see the setting "org.eclipse.wst.jsdt.core.compiler.problem.invalidJavadocTagsVisibility". + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef" + * - possible values: { "enabled", "disabled" } + * - default: "disabled" + * + * VALIDATOR / Reporting Missing JSDoc Tags + * This is the generic control for the severity of JSDoc missing tag problems. + * When enabled, the validator will issue an error or a warning when tags are missing in JSDoc comments. + *
Note that this diagnosis can be enabled based on the visibility of the construct associated with the JSDoc; + * also see the setting "org.eclipse.wst.jsdt.core.compiler.problem.missingJavadocTagsVisibility". + *
+ * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.missingJavadocTags" + * - possible values: { "error", "warning", "ignore" } + * - default: "ignore" + * + * VALIDATOR / Visibility Level For Missing JSDoc Tags + * Set the minimum visibility level for JSDoc missing tag problems. Below this level problems will be ignored. + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.missingJavadocTagsVisibility" + * - possible values: { "public", "protected", "default", "private" } + * - default: "public" + * + * VALIDATOR / Reporting Missing JSDoc Tags on Overriding Methods + * Specify whether the validator will verify overriding methods in order to report JSDoc missing tag problems. + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.missingJavadocTagsOverriding" + * - possible values: { "enabled", "disabled" } + * - default: "disabled" + * + * VALIDATOR / Reporting Missing JSDoc Comments + * This is the generic control for the severity of missing JSDoc comment problems. + * When enabled, the validator will issue an error or a warning when JSDoc comments are missing. + *
Note that this diagnosis can be enabled based on the visibility of the construct associated with the expected JSDoc; + * also see the setting "org.eclipse.wst.jsdt.core.compiler.problem.missingJavadocCommentsVisibility". + *
+ * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.missingJavadocComments" + * - possible values: { "error", "warning", "ignore" } + * - default: "ignore" + * + * VALIDATOR / Visibility Level For Missing JSDoc Comments + * Set the minimum visibility level for missing JSDoc problems. Below this level problems will be ignored. + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.missingJavadocCommentsVisibility" + * - possible values: { "public", "protected", "default", "private" } + * - default: "public" + * + * VALIDATOR / Reporting Missing JSDoc Comments on Overriding Methods + * Specify whether the validator will verify overriding methods in order to report missing JSDoc comment problems. + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.missingJavadocCommentsOverriding" + * - possible values: { "enabled", "disabled" } + * - default: "disabled" + * + * VALIDATOR / Maximum Number of Problems Reported per JavaScript Unit + * Specify the maximum number of problems reported on each javaScript unit. + * - option id: "org.eclipse.wst.jsdt.core.compiler.maxProblemPerUnit" + * - possible values: "<n>" where <n> is zero or a positive integer (if zero then all problems are reported). + * - default: "100" + * + * VALIDATOR / Treating Optional Error as Fatal + * When enabled, optional errors (i.e. optional problems which severity is set to "error") will be treated as standard + * validator errors, yielding problem methods/types preventing from running offending code until the issue got resolved. + * When disabled, optional errors are only considered as warnings, still carrying an error indication to make them more + * severe. Note that by default, errors are fatal, whether they are optional or not. + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.fatalOptionalError" + * - possible values: { "enabled", "disabled" } + * - default: "enabled" + * + * VALIDATOR / Defining the Automatic Task Tags + * When the tag list is not empty, the validator will issue a task marker whenever it encounters + * one of the corresponding tags inside any comment in JavaScript source code. + * Generated task messages will start with the tag, and range until the next line separator, + * comment ending, or tag. + * When a given line of code bears multiple tags, each tag will be reported separately. + * Moreover, a tag immediately followed by another tag will be reported using the contents of the + * next non-empty tag of the line, if any. + * Note that tasks messages are trimmed. If a tag is starting with a letter or digit, then it cannot be leaded by + * another letter or digit to be recognized ("fooToDo" will not be recognized as a task for tag "ToDo", but "foo#ToDo" + * will be detected for either tag "ToDo" or "#ToDo"). Respectively, a tag ending with a letter or digit cannot be followed + * by a letter or digit to be recognized ("ToDofoo" will not be recognized as a task for tag "ToDo", but "ToDo:foo" will + * be detected either for tag "ToDo" or "ToDo:"). + * - option id: "org.eclipse.wst.jsdt.core.compiler.taskTags" + * - possible values: { "<tag>[,<tag>]*" } where <tag> is a String without any wild-card or leading/trailing spaces + * - default: "TODO,FIXME,XXX" + * + * VALIDATOR / Defining the Automatic Task Priorities + * In parallel with the Automatic Task Tags, this list defines the priorities (high, normal or low) + * of the task markers issued by the validator. + * If the default is specified, the priority of each task marker is "NORMAL". + * - option id: "org.eclipse.wst.jsdt.core.compiler.taskPriorities" + * - possible values: { "<priority>[,<priority>]*" } where <priority> is one of "HIGH", "NORMAL" or "LOW" + * - default: "NORMAL,HIGH,NORMAL" + * + * VALIDATOR / Determining whether task tags are case-sensitive + * When enabled, task tags are considered in a case-sensitive way. + * - option id: "org.eclipse.wst.jsdt.core.compiler.taskCaseSensitive" + * - possible values: { "enabled", "disabled" } + * - default: "enabled" + * + * VALIDATOR / Reporting Discouraged Reference to Type with Restricted Access + * When enabled, the validator will issue an error or a warning when referring to a type with discouraged access, as defined according + * to the access rule specifications. + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.discouragedReference" + * - possible values: { "error", "warning", "ignore" } + * - default: "warning" + * + * VALIDATOR / Reporting Unreferenced Label + * When enabled, the validator will issue an error or a warning when encountering a labeled statement which label + * is never explicitly referenced. A label is considered to be referenced if its name explicitly appears behind a break + * or continue statement; for instance the following label would be considered unreferenced; LABEL: { break; } + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.unusedLabel" + * - possible values: { "error", "warning", "ignore" } + * - default: "warning" + * + * VALIDATOR / Reporting Parameter Assignment + * When enabled, the validator will issue an error or a warning if a parameter is + * assigned to. + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.parameterAssignment" + * - possible values: { "error", "warning", "ignore" } + * - default: "ignore" + * + * VALIDATOR / Reporting Switch Fall-Through Case + * When enabled, the validator will issue an error or a warning if a case may be + * entered by falling through previous case. Empty cases are allowed. + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.fallthroughCase" + * - possible values: { "error", "warning", "ignore" } + * - default: "ignore" + * + * VALIDATOR / Reporting Overriding method that doesn't call the super method invocation + * When enabled, the validator will issue an error or a warning if a method is overriding a method without calling + * the super invocation. + * - option id: "org.eclipse.wst.jsdt.core.compiler.problem.overridingMethodWithoutSuperInvocation" + * - possible values: { "error", "warning", "ignore" } + * - default: "ignore" + * + * BUILDER / Specifying Filters for Resource Copying Control + * Allow to specify some filters to control the resource copy process. + * - option id: "org.eclipse.wst.jsdt.core.builder.resourceCopyExclusionFilter" + * - possible values: { "<name>[,<name>]* } where <name> is a file name pattern (* and ? wild-cards allowed) + * or the name of a folder which ends with '/' + * - default: "" + * + * BUILDER / Abort if Invalid Includepath + * Allow to toggle the builder to abort if the includepath is invalid + * - option id: "org.eclipse.wst.jsdt.core.builder.invalidClasspath" + * - possible values: { "abort", "ignore" } + * - default: "abort" + * + * BUILDER / Reporting Duplicate Resources + * Indicate the severity of the problem reported when more than one occurrence + * of a resource is to be copied into the output location. + * - option id: "org.eclipse.wst.jsdt.core.builder.duplicateResourceTask" + * - possible values: { "error", "warning" } + * - default: "warning" + * + * JAVACORE / Computing Project Build Order + * Indicate whether JavaScriptCore should enforce the project build order to be based on + * the includepath prerequisite chain. When requesting to compute, this takes over + * the platform default order (based on project references). + * - option id: "org.eclipse.wst.jsdt.core.computeJavaBuildOrder" + * - possible values: { "compute", "ignore" } + * - default: "ignore" + * + * JAVACORE / Default Source Encoding Format + * Get the default encoding format of source files. This value is + * immutable and preset to the result of ResourcesPlugin.getEncoding(). + * It is offered as a convenience shortcut only. + * - option id: "org.eclipse.wst.jsdt.core.encoding" + * - value: <immutable, platform default value> + * + * JAVACORE / Reporting Incomplete Includepath + * Indicate the severity of the problem reported when an entry on the includepath does not exist, + * is not legite or is not visible (for example, a referenced project is closed). + * - option id: "org.eclipse.wst.jsdt.core.incompleteClasspath" + * - possible values: { "error", "warning"} + * - default: "error" + * + * JAVACORE / Reporting Includepath Cycle + * Indicate the severity of the problem reported when a project is involved in a cycle. + * - option id: "org.eclipse.wst.jsdt.core.circularClasspath" + * - possible values: { "error", "warning" } + * - default: "error" + * JAVACORE / Enabling Usage of Includepath Exclusion Patterns + * When disabled, no entry on a project includepath can be associated with + * an exclusion pattern. + * - option id: "org.eclipse.wst.jsdt.core.includepath.exclusionPatterns" + * - possible values: { "enabled", "disabled" } + * - default: "enabled" + * + * JAVACORE / Enabling Usage of Includepath Multiple Output Locations + * When disabled, no entry on a project includepath can be associated with + * a specific output location, preventing thus usage of multiple output locations. + * - option id: "org.eclipse.wst.jsdt.core.includepath.multipleOutputLocations" + * - possible values: { "enabled", "disabled" } + * - default: "enabled" + * + * JAVACORE / Set the timeout value for retrieving the method's parameter names from jsdoc + * Timeout in milliseconds to retrieve the method's parameter names from jsdoc. + * If the value is 0, the parameter names are not fetched and the raw names are returned. + * - option id: "org.eclipse.wst.jsdt.core.timeoutForParameterNameFromAttachedJavadoc" + * - possible values: "<n>", where n is an integer greater than or equal to 0 + * - default: "50" + * + * DEPRECATED SEE DefaultCodeFormatterOptions: FORMATTER / Inserting New Line Before Opening Brace + * When Insert, a new line is inserted before an opening brace, otherwise nothing + * is inserted + * - option id: "org.eclipse.wst.jsdt.core.formatter.newline.openingBrace" + * - possible values: { "insert", "do not insert" } + * - default: "do not insert" + * + * DEPRECATED SEE DefaultCodeFormatterOptions: FORMATTER / Inserting New Line Inside Control Statement + * When Insert, a new line is inserted between } and following else, catch, finally + * - option id: "org.eclipse.wst.jsdt.core.formatter.newline.controlStatement" + * - possible values: { "insert", "do not insert" } + * - default: "do not insert" + * + * DEPRECATED SEE DefaultCodeFormatterOptions: Clearing Blank Lines + * When Clear all, all blank lines are removed. When Preserve one, only one is kept + * and all others removed. + * - option id: "org.eclipse.wst.jsdt.core.formatter.newline.clearAll" + * - possible values: { "clear all", "preserve one" } + * - default: "preserve one" + * + * DEPRECATED SEE DefaultCodeFormatterOptions: Inserting New Line Between Else/If + * When Insert, a blank line is inserted between an else and an if when they are + * contiguous. When choosing to not insert, else-if will be kept on the same + * line when possible. + * - option id: "org.eclipse.wst.jsdt.core.formatter.newline.elseIf" + * - possible values: { "insert", "do not insert" } + * - default: "do not insert" + * + * DEPRECATED SEE DefaultCodeFormatterOptions: Inserting New Line In Empty Block + * When insert, a line break is inserted between contiguous { and }, if } is not followed + * by a keyword. + * - option id: "org.eclipse.wst.jsdt.core.formatter.newline.emptyBlock" + * - possible values: { "insert", "do not insert" } + * - default: "insert" + * + * DEPRECATED SEE DefaultCodeFormatterOptions: Splitting Lines Exceeding Length + * Enable splitting of long lines (exceeding the configurable length). Length of 0 will + * disable line splitting + * - option id: "org.eclipse.wst.jsdt.core.formatter.lineSplit" + * - possible values: "<n>", where n is zero or a positive integer + * - default: "80" + * + * DEPRECATED SEE DefaultCodeFormatterOptions: Compacting Assignment + * Assignments can be formatted asymmetrically, for example 'int x= 2;', when Normal, a space + * is inserted before the assignment operator + * - option id: "org.eclipse.wst.jsdt.core.formatter.style.assignment" + * - possible values: { "compact", "normal" } + * - default: "normal" + * + * DEPRECATED SEE DefaultCodeFormatterOptions: Defining Indentation Character + * Either choose to indent with tab characters or spaces + * - option id: "org.eclipse.wst.jsdt.core.formatter.tabulation.char" + * - possible values: { "tab", "space" } + * - default: "tab" + * + * DEPRECATED SEE DefaultCodeFormatterOptions: Defining Space Indentation Length + * When using spaces, set the amount of space characters to use for each + * indentation mark. + * - option id: "org.eclipse.wst.jsdt.core.formatter.tabulation.size" + * - possible values: "<n>", where n is a positive integer + * - default: "4" + * + * DEPRECATED SEE DefaultCodeFormatterOptions: Inserting space in cast expression + * When Insert, a space is added between the type and the expression in a cast expression. + * - option id: "org.eclipse.wst.jsdt.core.formatter.space.castexpression" + * - possible values: { "insert", "do not insert" } + * - default: "insert" + * + * CODEASSIST / Activate Visibility Sensitive Completion + * When active, completion doesn't show that you can not see + * (for example, you can not see private methods of a super class). + * - option id: "org.eclipse.wst.jsdt.core.codeComplete.visibilityCheck" + * - possible values: { "enabled", "disabled" } + * - default: "disabled" + * + * CODEASSIST / Activate Deprecation Sensitive Completion + * When enabled, completion doesn't propose deprecated members and types. + * - option id: "org.eclipse.wst.jsdt.core.codeComplete.deprecationCheck" + * - possible values: { "enabled", "disabled" } + * - default: "disabled" + * + * CODEASSIST / Automatic Qualification of Implicit Members + * When active, completion automatically qualifies completion on implicit + * field references and message expressions. + * - option id: "org.eclipse.wst.jsdt.core.codeComplete.forceImplicitQualification" + * - possible values: { "enabled", "disabled" } + * - default: "disabled" + * + * CODEASSIST / Define the Prefixes for Field Name + * When the prefixes is non empty, completion for field name will begin with + * one of the proposed prefixes. + * - option id: "org.eclipse.wst.jsdt.core.codeComplete.fieldPrefixes" + * - possible values: { "<prefix>[,<prefix>]*" } where <prefix> is a String without any wild-card + * - default: "" + * + * CODEASSIST / Define the Prefixes for Static Field Name + * When the prefixes is non empty, completion for static field name will begin with + * one of the proposed prefixes. + * - option id: "org.eclipse.wst.jsdt.core.codeComplete.staticFieldPrefixes" + * - possible values: { "<prefix>[,<prefix>]*" } where <prefix> is a String without any wild-card + * - default: "" + * + * CODEASSIST / Define the Prefixes for Local Variable Name + * When the prefixes is non empty, completion for local variable name will begin with + * one of the proposed prefixes. + * - option id: "org.eclipse.wst.jsdt.core.codeComplete.localPrefixes" + * - possible values: { "<prefix>[,<prefix>]*" } where <prefix> is a String without any wild-card + * - default: "" + * + * CODEASSIST / Define the Prefixes for Argument Name + * When the prefixes is non empty, completion for argument name will begin with + * one of the proposed prefixes. + * - option id: "org.eclipse.wst.jsdt.core.codeComplete.argumentPrefixes" + * - possible values: { "<prefix>[,<prefix>]*" } where <prefix> is a String without any wild-card + * - default: "" + * + * CODEASSIST / Define the Suffixes for Field Name + * When the suffixes is non empty, completion for field name will end with + * one of the proposed suffixes. + * - option id: "org.eclipse.wst.jsdt.core.codeComplete.fieldSuffixes" + * - possible values: { "<suffix>[,<suffix>]*" } where <suffix> is a String without any wild-card + * - default: "" + * + * CODEASSIST / Define the Suffixes for Static Field Name + * When the suffixes is non empty, completion for static field name will end with + * one of the proposed suffixes. + * - option id: "org.eclipse.wst.jsdt.core.codeComplete.staticFieldSuffixes" + * - possible values: { "<suffix>[,<suffix>]*" } where <suffix> is a String without any wild-card + * - default: "" + * + * CODEASSIST / Define the Suffixes for Local Variable Name + * When the suffixes is non empty, completion for local variable name will end with + * one of the proposed suffixes. + * - option id: "org.eclipse.wst.jsdt.core.codeComplete.localSuffixes" + * - possible values: { "<suffix>[,<suffix>]*" } where <suffix> is a String without any wild-card + * - default: "" + * + * CODEASSIST / Define the Suffixes for Argument Name + * When the suffixes is non empty, completion for argument name will end with + * one of the proposed suffixes. + * - option id: "org.eclipse.wst.jsdt.core.codeComplete.argumentSuffixes" + * - possible values: { "<suffix>[,<suffix>]*" } where <suffix> is a String without any wild-card + * - default: "" + * + * CODEASSIST / Activate Forbidden Reference Sensitive Completion + * When enabled, completion doesn't propose elements which match a + * forbidden reference rule. + * - option id: "org.eclipse.wst.jsdt.core.codeComplete.forbiddenReferenceCheck" + * - possible values: { "enabled", "disabled" } + * - default: "enabled" + * + * CODEASSIST / Activate Discouraged Reference Sensitive Completion + * When enabled, completion doesn't propose elements which match a + * discouraged reference rule. + * - option id: "org.eclipse.wst.jsdt.core.codeComplete.discouragedReferenceCheck" + * - possible values: { "enabled", "disabled" } + * - default: "disabled" + * + * CODEASSIST / Activate Camel Case Sensitive Completion + * When enabled, completion shows proposals whose name match the CamelCase + * pattern. + * - option id: "org.eclipse.wst.jsdt.core.codeComplete.camelCaseMatch" + * - possible values: { "enabled", "disabled" } + * - default: "enabled" + * + * CODEASSIST / Activate Suggestion of Static Import + * When enabled, completion proposals can contain static import + * pattern. + * - option id: "org.eclipse.wst.jsdt.core.codeComplete.suggestStaticImports" + * - possible values: { "enabled", "disabled" } + * - default: "enabled" + *
+ */ + public static Hashtable getDefaultOptions(){ + return JavaModelManager.getJavaModelManager().getDefaultOptions(); + } + + /** + * Returns the workspace root default charset encoding. + * + * @return the name of the default charset encoding for workspace root. + * @see IContainer#getDefaultCharset() + * @see ResourcesPlugin#getEncoding() + */ + public static String getEncoding() { + // Verify that workspace is not shutting down (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=60687) + IWorkspace workspace = ResourcesPlugin.getWorkspace(); + if (workspace != null) { + try { + return workspace.getRoot().getDefaultCharset(); + } catch (CoreException e) { + // fails silently and return plugin global encoding if core exception occurs + } + } + return ResourcesPlugin.getEncoding(); + } + + /** + * Returns an array that contains the resources generated by the JavaScript builder when building the + * javaScript units contained in the given region. + *

The contents of the array is accurate only if the elements of the given region have been built.

+ *

The given region can contain instances of:

+ *
    + *
  • org.eclipse.wst.jsdt.core.IJavaScriptUnit
  • + *
  • org.eclipse.wst.jsdt.core.IPackageFragment
  • + *
  • org.eclipse.wst.jsdt.core.IPackageFragmentRoot
  • + *
  • org.eclipse.wst.jsdt.core.IJavaScriptProject
  • + *
+ *

All other types of org.eclipse.wst.jsdt.core.IJavaScriptElement are ignored.

+ * + * @param region the given region + * @param includesNonJavaResources a flag that indicates if non-javaScript resources should be included + * + * @return an array that contains the resources generated by the JavaScript builder when building the + * javaScript units contained in the given region, an empty array if none + * @exception IllegalArgumentException if the given region is null + */ + public static IResource[] getGeneratedResources(IRegion region, boolean includesNonJavaResources) { + if (region == null) throw new IllegalArgumentException("region cannot be null"); //$NON-NLS-1$ + IJavaScriptElement[] elements = region.getElements(); + HashMap projectsStates = new HashMap(); + ArrayList collector = new ArrayList(); + for (int i = 0, max = elements.length; i < max; i++) { + // collect all the javaScript project + IJavaScriptElement element = elements[i]; + IJavaScriptProject javaProject = element.getJavaScriptProject(); + IProject project = javaProject.getProject(); + State state = null; + State currentState = (State) projectsStates.get(project); + if (currentState != null) { + state = currentState; + } else { + state = (State) JavaModelManager.getJavaModelManager().getLastBuiltState(project, null); + if (state != null) { + projectsStates.put(project, state); + } + } + if (state == null) continue; + if (element.getElementType() == IJavaScriptElement.JAVASCRIPT_PROJECT) { + IPackageFragmentRoot[] roots = null; + try { + roots = javaProject.getPackageFragmentRoots(); + } catch (JavaScriptModelException e) { + // ignore + } + if (roots == null) continue; + IRegion region2 = JavaScriptCore.newRegion(); + for (int j = 0; j < roots.length; j++) { + region2.add(roots[j]); + } + IResource[] res = getGeneratedResources(region2, includesNonJavaResources); + for (int j = 0, max2 = res.length; j < max2; j++) { + collector.add(res[j]); + } + continue; + } + + IJavaScriptElement root = element; + while (root != null && root.getElementType() != IJavaScriptElement.PACKAGE_FRAGMENT_ROOT) { + root = root.getParent(); + } + if (root == null) continue; + } + int size = collector.size(); + if (size != 0) { + IResource[] result = new IResource[size]; + collector.toArray(result); + return result; + } + return NO_GENERATED_RESOURCES; + } + + /** + * Returns the single instance of the JavaScript core plug-in runtime class. + * Equivalent to (JavaScriptCore) getPlugin(). + * + * @return the single instance of the JavaScript core plug-in runtime class + */ + public static JavaScriptCore getJavaScriptCore() { + return (JavaScriptCore) getPlugin(); + } + + /** + * Returns the list of known JavaScript-like extensions. + * JavaScript like extension are defined in the {@link org.eclipse.core.runtime.Platform#getContentTypeManager() + * content type manager} for the {@link #JAVA_SOURCE_CONTENT_TYPE}. + * Note that a JavaScript-like extension doesn't include the leading dot ('.'). + * Also note that the "js" extension is always defined as a JavaScript-like extension. + * + * @return the list of known JavaScript-like extensions. + */ + public static String[] getJavaScriptLikeExtensions() { + return CharOperation.toStrings(Util.getJavaLikeExtensions()); + } + + /** + * Helper method for returning one option value only. Equivalent to (String)JavaScriptCore.getOptions().get(optionName) + * Note that it may answer null if this option does not exist. + *

+ * For a complete description of the configurable options, see getDefaultOptions. + *

+ * + * @param optionName the name of an option + * @return the String value of a given option + * @see JavaScriptCore#getDefaultOptions() + * @see org.eclipse.wst.jsdt.internal.core.JavaCorePreferenceInitializer for changing default settings + */ + public static String getOption(String optionName) { + return JavaModelManager.getJavaModelManager().getOption(optionName); + } + + /** + * Returns the table of the current options. Initially, all options have their default values, + * and this method returns a table that includes all known options. + *

For a complete description of the configurable options, see getDefaultOptions.

+ *

Returns a default set of options even if the platform is not running.

+ * + * @return table of current settings of all options + * (key type: String; value type: String) + * @see #getDefaultOptions() + * @see org.eclipse.wst.jsdt.internal.core.JavaCorePreferenceInitializer for changing default settings + */ + public static Hashtable getOptions() { + return JavaModelManager.getJavaModelManager().getOptions(); + } + + /** + * Returns the single instance of the JavaScript core plug-in runtime class. + * + * @return the single instance of the JavaScript core plug-in runtime class + */ + public static Plugin getPlugin() { + return JAVA_CORE_PLUGIN; + } + + /** + * This is a helper method, which returns the resolved includepath entry denoted + * by a given entry (if it is a variable entry). It is obtained by resolving the variable + * reference in the first segment. Returns null if unable to resolve using + * the following algorithm: + *
    + *
  • if variable segment cannot be resolved, returns null
  • + *
  • finds a project, JAR or binary folder in the workspace at the resolved path location
  • + *
  • if none finds an external JAR file or folder outside the workspace at the resolved path location
  • + *
  • if none returns null
  • + *
+ *

+ * Variable source attachment path and root path are also resolved and recorded in the resulting includepath entry. + *

+ * NOTE: This helper method does not handle includepath containers, for which should rather be used + * JavaScriptCore#getJsGlobalScopeContainer(IPath, IJavaScriptProject). + *

+ * + * @param entry the given variable entry + * @return the resolved library or project includepath entry, or null + * if the given variable entry could not be resolved to a valid includepath entry + */ + public static IIncludePathEntry getResolvedIncludepathEntry(IIncludePathEntry entry) { + + if (entry.getEntryKind() != IIncludePathEntry.CPE_VARIABLE) + return entry; + + IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); + IPath resolvedPath = JavaScriptCore.getResolvedVariablePath(entry.getPath()); + if (resolvedPath == null) + return null; + + Object target = JavaModel.getTarget(workspaceRoot, resolvedPath, false); + if (target == null) + return null; + + // inside the workspace + if (target instanceof IResource) { + IResource resolvedResource = (IResource) target; + switch (resolvedResource.getType()) { + + case IResource.PROJECT : + // internal project + return JavaScriptCore.newProjectEntry( + resolvedPath, + entry.getAccessRules(), + entry.combineAccessRules(), + entry.getExtraAttributes(), + entry.isExported()); + case IResource.FILE : + if (org.eclipse.wst.jsdt.internal.compiler.util.Util.isArchiveFileName(resolvedResource.getName())) { + // internal binary archive + return JavaScriptCore.newLibraryEntry( + resolvedPath, + getResolvedVariablePath(entry.getSourceAttachmentPath()), + getResolvedVariablePath(entry.getSourceAttachmentRootPath()), + entry.getAccessRules(), + entry.getExtraAttributes(), + entry.isExported()); + } + break; + + case IResource.FOLDER : + // internal binary folder + return JavaScriptCore.newLibraryEntry( + resolvedPath, + getResolvedVariablePath(entry.getSourceAttachmentPath()), + getResolvedVariablePath(entry.getSourceAttachmentRootPath()), + entry.getAccessRules(), + entry.getExtraAttributes(), + entry.isExported()); + } + } + // outside the workspace + if (target instanceof File) { + File externalFile = JavaModel.getFile(target); + if (externalFile != null) { + String fileName = externalFile.getName().toLowerCase(); + if (fileName.endsWith(SuffixConstants.SUFFIX_STRING_java) + || fileName.endsWith(SuffixConstants.SUFFIX_STRING_zip) + ) { + // external binary archive + return JavaScriptCore.newLibraryEntry( + resolvedPath, + getResolvedVariablePath(entry.getSourceAttachmentPath()), + getResolvedVariablePath(entry.getSourceAttachmentRootPath()), + entry.getAccessRules(), + entry.getExtraAttributes(), + entry.isExported()); + } + } else { // external binary folder + if (resolvedPath.isAbsolute()){ + return JavaScriptCore.newLibraryEntry( + resolvedPath, + getResolvedVariablePath(entry.getSourceAttachmentPath()), + getResolvedVariablePath(entry.getSourceAttachmentRootPath()), + entry.getAccessRules(), + entry.getExtraAttributes(), + entry.isExported()); + } + } + } + return null; + } + + + /** + * Resolve a variable path (helper method). + * + * @param variablePath the given variable path + * @return the resolved variable path or null if none + */ + public static IPath getResolvedVariablePath(IPath variablePath) { + + if (variablePath == null) + return null; + int count = variablePath.segmentCount(); + if (count == 0) + return null; + + // lookup variable + String variableName = variablePath.segment(0); + IPath resolvedPath = JavaScriptCore.getIncludepathVariable(variableName); + if (resolvedPath == null) + return null; + + // append path suffix + if (count > 1) { + resolvedPath = resolvedPath.append(variablePath.removeFirstSegments(1)); + } + return resolvedPath; + } + + /** + * Returns the names of all defined user libraries. The corresponding includepath container path + * is the name appended to the USER_LIBRARY_CONTAINER_ID. + * @return Return an array containing the names of all known user defined. + */ + public static String[] getUserLibraryNames() { + return UserLibraryManager.getUserLibraryNames(); + } + + /** + * Returns the working copies that have the given owner. + * Only javaScript units in working copy mode are returned. + * If the owner is null, primary working copies are returned. + * + * @param owner the given working copy owner or null for primary working copy owner + * @return the list of working copies for a given owner + */ + public static IJavaScriptUnit[] getWorkingCopies(WorkingCopyOwner owner){ + + JavaModelManager manager = JavaModelManager.getJavaModelManager(); + if (owner == null) owner = DefaultWorkingCopyOwner.PRIMARY; + IJavaScriptUnit[] result = manager.getWorkingCopies(owner, false/*don't add primary WCs*/); + if (result == null) return JavaModelManager.NO_WORKING_COPY; + return result; + } + + /** + * Initializes JavaScriptCore internal structures to allow subsequent operations (such + * as the ones that need a resolved classpath) to run full speed. A client may + * choose to call this method in a background thread early after the workspace + * has started so that the initialization is transparent to the user. + *

+ * However calling this method is optional. Services will lazily perform + * initialization when invoked. This is only a way to reduce initialization + * overhead on user actions, if it can be performed before at some + * appropriate moment. + *

+ * This initialization runs accross all JavaScript projects in the workspace. Thus the + * workspace root scheduling rule is used during this operation. + *

+ * This method may return before the initialization is complete. The + * initialization will then continue in a background thread. + *

+ * This method can be called concurrently. + *

+ * + * @param monitor a progress monitor, or null if progress + * reporting and cancellation are not desired + * @exception CoreException if the initialization fails, + * the status of the exception indicates the reason of the failure + */ + public static void initializeAfterLoad(IProgressMonitor monitor) throws CoreException { + try { + if (monitor != null) monitor.beginTask(Messages.javamodel_initialization, 100); + + // initialize all containers and variables + JavaModelManager manager = JavaModelManager.getJavaModelManager(); + try { + if (monitor != null) { + monitor.subTask(Messages.javamodel_configuring_classpath_containers); + manager.batchContainerInitializationsProgress.set(new SubProgressMonitor(monitor, 50)); // 50% of the time is spent in initializing containers and variables + } + + // all classpaths in the workspace are going to be resolved, ensure that containers are initialized in one batch + manager.batchContainerInitializations = true; + + // avoid leaking source attachment properties (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=183413) + IJavaScriptProject[] projects = manager.getJavaModel().getJavaScriptProjects(); + for (int i = 0, length = projects.length; i < length; i++) { + IIncludePathEntry[] classpath; + try { + classpath = ((JavaProject) projects[i]).getResolvedClasspath(); + } catch (JavaScriptModelException e) { + // project no longer exist: ignore + continue; + } + if (classpath != null) { + for (int j = 0, length2 = classpath.length; j < length2; j++) { + IIncludePathEntry entry = classpath[j]; + if (entry.getSourceAttachmentPath() != null) + Util.setSourceAttachmentProperty(entry.getPath(), null); + // else source might have been attached by IPackageFragmentRoot#attachSource(...), we keep it + } + } + } + + // initialize delta state + manager.deltaState.rootsAreStale = true; // in case it was already initialized before we cleaned up the source attachment proprties + manager.deltaState.initializeRoots(); + } finally { + manager.batchContainerInitializationsProgress.set(null); + } + + // dummy query for waiting until the indexes are ready + SearchEngine engine = new SearchEngine(); + IJavaScriptSearchScope scope = SearchEngine.createWorkspaceScope(); + try { + if (monitor != null) + monitor.subTask(Messages.javamodel_configuring_searchengine); + engine.searchAllTypeNames( + null, + SearchPattern.R_EXACT_MATCH, + "!@$#!@".toCharArray(), //$NON-NLS-1$ + SearchPattern.R_PATTERN_MATCH | SearchPattern.R_CASE_SENSITIVE, + IJavaScriptSearchConstants.CLASS, + scope, + new TypeNameRequestor() { + public void acceptType( + int modifiers, + char[] packageName, + char[] simpleTypeName, + char[][] enclosingTypeNames, + String path) { + // no type to accept + } + }, + // will not activate index query caches if indexes are not ready, since it would take to long + // to wait until indexes are fully rebuild + IJavaScriptSearchConstants.CANCEL_IF_NOT_READY_TO_SEARCH, + monitor == null ? null : new SubProgressMonitor(monitor, 49) // 49% of the time is spent in the dummy search + ); + } catch (JavaScriptModelException e) { + // /search failed: ignore + } catch (OperationCanceledException e) { + if (monitor != null && monitor.isCanceled()) + throw e; + // else indexes were not ready: catch the exception so that jars are still refreshed + } + + // check if the build state version number has changed since last session + // (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=98969) + if (monitor != null) + monitor.subTask(Messages.javamodel_getting_build_state_number); + QualifiedName qName = new QualifiedName(JavaScriptCore.PLUGIN_ID, "stateVersionNumber"); //$NON-NLS-1$ + IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); + String versionNumber = null; + try { + versionNumber = root.getPersistentProperty(qName); + } catch (CoreException e) { + // could not read version number: consider it is new + } + final JavaModel model = manager.getJavaModel(); + String newVersionNumber = Byte.toString(State.VERSION); + if (!newVersionNumber.equals(versionNumber)) { + // build state version number has changed: touch every projects to force a rebuild + if (JavaBuilder.DEBUG) + System.out.println("Build state version number has changed"); //$NON-NLS-1$ + IWorkspaceRunnable runnable = new IWorkspaceRunnable() { + public void run(IProgressMonitor progressMonitor2) throws CoreException { + IJavaScriptProject[] projects = null; + try { + projects = model.getJavaScriptProjects(); + } catch (JavaScriptModelException e) { + // could not get JavaScript projects: ignore + } + if (projects != null) { + for (int i = 0, length = projects.length; i < length; i++) { + IJavaScriptProject project = projects[i]; + try { + if (JavaBuilder.DEBUG) + System.out.println("Touching " + project.getElementName()); //$NON-NLS-1$ + project.getProject().touch(progressMonitor2); + } catch (CoreException e) { + // could not touch this project: ignore + } + } + } + } + }; + if (monitor != null) + monitor.subTask(Messages.javamodel_building_after_upgrade); + try { + ResourcesPlugin.getWorkspace().run(runnable, monitor); + } catch (CoreException e) { + // could not touch all projects + } + try { + root.setPersistentProperty(qName, newVersionNumber); + } catch (CoreException e) { + Util.log(e, "Could not persist build state version number"); //$NON-NLS-1$ + } + } + + // ensure external jars are refreshed (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=93668) + try { + if (monitor != null) + monitor.subTask(Messages.javamodel_refreshing_external_jars); + model.refreshExternalArchives( + null/*refresh all projects*/, + monitor == null ? null : new SubProgressMonitor(monitor, 1) // 1% of the time is spent in jar refresh + ); + } catch (JavaScriptModelException e) { + // refreshing failed: ignore + } + + } finally { + if (monitor != null) monitor.done(); + } + } + /** + * Returns whether a given includepath variable is read-only or not. + * + * @param variableName + * @return true if the includepath variable is read-only, + * false otherwise. + */ + public static boolean isIncludepathVariableReadOnly(String variableName) { + return JavaModelManager.getJavaModelManager().readOnlyVariables.contains(variableName); + } + + /** + * Returns whether the given file name's extension is a JavaScript-like extension. + * + * @return whether the given file name's extension is a JavaScript-like extension + * @see #getJavaScriptLikeExtensions() + */ + public static boolean isJavaScriptLikeFileName(String fileName) { + if(fileName==null) return false; + return Util.isJavaLikeFileName(fileName); + } + + /** + * Returns whether the given marker references the given JavaScript element. + * Used for markers, which denote a JavaScript element rather than a resource. + * + * @param element the element + * @param marker the marker + * @return true if the marker references the element, false otherwise + * @exception CoreException if the IMarker.getAttribute on the marker fails + */ + public static boolean isReferencedBy(IJavaScriptElement element, IMarker marker) throws CoreException { + + // only match units or classfiles + if (element instanceof IMember){ + IMember member = (IMember) element; + if (member.isBinary()){ + element = member.getClassFile(); + } else { + element = member.getJavaScriptUnit(); + } + } + if (element == null) return false; + if (marker == null) return false; + + String markerHandleId = (String)marker.getAttribute(ATT_HANDLE_ID); + if (markerHandleId == null) return false; + + IJavaScriptElement markerElement = JavaScriptCore.create(markerHandleId); + while (true){ + if (element.equals(markerElement)) return true; // external elements may still be equal with different handleIDs. + + // cycle through enclosing types in case marker is associated with a classfile (15568) + if (markerElement instanceof IClassFile){ + IType enclosingType = ((IClassFile)markerElement).getType().getDeclaringType(); + if (enclosingType != null){ + markerElement = enclosingType.getClassFile(); // retry with immediate enclosing classfile + continue; + } + } + break; + } + return false; + } + + /** + * Returns whether the given marker delta references the given JavaScript element. + * Used for markers deltas, which denote a JavaScript element rather than a resource. + * + * @param element the element + * @param markerDelta the marker delta + * @return true if the marker delta references the element + * @exception CoreException if the IMarkerDelta.getAttribute on the marker delta fails + */ + public static boolean isReferencedBy(IJavaScriptElement element, IMarkerDelta markerDelta) throws CoreException { + + // only match units or classfiles + if (element instanceof IMember){ + IMember member = (IMember) element; + if (member.isBinary()){ + element = member.getClassFile(); + } else { + element = member.getJavaScriptUnit(); + } + } + if (element == null) return false; + if (markerDelta == null) return false; + + String markerDeltarHandleId = (String)markerDelta.getAttribute(ATT_HANDLE_ID); + if (markerDeltarHandleId == null) return false; + + IJavaScriptElement markerElement = JavaScriptCore.create(markerDeltarHandleId); + while (true){ + if (element.equals(markerElement)) return true; // external elements may still be equal with different handleIDs. + + // cycle through enclosing types in case marker is associated with a classfile (15568) + if (markerElement instanceof IClassFile){ + IType enclosingType = ((IClassFile)markerElement).getType().getDeclaringType(); + if (enclosingType != null){ + markerElement = enclosingType.getClassFile(); // retry with immediate enclosing classfile + continue; + } + } + break; + } + return false; + } + + /** + * Creates and returns a new access rule with the given file pattern and kind. + *

+ * The rule kind is one of {@link IAccessRule#K_ACCESSIBLE}, {@link IAccessRule#K_DISCOURAGED}, + * or {@link IAccessRule#K_NON_ACCESSIBLE}, optionally combined with {@link IAccessRule#IGNORE_IF_BETTER}, + * e..g. IAccessRule.K_NON_ACCESSIBLE | IAccessRule.IGNORE_IF_BETTER. + *

+ * + * @param filePattern the file pattern this access rule should match + * @param kind one of {@link IAccessRule#K_ACCESSIBLE}, {@link IAccessRule#K_DISCOURAGED}, + * or {@link IAccessRule#K_NON_ACCESSIBLE}, optionally combined with + * {@link IAccessRule#IGNORE_IF_BETTER} + * @return a new access rule + */ + public static IAccessRule newAccessRule(IPath filePattern, int kind) { + return new ClasspathAccessRule(filePattern, kind); + } + + /** + * Creates and returns a new includepath attribute with the given name and the given value. + * + * @return a new includepath attribute + */ + public static IIncludePathAttribute newIncludepathAttribute(String name, String value) { + return new ClasspathAttribute(name, value); + } + + /** + * Creates and returns a new includepath entry of kind CPE_CONTAINER + * for the given path. This method is fully equivalent to calling + * {@link #newContainerEntry(IPath, IAccessRule[], IIncludePathAttribute[], boolean) + * newContainerEntry(containerPath, new IAccessRule[0], new IIncludePathAttribute[0], false)}. + *

+ * @param containerPath the path identifying the container + * @return a new container includepath entry + * + * @see JavaScriptCore#getJsGlobalScopeContainer(IPath, IJavaScriptProject) + */ + public static IIncludePathEntry newContainerEntry(IPath containerPath) { + return newContainerEntry( + containerPath, + ClasspathEntry.NO_ACCESS_RULES, + ClasspathEntry.NO_EXTRA_ATTRIBUTES, + false/*not exported*/); + } + + /** + * Creates and returns a new includepath entry of kind CPE_CONTAINER + * for the given path. This method is fully equivalent to calling + * {@link #newContainerEntry(IPath, IAccessRule[], IIncludePathAttribute[], boolean) + * newContainerEntry(containerPath, new IAccessRule[0], new IIncludePathAttribute[0], isExported)}. + * + * @param containerPath the path identifying the container, it must be formed of at least + * one segment (ID+hints) + * @param isExported a boolean indicating whether this entry is contributed to dependent + * projects in addition to the output location + * @return a new container includepath entry + * + * @see JavaScriptCore#getJsGlobalScopeContainer(IPath, IJavaScriptProject) + * @see JavaScriptCore#setJsGlobalScopeContainer(IPath, IJavaScriptProject[], IJsGlobalScopeContainer[], IProgressMonitor) + */ + public static IIncludePathEntry newContainerEntry(IPath containerPath, boolean isExported) { + return newContainerEntry( + containerPath, + ClasspathEntry.NO_ACCESS_RULES, + ClasspathEntry.NO_EXTRA_ATTRIBUTES, + isExported); + } + + /** + * Creates and returns a new includepath entry of kind CPE_CONTAINER + * for the given path. The path of the container will be used during resolution so as to map this + * container entry to a set of other includepath entries the container is acting for. + *

+ * A container entry allows to express indirect references to a set of libraries, projects and variable entries, + * which can be interpreted differently for each JavaScript project where it is used. + * A includepath container entry can be resolved using JavaScriptCore.getResolvedJsGlobalScopeContainer, + * and updated with JavaScriptCore.JsGlobalScopeContainerChanged + *

+ * A container is exclusively resolved by a JsGlobalScopeContainerInitializer registered onto the + * extension point "org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer". + *

+ * A container path must be formed of at least one segment, where:

    + *
  • the first segment is a unique ID identifying the target container, there must be a container initializer registered + * onto this ID through the extension point "org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer".
  • + *
  • the remaining segments will be passed onto the initializer, and can be used as additional + * hints during the initialization phase.
  • + *
+ *

+ * Example of an JsGlobalScopeContainerInitializer for a includepath container denoting a default JDK container: + *

+	 * containerEntry = JavaScriptCore.newContainerEntry(new Path("MyProvidedJDK/default"));
+	 *
+	 * <extension
+	 *    point="org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer">
+	 *    <containerInitializer
+	 *       id="MyProvidedJDK"
+	 *       class="com.example.MyInitializer"/>
+	 * 
+ *

+ * The access rules determine the set of accessible source and class files + * in the container. If the list of access rules is empty, then all files + * in this container are accessible. + * See {@link IAccessRule} for a detailed description of access + * rules. Note that if an entry defined by the container defines access rules, + * then these access rules are combined with the given access rules. + * The given access rules are considered first, then the entry's access rules are + * considered. + *

+ *

+ * The extraAttributes list contains name/value pairs that must be persisted with + * this entry. If no extra attributes are provided, an empty array must be passed in.
+ * Note that this list should not contain any duplicate name. + *

+ *

+ * The isExported flag indicates whether this entry is contributed to dependent + * projects. If not exported, dependent projects will not see any of the classes from this entry. + * If exported, dependent projects will concatenate the accessible files patterns of this entry with the + * accessible files patterns of the projects, and they will concatenate the non accessible files patterns of this entry + * with the non accessible files patterns of the project. + *

+ *

+ * Note that this operation does not attempt to validate includepath containers + * or access the resources at the given paths. + *

+ * + * @param containerPath the path identifying the container, it must be formed of at least + * one segment (ID+hints) + * @param accessRules the possibly empty list of access rules for this entry + * @param extraAttributes the possibly empty list of extra attributes to persist with this entry + * @param isExported a boolean indicating whether this entry is contributed to dependent + * projects in addition to the output location + * @return a new container includepath entry + * + * @see JavaScriptCore#getJsGlobalScopeContainer(IPath, IJavaScriptProject) + * @see JavaScriptCore#setJsGlobalScopeContainer(IPath, IJavaScriptProject[], IJsGlobalScopeContainer[], IProgressMonitor) + * @see JavaScriptCore#newContainerEntry(IPath, boolean) + * @see JavaScriptCore#newAccessRule(IPath, int) + */ + public static IIncludePathEntry newContainerEntry( + IPath containerPath, + IAccessRule[] accessRules, + IIncludePathAttribute[] extraAttributes, + boolean isExported) { + + if (containerPath == null) { + Assert.isTrue(false, "Container path cannot be null"); //$NON-NLS-1$ + } else if (containerPath.segmentCount() < 1) { + Assert.isTrue( + false, + "Illegal classpath container path: \'" + containerPath.makeRelative().toString() + "\', must have at least one segment (containerID+hints)"); //$NON-NLS-1$//$NON-NLS-2$ + } + return new ClasspathEntry( + IPackageFragmentRoot.K_SOURCE, + IIncludePathEntry.CPE_CONTAINER, + containerPath, + ClasspathEntry.INCLUDE_ALL, // inclusion patterns + ClasspathEntry.EXCLUDE_NONE, // exclusion patterns + null, // source attachment + null, // source attachment root + null, // specific output folder + isExported, + accessRules, + true, // combine access rules + extraAttributes); + } + + /** + * Creates and returns a type hierarchy for all types in the given + * region, considering subtypes within that region and considering types in the + * working copies with the given owner. + * In other words, the owner's working copies will take + * precedence over their original javaScript units in the workspace. + *

+ * Note that if a working copy is empty, it will be as if the original compilation + * unit had been deleted. + *

+ * + * @param monitor the given progress monitor + * @param region the given region + * @param owner the owner of working copies that take precedence over their original javaScript units, + * or null if the primary working copy owner should be used + * @exception JavaScriptModelException if an element in the region does not exist or if an + * exception occurs while accessing its corresponding resource + * @exception IllegalArgumentException if region is null + * @return a type hierarchy for all types in the given + * region, considering subtypes within that region + */ + public static ITypeHierarchy newTypeHierarchy(IRegion region, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaScriptModelException { + if (region == null) { + throw new IllegalArgumentException(Messages.hierarchy_nullRegion); + } + IJavaScriptUnit[] workingCopies = JavaModelManager.getJavaModelManager().getWorkingCopies(owner, true/*add primary working copies*/); + CreateTypeHierarchyOperation op = + new CreateTypeHierarchyOperation(region, workingCopies, null, true/*compute subtypes*/); + op.runOperation(monitor); + return op.getResult(); + } + + /** + * Creates and returns a new non-exported includepath entry of kind CPE_LIBRARY for the + * JAR or folder identified by the given absolute path. This specifies that all package fragments + * within the root will have children of type IClassFile. + * This method is fully equivalent to calling + * {@link #newLibraryEntry(IPath, IPath, IPath, IAccessRule[], IIncludePathAttribute[], boolean) + * newLibraryEntry(path, sourceAttachmentPath, sourceAttachmentRootPath, new IAccessRule[0], new IIncludePathAttribute[0], false)}. + * + * @param path the absolute path of the binary archive + * @param sourceAttachmentPath the absolute path of the corresponding source archive or folder, + * or null if none. Note, since 3.0, an empty path is allowed to denote no source attachment. + * and will be automatically converted to null. + * @param sourceAttachmentRootPath the location of the root of the source files within the source archive or folder + * or null if this location should be automatically detected. + * @return a new library includepath entry + */ + public static IIncludePathEntry newLibraryEntry( + IPath path, + IPath sourceAttachmentPath, + IPath sourceAttachmentRootPath) { + + return newLibraryEntry( + path, + sourceAttachmentPath, + sourceAttachmentRootPath, + ClasspathEntry.NO_ACCESS_RULES, + ClasspathEntry.NO_EXTRA_ATTRIBUTES, + false/*not exported*/); + } + + /** + * Creates and returns a new includepath entry of kind CPE_LIBRARY for the JAR or folder + * identified by the given absolute path. This specifies that all package fragments within the root + * will have children of type IClassFile. + * This method is fully equivalent to calling + * {@link #newLibraryEntry(IPath, IPath, IPath, IAccessRule[], IIncludePathAttribute[], boolean) + * newLibraryEntry(path, sourceAttachmentPath, sourceAttachmentRootPath, new IAccessRule[0], new IIncludePathAttribute[0], isExported)}. + * + * @param path the absolute path of the binary archive + * @param sourceAttachmentPath the absolute path of the corresponding source archive or folder, + * or null if none. Note, since 3.0, an empty path is allowed to denote no source attachment. + * and will be automatically converted to null. + * @param sourceAttachmentRootPath the location of the root of the source files within the source archive or folder + * or null if this location should be automatically detected. + * @param isExported indicates whether this entry is contributed to dependent + * projects in addition to the output location + * @return a new library includepath entry + */ + public static IIncludePathEntry newLibraryEntry( + IPath path, + IPath sourceAttachmentPath, + IPath sourceAttachmentRootPath, + boolean isExported) { + + return newLibraryEntry( + path, + sourceAttachmentPath, + sourceAttachmentRootPath, + ClasspathEntry.NO_ACCESS_RULES, + ClasspathEntry.NO_EXTRA_ATTRIBUTES, + isExported); + } + + /** + * Creates and returns a new includepath entry of kind CPE_LIBRARY for the JAR or folder + * identified by the given absolute path. This specifies that all package fragments within the root + * will have children of type IClassFile. + *

+ * A library entry is used to denote a prerequisite JAR or root folder containing binaries. + * The target JAR can either be defined internally to the workspace (absolute path relative + * to the workspace root) or externally to the workspace (absolute path in the file system). + * The target root folder can only be defined internally to the workspace (absolute path relative + * to the workspace root). To use a binary folder external to the workspace, it must first be + * linked (see IFolder#createLink(...)). + *

+ *

+ * The extraAttributes list contains name/value pairs that must be persisted with + * this entry. If no extra attributes are provided, an empty array must be passed in.
+ * Note that this list should not contain any duplicate name. + *

+ *

+ * The isExported flag indicates whether this entry is contributed to dependent + * projects. If not exported, dependent projects will not see any of the classes from this entry. + * If exported, dependent projects will concatenate the accessible files patterns of this entry with the + * accessible files patterns of the projects, and they will concatenate the non accessible files patterns of this entry + * with the non accessible files patterns of the project. + *

+ * + * @param path the absolute path of the binary archive + * @param sourceAttachmentPath the absolute path of the corresponding source archive or folder, + * or null if none. Note, since 3.0, an empty path is allowed to denote no source attachment. + * and will be automatically converted to null. + * @param sourceAttachmentRootPath the location of the root of the source files within the source archive or folder + * or null if this location should be automatically detected. + * @param accessRules the possibly empty list of access rules for this entry + * @param extraAttributes the possibly empty list of extra attributes to persist with this entry + * @param isExported indicates whether this entry is contributed to dependent + * projects in addition to the output location + * @return a new library includepath entry + */ + public static IIncludePathEntry newLibraryEntry( + IPath path, + IPath sourceAttachmentPath, + IPath sourceAttachmentRootPath, + IAccessRule[] accessRules, + IIncludePathAttribute[] extraAttributes, + boolean isExported) { + + if (path == null) Assert.isTrue(false, "Library path cannot be null"); //$NON-NLS-1$ + if (!path.isAbsolute()) Assert.isTrue(false, "Path for IIncludePathEntry must be absolute"); //$NON-NLS-1$ + if (sourceAttachmentPath != null) { + if (sourceAttachmentPath.isEmpty()) { + sourceAttachmentPath = null; // treat empty path as none + } else if (!sourceAttachmentPath.isAbsolute()) { + Assert.isTrue(false, "Source attachment path '" //$NON-NLS-1$ + + sourceAttachmentPath + + "' for IIncludePathEntry must be absolute"); //$NON-NLS-1$ + } + } + return new ClasspathEntry( + IPackageFragmentRoot.K_BINARY, + IIncludePathEntry.CPE_LIBRARY, + JavaProject.canonicalizedPath(path), + ClasspathEntry.INCLUDE_ALL, // inclusion patterns + ClasspathEntry.EXCLUDE_NONE, // exclusion patterns + sourceAttachmentPath, + sourceAttachmentRootPath, + null, // specific output folder + isExported, + accessRules, + false, // no access rules to combine + extraAttributes); + } + + /** + * Creates and returns a new includepath entry of kind CPE_LIBRARY for the JAR or folder + * identified by the given absolute path. This specifies that all package fragments within the root + * will have children of type IClassFile. + *

+ * A library entry is used to denote a prerequisite JAR or root folder containing binaries. + * The target JAR can either be defined internally to the workspace (absolute path relative + * to the workspace root) or externally to the workspace (absolute path in the file system). + * The target root folder can only be defined internally to the workspace (absolute path relative + * to the workspace root). To use a binary folder external to the workspace, it must first be + * linked (see IFolder#createLink(...)). + *

+ *

+ * The extraAttributes list contains name/value pairs that must be persisted with + * this entry. If no extra attributes are provided, an empty array must be passed in.
+ * Note that this list should not contain any duplicate name. + *

+ *

+ * The isExported flag indicates whether this entry is contributed to dependent + * projects. If not exported, dependent projects will not see any of the classes from this entry. + * If exported, dependent projects will concatenate the accessible files patterns of this entry with the + * accessible files patterns of the projects, and they will concatenate the non accessible files patterns of this entry + * with the non accessible files patterns of the project. + *

+ * + * @param path the absolute path of the binary archive + * @param sourceAttachmentPath the absolute path of the corresponding source archive or folder, + * or null if none. Note, since 3.0, an empty path is allowed to denote no source attachment. + * and will be automatically converted to null. + * @param sourceAttachmentRootPath the location of the root of the source files within the source archive or folder + * or null if this location should be automatically detected. + * @param accessRules the possibly empty list of access rules for this entry + * @param exclusionPatterns the possibly empty list of exclusion patterns + * represented as relative paths + * @param extraAttributes the possibly empty list of extra attributes to persist with this entry + * @param isExported indicates whether this entry is contributed to dependent + * projects in addition to the output location + * @return a new library includepath entry + */ + public static IIncludePathEntry newLibraryEntry( + IPath path, + IPath sourceAttachmentPath, + IPath sourceAttachmentRootPath, + IAccessRule[] accessRules, + IIncludePathAttribute[] extraAttributes, + IPath[] exclusionPatterns, + boolean isExported) { + + if (path == null) Assert.isTrue(false, "Library path cannot be null"); //$NON-NLS-1$ + if (!path.isAbsolute()) Assert.isTrue(false, "Path for IIncludePathEntry must be absolute"); //$NON-NLS-1$ + if (sourceAttachmentPath != null) { + if (sourceAttachmentPath.isEmpty()) { + sourceAttachmentPath = null; // treat empty path as none + } else if (!sourceAttachmentPath.isAbsolute()) { + Assert.isTrue(false, "Source attachment path '" //$NON-NLS-1$ + + sourceAttachmentPath + + "' for IIncludePathEntry must be absolute"); //$NON-NLS-1$ + } + } + return new ClasspathEntry( + IPackageFragmentRoot.K_BINARY, + IIncludePathEntry.CPE_LIBRARY, + JavaProject.canonicalizedPath(path), + ClasspathEntry.INCLUDE_ALL, // inclusion patterns + exclusionPatterns, // exclusion patterns + sourceAttachmentPath, + sourceAttachmentRootPath, + null, // specific output folder + isExported, + accessRules, + false, // no access rules to combine + extraAttributes); + } + + /** + * Creates and returns a new non-exported includepath entry of kind CPE_PROJECT + * for the project identified by the given absolute path. + * This method is fully equivalent to calling + * {@link #newProjectEntry(IPath, IAccessRule[], boolean, IIncludePathAttribute[], boolean) + * newProjectEntry(path, new IAccessRule[0], true, new IIncludePathAttribute[0], false)}. + * + * @param path the absolute path of the binary archive + * @return a new project includepath entry + */ + public static IIncludePathEntry newProjectEntry(IPath path) { + return newProjectEntry(path, false); + } + + /** + * Creates and returns a new includepath entry of kind CPE_PROJECT + * for the project identified by the given absolute path. + * This method is fully equivalent to calling + * {@link #newProjectEntry(IPath, IAccessRule[], boolean, IIncludePathAttribute[], boolean) + * newProjectEntry(path, new IAccessRule[0], true, new IIncludePathAttribute[0], isExported)}. + * + * @param path the absolute path of the prerequisite project + * @param isExported indicates whether this entry is contributed to dependent + * projects in addition to the output location + * @return a new project includepath entry + */ + public static IIncludePathEntry newProjectEntry(IPath path, boolean isExported) { + + if (!path.isAbsolute()) Assert.isTrue(false, "Path for IIncludePathEntry must be absolute"); //$NON-NLS-1$ + + return newProjectEntry( + path, + ClasspathEntry.NO_ACCESS_RULES, + true, + ClasspathEntry.NO_EXTRA_ATTRIBUTES, + isExported); + } + + /** + * Creates and returns a new includepath entry of kind CPE_PROJECT + * for the project identified by the given absolute path. + *

+ * A project entry is used to denote a prerequisite project on a includepath. + * The referenced project will be contributed as a whole, either as sources (in the JavaScript Model, it + * contributes all its package fragment roots) or as binaries (when building, it contributes its + * whole output location). + *

+ *

+ * A project reference allows to indirect through another project, independently from its internal layout. + *

+ * The prerequisite project is referred to using an absolute path relative to the workspace root. + *

+ *

+ * The access rules determine the set of accessible class files + * in the project. If the list of access rules is empty then all files + * in this project are accessible. + * See {@link IAccessRule} for a detailed description of access rules. + *

+ *

+ * The combineAccessRules flag indicates whether access rules of one (or more) + * exported entry of the project should be combined with the given access rules. If they should + * be combined, the given access rules are considered first, then the entry's access rules are + * considered. + *

+ *

+ * The extraAttributes list contains name/value pairs that must be persisted with + * this entry. If no extra attributes are provided, an empty array must be passed in.
+ * Note that this list should not contain any duplicate name. + *

+ *

+ * The isExported flag indicates whether this entry is contributed to dependent + * projects. If not exported, dependent projects will not see any of the classes from this entry. + * If exported, dependent projects will concatenate the accessible files patterns of this entry with the + * accessible files patterns of the projects, and they will concatenate the non accessible files patterns of this entry + * with the non accessible files patterns of the project. + *

+ * + * @param path the absolute path of the prerequisite project + * @param accessRules the possibly empty list of access rules for this entry + * @param combineAccessRules whether the access rules of the project's exported entries should be combined with the given access rules + * @param extraAttributes the possibly empty list of extra attributes to persist with this entry + * @param isExported indicates whether this entry is contributed to dependent + * projects in addition to the output location + * @return a new project includepath entry + */ + public static IIncludePathEntry newProjectEntry( + IPath path, + IAccessRule[] accessRules, + boolean combineAccessRules, + IIncludePathAttribute[] extraAttributes, + boolean isExported) { + + if (!path.isAbsolute()) Assert.isTrue(false, "Path for IIncludePathEntry must be absolute"); //$NON-NLS-1$ + + return new ClasspathEntry( + IPackageFragmentRoot.K_SOURCE, + IIncludePathEntry.CPE_PROJECT, + path, + ClasspathEntry.INCLUDE_ALL, // inclusion patterns + ClasspathEntry.EXCLUDE_NONE, // exclusion patterns + null, // source attachment + null, // source attachment root + null, // specific output folder + isExported, + accessRules, + combineAccessRules, + extraAttributes); + } + + /** + * Returns a new empty region. + * + * @return a new empty region + */ + public static IRegion newRegion() { + return new Region(); + } + + /** + * Creates and returns a new includepath entry of kind CPE_SOURCE + * for all files in the project's source folder identified by the given + * absolute workspace-relative path. + *

+ * The convenience method is fully equivalent to: + *

+	 * newSourceEntry(path, new IPath[] {}, new IPath[] {}, null);
+	 * 
+ *

+ * + * @param path the absolute workspace-relative path of a source folder + * @return a new source includepath entry + * @see #newSourceEntry(IPath, IPath[], IPath[], IPath) + */ + public static IIncludePathEntry newSourceEntry(IPath path) { + + return newSourceEntry(path, ClasspathEntry.INCLUDE_ALL, ClasspathEntry.EXCLUDE_NONE, null /*output location*/); + } + + /** + * Creates and returns a new includepath entry of kind CPE_SOURCE + * for the project's source folder identified by the given absolute + * workspace-relative path but excluding all source files with paths + * matching any of the given patterns. + *

+ * The convenience method is fully equivalent to: + *

+	 * newSourceEntry(path, new IPath[] {}, exclusionPatterns, null);
+	 * 
+ *

+ * + * @param path the absolute workspace-relative path of a source folder + * @param exclusionPatterns the possibly empty list of exclusion patterns + * represented as relative paths + * @return a new source includepath entry + * @see #newSourceEntry(IPath, IPath[], IPath[], IPath) + */ + public static IIncludePathEntry newSourceEntry(IPath path, IPath[] exclusionPatterns) { + + return newSourceEntry(path, ClasspathEntry.INCLUDE_ALL, exclusionPatterns, null /*output location*/); + } + + /** + * Creates and returns a new includepath entry of kind CPE_SOURCE + * for the project's source folder identified by the given absolute + * workspace-relative path but excluding all source files with paths + * matching any of the given patterns, and associated with a specific output location + * (that is, ".class" files are not going to the project default output location). + *

+ * The convenience method is fully equivalent to: + *

+	 * newSourceEntry(path, new IPath[] {}, exclusionPatterns, specificOutputLocation);
+	 * 
+ *

+ * + * @param path the absolute workspace-relative path of a source folder + * @param exclusionPatterns the possibly empty list of exclusion patterns + * represented as relative paths + * @param specificOutputLocation the specific output location for this source entry (null if using project default ouput location) + * @return a new source includepath entry + * @see #newSourceEntry(IPath, IPath[], IPath[], IPath) + */ + public static IIncludePathEntry newSourceEntry(IPath path, IPath[] exclusionPatterns, IPath specificOutputLocation) { + + return newSourceEntry(path, ClasspathEntry.INCLUDE_ALL, exclusionPatterns, specificOutputLocation); + } + + /** + * Creates and returns a new includepath entry of kind CPE_SOURCE + * for the project's source folder identified by the given absolute + * workspace-relative path but excluding all source files with paths + * matching any of the given patterns, and associated with a specific output location + * (that is, ".class" files are not going to the project default output location). + *

+ * The convenience method is fully equivalent to: + *

+	 * newSourceEntry(path, new IPath[] {}, exclusionPatterns, specificOutputLocation, new IIncludePathAttribute[] {});
+	 * 
+ *

+ * + * @param path the absolute workspace-relative path of a source folder + * @param inclusionPatterns the possibly empty list of inclusion patterns + * represented as relative paths + * @param exclusionPatterns the possibly empty list of exclusion patterns + * represented as relative paths + * @param specificOutputLocation the specific output location for this source entry (null if using project default ouput location) + * @return a new source includepath entry + * @see #newSourceEntry(IPath, IPath[], IPath[], IPath, IIncludePathAttribute[]) + */ + public static IIncludePathEntry newSourceEntry(IPath path, IPath[] inclusionPatterns, IPath[] exclusionPatterns, IPath specificOutputLocation) { + return newSourceEntry(path, inclusionPatterns, exclusionPatterns, specificOutputLocation, ClasspathEntry.NO_EXTRA_ATTRIBUTES); + } + + /** + * Creates and returns a new includepath entry of kind CPE_SOURCE + * for the project's source folder identified by the given absolute + * workspace-relative path using the given inclusion and exclusion patterns + * to determine which source files are included, and the given output path + * to control the output location of generated files. + *

+ * The source folder is referred to using an absolute path relative to the + * workspace root, e.g. /Project/src. A project's source + * folders are located with that project. That is, a source includepath + * entry specifying the path /P1/src is only usable for + * project P1. + *

+ *

+ * The inclusion patterns determines the initial set of source files that + * are to be included; the exclusion patterns are then used to reduce this + * set. When no inclusion patterns are specified, the initial file set + * includes all relevent files in the resource tree rooted at the source + * entry's path. On the other hand, specifying one or more inclusion + * patterns means that all and only files matching at least one of + * the specified patterns are to be included. If exclusion patterns are + * specified, the initial set of files is then reduced by eliminating files + * matched by at least one of the exclusion patterns. Inclusion and + * exclusion patterns look like relative file paths with wildcards and are + * interpreted relative to the source entry's path. File patterns are + * case-sensitive can contain '**', '*' or '?' wildcards (see + * {@link IIncludePathEntry#getExclusionPatterns()} for the full description + * of their syntax and semantics). The resulting set of files are included + * in the corresponding package fragment root; all package fragments within + * the root will have children of type IJavaScriptUnit. + *

+ *

+ * Also note that all sources/binaries inside a project are contributed as + * a whole through a project entry + * (see JavaScriptCore.newProjectEntry). Particular source entries + * cannot be selectively exported. + *

+ *

+ * The extraAttributes list contains name/value pairs that must be persisted with + * this entry. If no extra attributes are provided, an empty array must be passed in.
+ * Note that this list should not contain any duplicate name. + *

+ * + * @param path the absolute workspace-relative path of a source folder + * @param inclusionPatterns the possibly empty list of inclusion patterns + * represented as relative paths + * @param exclusionPatterns the possibly empty list of exclusion patterns + * represented as relative paths + * @param specificOutputLocation the specific output location for this source entry (null if using project default ouput location) + * @param extraAttributes the possibly empty list of extra attributes to persist with this entry + * @return a new source includepath entry with the given exclusion patterns + * @see IIncludePathEntry#getInclusionPatterns() + * @see IIncludePathEntry#getExclusionPatterns() + * @see IIncludePathEntry#getOutputLocation() + */ + public static IIncludePathEntry newSourceEntry(IPath path, IPath[] inclusionPatterns, IPath[] exclusionPatterns, IPath specificOutputLocation, IIncludePathAttribute[] extraAttributes) { + + if (path == null) Assert.isTrue(false, "Source path cannot be null"); //$NON-NLS-1$ + if (!path.isAbsolute()) Assert.isTrue(false, "Path for IIncludePathEntry must be absolute"); //$NON-NLS-1$ + if (exclusionPatterns == null) Assert.isTrue(false, "Exclusion pattern set cannot be null"); //$NON-NLS-1$ + if (inclusionPatterns == null) Assert.isTrue(false, "Inclusion pattern set cannot be null"); //$NON-NLS-1$ + + return new ClasspathEntry( + IPackageFragmentRoot.K_SOURCE, + IIncludePathEntry.CPE_SOURCE, + path, + inclusionPatterns, + exclusionPatterns, + null, // source attachment + null, // source attachment root + specificOutputLocation, // custom output location + false, + null, + false, // no access rules to combine + extraAttributes); + } + + /** + * Creates and returns a new non-exported includepath entry of kind CPE_VARIABLE + * for the given path. This method is fully equivalent to calling + * {@link #newVariableEntry(IPath, IPath, IPath, IAccessRule[], IIncludePathAttribute[], boolean) + * newVariableEntry(variablePath, variableSourceAttachmentPath, sourceAttachmentRootPath, new IAccessRule[0], new IIncludePathAttribute[0], false)}. + * + * @param variablePath the path of the binary archive; first segment is the + * name of a includepath variable + * @param variableSourceAttachmentPath the path of the corresponding source archive, + * or null if none; if present, the first segment is the + * name of a includepath variable (not necessarily the same variable + * as the one that begins variablePath) + * @param sourceAttachmentRootPath the location of the root of the source files within the source archive + * or null if variableSourceAttachmentPath is also null + * @return a new library includepath entry + */ + public static IIncludePathEntry newVariableEntry( + IPath variablePath, + IPath variableSourceAttachmentPath, + IPath sourceAttachmentRootPath) { + + return newVariableEntry(variablePath, variableSourceAttachmentPath, sourceAttachmentRootPath, false); + } + + /** + * Creates and returns a new includepath entry of kind CPE_VARIABLE + * for the given path. This method is fully equivalent to calling + * {@link #newVariableEntry(IPath, IPath, IPath, IAccessRule[], IIncludePathAttribute[], boolean) + * newVariableEntry(variablePath, variableSourceAttachmentPath, sourceAttachmentRootPath, new IAccessRule[0], new IIncludePathAttribute[0], isExported)}. + * + * @param variablePath the path of the binary archive; first segment is the + * name of a includepath variable + * @param variableSourceAttachmentPath the path of the corresponding source archive, + * or null if none; if present, the first segment is the + * name of a includepath variable (not necessarily the same variable + * as the one that begins variablePath) + * @param variableSourceAttachmentRootPath the location of the root of the source files within the source archive + * or null if variableSourceAttachmentPath is also null + * @param isExported indicates whether this entry is contributed to dependent + * projects in addition to the output location + * @return a new variable includepath entry + */ + public static IIncludePathEntry newVariableEntry( + IPath variablePath, + IPath variableSourceAttachmentPath, + IPath variableSourceAttachmentRootPath, + boolean isExported) { + + return newVariableEntry( + variablePath, + variableSourceAttachmentPath, + variableSourceAttachmentRootPath, + ClasspathEntry.NO_ACCESS_RULES, + ClasspathEntry.NO_EXTRA_ATTRIBUTES, + isExported); + } + + /** + * Creates and returns a new includepath entry of kind CPE_VARIABLE + * for the given path. The first segment of the path is the name of a includepath variable. + * The trailing segments of the path will be appended to resolved variable path. + *

+ * A variable entry allows to express indirect references on a includepath to other projects or libraries, + * depending on what the includepath variable is referring. + *

+ * It is possible to register an automatic initializer (JsGlobalScopeVariableInitializer), + * which will be invoked through the extension point "org.eclipse.wst.jsdt.core.JsGlobalScopeVariableInitializer". + * After resolution, a includepath variable entry may either correspond to a project or a library entry. + *

+ * The extraAttributes list contains name/value pairs that must be persisted with + * this entry. If no extra attributes are provided, an empty array must be passed in.
+ * Note that this list should not contain any duplicate name. + *

+ *

+ * The isExported flag indicates whether this entry is contributed to dependent + * projects. If not exported, dependent projects will not see any of the classes from this entry. + * If exported, dependent projects will concatenate the accessible files patterns of this entry with the + * accessible files patterns of the projects, and they will concatenate the non accessible files patterns of this entry + * with the non accessible files patterns of the project. + *

+ *

+ * Note that this operation does not attempt to validate includepath variables + * or access the resources at the given paths. + *

+ * + * @param variablePath the path of the binary archive; first segment is the + * name of a includepath variable + * @param variableSourceAttachmentPath the path of the corresponding source archive, + * or null if none; if present, the first segment is the + * name of a includepath variable (not necessarily the same variable + * as the one that begins variablePath) + * @param variableSourceAttachmentRootPath the location of the root of the source files within the source archive + * or null if variableSourceAttachmentPath is also null + * @param accessRules the possibly empty list of access rules for this entry + * @param extraAttributes the possibly empty list of extra attributes to persist with this entry + * @param isExported indicates whether this entry is contributed to dependent + * projects in addition to the output location + * @return a new variable includepath entry + */ + public static IIncludePathEntry newVariableEntry( + IPath variablePath, + IPath variableSourceAttachmentPath, + IPath variableSourceAttachmentRootPath, + IAccessRule[] accessRules, + IIncludePathAttribute[] extraAttributes, + boolean isExported) { + + if (variablePath == null) Assert.isTrue(false, "Variable path cannot be null"); //$NON-NLS-1$ + if (variablePath.segmentCount() < 1) { + Assert.isTrue( + false, + "Illegal includepath variable path: \'" + variablePath.makeRelative().toString() + "\', must have at least one segment"); //$NON-NLS-1$//$NON-NLS-2$ + } + + return new ClasspathEntry( + IPackageFragmentRoot.K_SOURCE, + IIncludePathEntry.CPE_VARIABLE, + variablePath, + ClasspathEntry.INCLUDE_ALL, // inclusion patterns + ClasspathEntry.EXCLUDE_NONE, // exclusion patterns + variableSourceAttachmentPath, // source attachment + variableSourceAttachmentRootPath, // source attachment root + null, // specific output folder + isExported, + accessRules, + false, // no access rules to combine + extraAttributes); + } + + /** + * Removed the given includepath variable. Does nothing if no value was + * set for this includepath variable. + *

+ * This functionality cannot be used while the resource tree is locked. + *

+ * Includepath variable values are persisted locally to the workspace, and + * are preserved from session to session. + *

+ * + * @param variableName the name of the includepath variable + * @param monitor the progress monitor to report progress + * @see #setIncludepathVariable(String, IPath) + */ + public static void removeIncludepathVariable(String variableName, IProgressMonitor monitor) { + try { + SetVariablesOperation operation = new SetVariablesOperation(new String[]{ variableName}, new IPath[]{ null }, true/*update preferences*/); + operation.runOperation(monitor); + } catch (JavaScriptModelException e) { + Util.log(e, "Exception while removing variable " + variableName); //$NON-NLS-1$ + } + } + + /** + * Removes the given element changed listener. + * Has no affect if an identical listener is not registered. + * + * @param listener the listener + */ + public static void removeElementChangedListener(IElementChangedListener listener) { + JavaModelManager.getJavaModelManager().deltaState.removeElementChangedListener(listener); + } + + /** + * Removes the file extension from the given file name, if it has a JavaScript-like file + * extension. Otherwise the file name itself is returned. + * Note this removes the dot ('.') before the extension as well. + * + * @param fileName the name of a file + * @return the fileName without the JavaScript-like extension + */ + public static String removeJavaScriptLikeExtension(String fileName) { + return Util.getNameWithoutJavaLikeExtension(fileName); + } + + /** + * Removes the given pre-processing resource changed listener. + *

+ * Has no affect if an identical listener is not registered. + * + * @param listener the listener + */ + public static void removePreProcessingResourceChangedListener(IResourceChangeListener listener) { + JavaModelManager.getJavaModelManager().deltaState.removePreResourceChangedListener(listener); + } + + + + /** + * Runs the given action as an atomic JavaScript model operation. + *

+ * After running a method that modifies javaScript elements, + * registered listeners receive after-the-fact notification of + * what just transpired, in the form of a element changed event. + * This method allows clients to call a number of + * methods that modify javaScript elements and only have element + * changed event notifications reported at the end of the entire + * batch. + *

+ *

+ * If this method is called outside the dynamic scope of another such + * call, this method runs the action and then reports a single + * element changed event describing the net effect of all changes + * done to javaScript elements by the action. + *

+ *

+ * If this method is called in the dynamic scope of another such + * call, this method simply runs the action. + *

+ * + * @param action the action to perform + * @param monitor a progress monitor, or null if progress + * reporting and cancellation are not desired + * @exception CoreException if the operation failed. + */ + public static void run(IWorkspaceRunnable action, IProgressMonitor monitor) throws CoreException { + run(action, ResourcesPlugin.getWorkspace().getRoot(), monitor); + } + /** + * Runs the given action as an atomic JavaScript model operation. + *

+ * After running a method that modifies javaScript elements, + * registered listeners receive after-the-fact notification of + * what just transpired, in the form of a element changed event. + * This method allows clients to call a number of + * methods that modify javaScript elements and only have element + * changed event notifications reported at the end of the entire + * batch. + *

+ *

+ * If this method is called outside the dynamic scope of another such + * call, this method runs the action and then reports a single + * element changed event describing the net effect of all changes + * done to javaScript elements by the action. + *

+ *

+ * If this method is called in the dynamic scope of another such + * call, this method simply runs the action. + *

+ *

+ * The supplied scheduling rule is used to determine whether this operation can be + * run simultaneously with workspace changes in other threads. See + * IWorkspace.run(...) for more details. + *

+ * + * @param action the action to perform + * @param rule the scheduling rule to use when running this operation, or + * null if there are no scheduling restrictions for this operation. + * @param monitor a progress monitor, or null if progress + * reporting and cancellation are not desired + * @exception CoreException if the operation failed. + */ + public static void run(IWorkspaceRunnable action, ISchedulingRule rule, IProgressMonitor monitor) throws CoreException { + IWorkspace workspace = ResourcesPlugin.getWorkspace(); + if (workspace.isTreeLocked()) { + new BatchOperation(action).run(monitor); + } else { + // use IWorkspace.run(...) to ensure that a build will be done in autobuild mode + workspace.run(new BatchOperation(action), rule, IWorkspace.AVOID_UPDATE, monitor); + } + } + /** + * Bind a container reference path to some actual containers (IJsGlobalScopeContainer). + * This API must be invoked whenever changes in container need to be reflected onto the JavaModel. + * Containers can have distinct values in different projects, therefore this API considers a + * set of projects with their respective containers. + *

+ * containerPath is the path under which these values can be referenced through + * container includepath entries (IIncludePathEntry#CPE_CONTAINER). A container path + * is formed by a first ID segment followed with extra segments, which can be used as additional hints + * for the resolution. The container ID is used to identify a JsGlobalScopeContainerInitializer + * registered on the extension point "org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer". + *

+ * There is no assumption that each individual container value passed in argument + * (respectiveContainers) must answer the exact same path when requested + * IJsGlobalScopeContainer#getPath. + * Indeed, the containerPath is just an indication for resolving it to an actual container object. It can be + * delegated to a JsGlobalScopeContainerInitializer, which can be activated through the extension + * point "org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer"). + *

+ * In reaction to changing container values, the JavaModel will be updated to reflect the new + * state of the updated container. A combined JavaScript element delta will be notified to describe the corresponding + * includepath changes resulting from the container update. This operation is batched, and automatically eliminates + * unnecessary updates (new container is same as old one). This operation acquires a lock on the workspace's root. + *

+ * This functionality cannot be used while the workspace is locked, since + * it may create/remove some resource markers. + *

+ * Includepath container values are persisted locally to the workspace, but + * are not preserved from a session to another. It is thus highly recommended to register a + * JsGlobalScopeContainerInitializer for each referenced container + * (through the extension point "org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer"). + *

+ * Note: setting a container to null will cause it to be lazily resolved again whenever + * its value is required. In particular, this will cause a registered initializer to be invoked + * again. + *

+ * @param containerPath - the name of the container reference, which is being updated + * @param affectedProjects - the set of projects for which this container is being bound + * @param respectiveContainers - the set of respective containers for the affected projects + * @param monitor a monitor to report progress + * @throws JavaScriptModelException + * @see JsGlobalScopeContainerInitializer + * @see #getJsGlobalScopeContainer(IPath, IJavaScriptProject) + * @see IJsGlobalScopeContainer + */ + public static void setJsGlobalScopeContainer(IPath containerPath, IJavaScriptProject[] affectedProjects, IJsGlobalScopeContainer[] respectiveContainers, IProgressMonitor monitor) throws JavaScriptModelException { + if (affectedProjects.length != respectiveContainers.length) + Assert.isTrue(false, "Projects and containers collections should have the same size"); //$NON-NLS-1$ + SetContainerOperation operation = new SetContainerOperation(containerPath, affectedProjects, respectiveContainers); +// operation.runOperation(monitor); + + operation.progressMonitor=monitor; + + operation.execute(); + + + + } + + /** + * Sets the value of the given includepath variable. + * The path must have at least one segment. + *

+ * This functionality cannot be used while the resource tree is locked. + *

+ * Includepath variable values are persisted locally to the workspace, and + * are preserved from session to session. + *

+ * + * @param variableName the name of the includepath variable + * @param path the path + * @throws JavaScriptModelException + * @see #getIncludepathVariable(String) + * + * @deprecated Use {@link #setIncludepathVariable(String, IPath, IProgressMonitor)} instead + */ + public static void setIncludepathVariable(String variableName, IPath path) + throws JavaScriptModelException { + + setIncludepathVariable(variableName, path, null); + } + + /** + * Sets the value of the given includepath variable. + * The path must not be null. + *

+ * This functionality cannot be used while the resource tree is locked. + *

+ * Includepath variable values are persisted locally to the workspace, and + * are preserved from session to session. + *

+ * Updating a variable with the same value has no effect. + * + * @param variableName the name of the includepath variable + * @param path the path + * @param monitor a monitor to report progress + * @throws JavaScriptModelException + * @see #getIncludepathVariable(String) + */ + public static void setIncludepathVariable( + String variableName, + IPath path, + IProgressMonitor monitor) + throws JavaScriptModelException { + + if (path == null) Assert.isTrue(false, "Variable path cannot be null"); //$NON-NLS-1$ + setIncludepathVariables(new String[]{variableName}, new IPath[]{ path }, monitor); + } + + /** + * Sets the values of all the given includepath variables at once. + * Null paths can be used to request corresponding variable removal. + *

+ * A combined JavaScript element delta will be notified to describe the corresponding + * includepath changes resulting from the variables update. This operation is batched, + * and automatically eliminates unnecessary updates (new variable is same as old one). + * This operation acquires a lock on the workspace's root. + *

+ * This functionality cannot be used while the workspace is locked, since + * it may create/remove some resource markers. + *

+ * Includepath variable values are persisted locally to the workspace, and + * are preserved from session to session. + *

+ * Updating a variable with the same value has no effect. + * + * @param variableNames an array of names for the updated includepath variables + * @param paths an array of path updates for the modified includepath variables (null + * meaning that the corresponding value will be removed + * @param monitor a monitor to report progress + * @throws JavaScriptModelException + * @see #getIncludepathVariable(String) + */ + public static void setIncludepathVariables( + String[] variableNames, + IPath[] paths, + IProgressMonitor monitor) + throws JavaScriptModelException { + + if (variableNames.length != paths.length) Assert.isTrue(false, "Variable names and paths collections should have the same size"); //$NON-NLS-1$ + SetVariablesOperation operation = new SetVariablesOperation(variableNames, paths, true/*update preferences*/); + operation.runOperation(monitor); + } + + /** + * Sets the default's validator options inside the given options map according + * to the given compliance. + * + *

The given compliance must be one of the compliance supported by the validator. + * See {@link #getDefaultOptions()} for a list of compliance values.

+ * + *

The list of modified options is:

+ *
    + *
  • {@link #COMPILER_CODEGEN_TARGET_PLATFORM}
  • + *
  • {@link #COMPILER_SOURCE}
  • + *
  • {@link #COMPILER_COMPLIANCE}
  • + *
  • {@link #COMPILER_PB_ASSERT_IDENTIFIER}
  • + *
  • {@link #COMPILER_PB_ENUM_IDENTIFIER}
  • + *
+ * + *

If the given compliance is unknown, the given map is unmodified.

+ * + * @param compliance the given compliance + * @param options the given options map + */ + public static void setComplianceOptions(String compliance, Map options) { + switch((int) (CompilerOptions.versionToJdkLevel(compliance) >>> 16)) { + case ClassFileConstants.MAJOR_VERSION_1_3: + options.put(JavaScriptCore.COMPILER_COMPLIANCE, JavaScriptCore.VERSION_1_3); + options.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_3); + options.put(JavaScriptCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaScriptCore.VERSION_1_1); + options.put(JavaScriptCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaScriptCore.IGNORE); + break; + case ClassFileConstants.MAJOR_VERSION_1_4: + options.put(JavaScriptCore.COMPILER_COMPLIANCE, JavaScriptCore.VERSION_1_4); + options.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_3); + options.put(JavaScriptCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaScriptCore.VERSION_1_2); + options.put(JavaScriptCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaScriptCore.WARNING); + break; + case ClassFileConstants.MAJOR_VERSION_1_5: + options.put(JavaScriptCore.COMPILER_COMPLIANCE, JavaScriptCore.VERSION_1_5); + options.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_5); + options.put(JavaScriptCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaScriptCore.VERSION_1_5); + options.put(JavaScriptCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaScriptCore.ERROR); + break; + case ClassFileConstants.MAJOR_VERSION_1_6: + options.put(JavaScriptCore.COMPILER_COMPLIANCE, JavaScriptCore.VERSION_1_6); + options.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_6); + options.put(JavaScriptCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaScriptCore.VERSION_1_6); + options.put(JavaScriptCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaScriptCore.ERROR); + break; + case ClassFileConstants.MAJOR_VERSION_1_7: + options.put(JavaScriptCore.COMPILER_COMPLIANCE, JavaScriptCore.VERSION_1_7); + options.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_7); + options.put(JavaScriptCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaScriptCore.VERSION_1_7); + options.put(JavaScriptCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaScriptCore.ERROR); + } + } + + /** + * Sets the current table of options. All and only the options explicitly + * included in the given table are remembered; all previous option settings + * are forgotten, including ones not explicitly mentioned. + *

+ * For a complete description of the configurable options, see + * getDefaultOptions. + *

+ * + * @param newOptions + * the new options (key type: String; value type: + * String), or null to reset all + * options to their default values + * @see JavaScriptCore#getDefaultOptions() + * @see org.eclipse.wst.jsdt.internal.core.JavaCorePreferenceInitializer for changing default settings + */ + public static void setOptions(Hashtable newOptions) { + JavaModelManager.getJavaModelManager().setOptions(newOptions); + } + + /* (non-Javadoc) + * Shutdown the JavaScriptCore plug-in. + *

+ * De-registers the JavaModelManager as a resource changed listener and save participant. + *

+ * @see org.eclipse.core.runtime.Plugin#stop(BundleContext) + */ + public void stop(BundleContext context) throws Exception { + try { + JavaModelManager.getJavaModelManager().shutdown(); + } finally { + // ensure we call super.stop as the last thing + super.stop(context); + } + } + + /* (non-Javadoc) + * Startup the JavaScriptCore plug-in. + *

+ * Registers the JavaModelManager as a resource changed listener and save participant. + * Starts the background indexing, and restore saved includepath variable values. + *

+ * @throws Exception + * @see org.eclipse.core.runtime.Plugin#start(BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + JavaModelManager.getJavaModelManager().startup(); + } + public static String getSystemPath() + { + URL url=FileLocator.find(getJavaScriptCore().getBundle(),new Path("libraries"),null); //$NON-NLS-1$ + return url.getFile(); + } + + + public static boolean isReadOnly(IResource resource) + { + QualifiedName qn=new QualifiedName(JavaScriptCore.PLUGIN_ID,JavaScriptCore.READ_ONLY_SOURCE_PROPERTY); + try { + String persistentProperty = resource.getPersistentProperty(qn); + return "true".equals(persistentProperty); + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return false; + } + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JavaScriptModelException.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JavaScriptModelException.java new file mode 100644 index 0000000..daed779 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JavaScriptModelException.java @@ -0,0 +1,176 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import java.io.PrintStream; +import java.io.PrintWriter; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.wst.jsdt.internal.core.JavaModelStatus; + +/** + * A checked exception representing a failure in the JavaScript model. + * JavaScript model exceptions contain a JavaScript-specific status object describing the + * cause of the exception. + *

+ * This class is not intended to be subclassed by clients. Instances of this + * class are automatically created by the JavaScript model when problems arise, so + * there is generally no need for clients to create instances. + *

+ * + * @see IJavaScriptModelStatus + * @see IJavaScriptModelStatusConstants + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public class JavaScriptModelException extends CoreException { + + private static final long serialVersionUID = -760398656505871287L; // backward compatible + + CoreException nestedCoreException; +/** + * Creates a JavaScript model exception that wrappers the given Throwable. + * The exception contains a JavaScript-specific status object with severity + * IStatus.ERROR and the given status code. + * + * @param e the Throwable + * @param code one of the JavaScript-specific status codes declared in + * IJavaScriptModelStatusConstants + * @see IJavaScriptModelStatusConstants + * @see org.eclipse.core.runtime.IStatus#ERROR + */ +public JavaScriptModelException(Throwable e, int code) { + this(new JavaModelStatus(code, e)); +} +/** + * Creates a JavaScript model exception for the given CoreException. + * Equivalent to + * JavaScriptModelException(exception,IJavaScriptModelStatusConstants.CORE_EXCEPTION. + * + * @param exception the CoreException + */ +public JavaScriptModelException(CoreException exception) { + super(exception.getStatus()); + this.nestedCoreException = exception; +} +/** + * Creates a JavaScript model exception for the given JavaScript-specific status object. + * + * @param status the JavaScript-specific status object + */ +public JavaScriptModelException(IJavaScriptModelStatus status) { + super(status); +} +/** + * Returns the underlying Throwable that caused the failure. + * + * @return the wrappered Throwable, or null if the + * direct case of the failure was at the JavaScript model layer + */ +public Throwable getException() { + if (this.nestedCoreException == null) { + return getStatus().getException(); + } else { + return this.nestedCoreException; + } +} +/** + * Returns the JavaScript model status object for this exception. + * Equivalent to (IJavaScriptModelStatus) getStatus(). + * + * @return a status object + */ +public IJavaScriptModelStatus getJavaScriptModelStatus() { + IStatus status = this.getStatus(); + if (status instanceof IJavaScriptModelStatus) { + return (IJavaScriptModelStatus)status; + } else { + // A regular IStatus is created only in the case of a CoreException. + // See bug 13492 Should handle JavaModelExceptions that contains CoreException more gracefully + return new JavaModelStatus(this.nestedCoreException); + } +} +/** + * Returns whether this exception indicates that a JavaScript model element does not + * exist. Such exceptions have a status with a code of + * IJavaScriptModelStatusConstants.ELEMENT_DOES_NOT_EXIST or + * IJavaScriptModelStatusConstants.ELEMENT_NOT_ON_CLASSPATH. + * This is a convenience method. + * + * @return true if this exception indicates that a JavaScript model + * element does not exist + * @see IJavaScriptModelStatus#isDoesNotExist() + * @see IJavaScriptModelStatusConstants#ELEMENT_DOES_NOT_EXIST + * @see IJavaScriptModelStatusConstants#ELEMENT_NOT_ON_CLASSPATH + */ +public boolean isDoesNotExist() { + IJavaScriptModelStatus javaModelStatus = getJavaScriptModelStatus(); + return javaModelStatus != null && javaModelStatus.isDoesNotExist(); +} + +/** + * Prints this exception's stack trace to the given print stream. + * + * @param output the print stream + */ +public void printStackTrace(PrintStream output) { + synchronized(output) { + super.printStackTrace(output); + Throwable throwable = getException(); + if (throwable != null) { + output.print("Caused by: "); //$NON-NLS-1$ + throwable.printStackTrace(output); + } + } +} + +/** + * Prints this exception's stack trace to the given print writer. + * + * @param output the print writer + */ +public void printStackTrace(PrintWriter output) { + synchronized(output) { + super.printStackTrace(output); + Throwable throwable = getException(); + if (throwable != null) { + output.print("Caused by: "); //$NON-NLS-1$ + throwable.printStackTrace(output); + } + } +} +/* + * Returns a printable representation of this exception suitable for debugging + * purposes only. + */ +public String toString() { + StringBuffer buffer= new StringBuffer(); + buffer.append("JavaScript Model Exception: "); //$NON-NLS-1$ + if (getException() != null) { + if (getException() instanceof CoreException) { + CoreException c= (CoreException)getException(); + buffer.append("Core Exception [code "); //$NON-NLS-1$ + buffer.append(c.getStatus().getCode()); + buffer.append("] "); //$NON-NLS-1$ + buffer.append(c.getStatus().getMessage()); + } else { + buffer.append(getException().toString()); + } + } else { + buffer.append(getStatus().toString()); + } + return buffer.toString(); +} +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JsGlobalScopeContainerInitializer.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JsGlobalScopeContainerInitializer.java new file mode 100644 index 0000000..aa265ff --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JsGlobalScopeContainerInitializer.java @@ -0,0 +1,321 @@ +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * IBM Corporation - added support for requesting updates of a particular + * container for generic container operations. + * - canUpdateJsGlobalScopeContainer(IPath, IJavaScriptProject) + * - requestJsGlobalScopeContainerUpdate(IPath, IJavaScriptProject, IJsGlobalScopeContainer) + * IBM Corporation - allow initializers to provide a readable description + * of a container reference, ahead of actual resolution. + * - getDescription(IPath, IJavaScriptProject) + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import java.net.URI; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Status; +import org.eclipse.wst.jsdt.core.compiler.libraries.LibraryLocation; +import org.eclipse.wst.jsdt.internal.core.JavaModelStatus; + +/** + * Abstract base implementation of all includepath container initializer. + * Includepath variable containers are used in conjunction with the + * "org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer" extension point. + *

+ * Clients should subclass this class to implement a specific includepath + * container initializer. The subclass must have a public 0-argument + * constructor and a concrete implementation of initialize. + *

+ * Multiple includepath containers can be registered, each of them declares + * the container ID they can handle, so as to narrow the set of containers they + * can resolve, in other words, a container initializer is guaranteed to only be + * activated to resolve containers which match the ID they registered onto. + *

+ * In case multiple container initializers collide on the same container ID, the first + * registered one will be invoked. + * + * @see IIncludePathEntry + * @see IJsGlobalScopeContainer + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public abstract class JsGlobalScopeContainerInitializer implements IJsGlobalScopeContainerInitializer, IJsGlobalScopeContainer { + + /** + * Status code indicating that an attribute is not supported. + * + * @see #getAccessRulesStatus(IPath, IJavaScriptProject) + * @see #getAttributeStatus(IPath, IJavaScriptProject, String) + * @see #getSourceAttachmentStatus(IPath, IJavaScriptProject) + * + */ + public static final int ATTRIBUTE_NOT_SUPPORTED = 1; + + /** + * Status code indicating that an attribute is not modifiable. + * + * @see #getAccessRulesStatus(IPath, IJavaScriptProject) + * @see #getAttributeStatus(IPath, IJavaScriptProject, String) + * @see #getSourceAttachmentStatus(IPath, IJavaScriptProject) + * + */ + public static final int ATTRIBUTE_READ_ONLY = 2; + + /** + * Creates a new includepath container initializer. + */ + public JsGlobalScopeContainerInitializer() { + // a includepath container initializer must have a public 0-argument constructor + } + + public void initialize(IPath containerPath, IJavaScriptProject project) throws CoreException { + JavaScriptCore.setJsGlobalScopeContainer(containerPath, new IJavaScriptProject[] { project }, new IJsGlobalScopeContainer[] { getContainer(containerPath, project) }, null); + } + + protected IJsGlobalScopeContainer getContainer(IPath containerPath, IJavaScriptProject project) { + return this; + } + /* (non-Javadoc) + * @see org.eclipse.wst.jsdt.core.IJsGlobalScopeContainerInitialzer#canUpdateJsGlobalScopeContainer(org.eclipse.core.runtime.IPath, org.eclipse.wst.jsdt.core.IJavaScriptProject) + */ + public boolean canUpdateJsGlobalScopeContainer(IPath containerPath, IJavaScriptProject project) { + if(project==null || containerPath==null) return true; + LibrarySuperType superType = project.getCommonSuperType(); + return superType!=null && superType.getRawContainerPath().equals(getPath()); + } + + /* (non-Javadoc) + * @see org.eclipse.wst.jsdt.core.IJsGlobalScopeContainerInitialzer#requestJsGlobalScopeContainerUpdate(org.eclipse.core.runtime.IPath, org.eclipse.wst.jsdt.core.IJavaScriptProject, org.eclipse.wst.jsdt.core.IJsGlobalScopeContainer) + */ + public void requestJsGlobalScopeContainerUpdate(IPath containerPath, IJavaScriptProject project, IJsGlobalScopeContainer containerSuggestion) throws CoreException { + + // By default, includepath container initializers do not accept updating containers + } + + /* (non-Javadoc) + * @see org.eclipse.wst.jsdt.core.IJsGlobalScopeContainerInitialzer#getDescription(org.eclipse.core.runtime.IPath, org.eclipse.wst.jsdt.core.IJavaScriptProject) + */ + public String getDescription(IPath containerPath, IJavaScriptProject project) { + + // By default, a container path is the only available description + return containerPath.makeRelative().toString(); + } + + /* (non-Javadoc) + * @see org.eclipse.wst.jsdt.core.IJsGlobalScopeContainerInitialzer#getFailureContainer(org.eclipse.core.runtime.IPath, org.eclipse.wst.jsdt.core.IJavaScriptProject) + */ + public IJsGlobalScopeContainer getFailureContainer(final IPath containerPath, IJavaScriptProject project) { + final String description = getDescription(containerPath, project); + return + new IJsGlobalScopeContainer() { + public IIncludePathEntry[] getIncludepathEntries() { + return new IIncludePathEntry[0]; + } + public String getDescription() { + return description; + } + public int getKind() { + return 0; + } + public IPath getPath() { + return containerPath; + } + public String toString() { + return getDescription(); + } + public String[] resolvedLibraryImport(String a) { + return new String[] {a}; + } + }; + } + + /* (non-Javadoc) + * @see org.eclipse.wst.jsdt.core.IJsGlobalScopeContainerInitialzer#getComparisonID(org.eclipse.core.runtime.IPath, org.eclipse.wst.jsdt.core.IJavaScriptProject) + */ + public Object getComparisonID(IPath containerPath, IJavaScriptProject project) { + + // By default, containers are identical if they have the same containerPath first segment, + // but this may be refined by other container initializer implementations. + if (containerPath == null) { + return null; + } else { + return containerPath.segment(0); + } + } + + /* (non-Javadoc) + * @see org.eclipse.wst.jsdt.core.IJsGlobalScopeContainerInitialzer#getHostPath(org.eclipse.core.runtime.IPath, org.eclipse.wst.jsdt.core.IJavaScriptProject) + */ + public URI getHostPath(IPath path, IJavaScriptProject project) { + return null; + } + + public boolean allowAttachJsDoc() { return true; } + /* + * returns a String of all SuperTypes provided by this library. + */ + public String[] containerSuperTypes() {return new String[0];} + + /* Return a string of imports to replace the real imports for. necisary for toolkits and other t + * things that may have a certain import best for runtime but not best for building a model + * + */ + public String[] resolvedLibraryImport(String realImport) { + return new String[] {realImport}; + } + + public IIncludePathEntry[] getIncludepathEntries() { + LibraryLocation libLocation = getLibraryLocation(); + char[][] filesInLibs = libLocation.getLibraryFileNames(); + IIncludePathEntry[] entries = new IIncludePathEntry[filesInLibs.length]; + for (int i = 0; i < entries.length; i++) { + IPath workingLibPath = new Path(libLocation.getLibraryPath(filesInLibs[i])); + entries[i] = JavaScriptCore.newLibraryEntry(workingLibPath.makeAbsolute(), null, null, new IAccessRule[0], new IIncludePathAttribute[0], true); + } + return entries; + } + + public String getDescription() { + return null; + } + + public int getKind() { + + return K_APPLICATION; + } + + public IPath getPath() { + + return null; + } + /** + * Returns the access rules attribute status according to this initializer. + *

+ * The returned {@link IStatus status} can have one of the following severities: + *

    + *
  • {@link IStatus#OK OK}: means that the attribute is supported + * and is modifiable
  • + *
  • {@link IStatus#ERROR ERROR}: means that either the attribute + * is not supported or is not modifiable.
    + * In this case, the {@link IStatus#getCode() code}will have + * respectively the {@link #ATTRIBUTE_NOT_SUPPORTED} value + * or the {@link #ATTRIBUTE_READ_ONLY} value.
  • + *
+ *

+ * The status message can contain more information. + *

+ * If the subclass does not override this method, then the default behavior is + * to return {@link IStatus#OK OK} if and only if the includepath container can + * be updated (see {@link #canUpdateJsGlobalScopeContainer(IPath, IJavaScriptProject)}). + *

+ * + * @param containerPath the path of the container which requires to be + * updated + * @param project the project for which the container is to be updated + * @return returns the access rules attribute status + * + */ + public IStatus getAccessRulesStatus(IPath containerPath, IJavaScriptProject project) { + + if (canUpdateJsGlobalScopeContainer(containerPath, project)) { + return Status.OK_STATUS; + } + return new JavaModelStatus(ATTRIBUTE_READ_ONLY); + } + + /** + * Returns the extra attribute status according to this initializer. + *

+ * The returned {@link IStatus status} can have one of the following severities: + *

    + *
  • {@link IStatus#OK OK}: means that the attribute is supported + * and is modifiable
  • + *
  • {@link IStatus#ERROR ERROR}: means that either the attribute + * is not supported or is not modifiable.
    + * In this case, the {@link IStatus#getCode() code}will have + * respectively the {@link #ATTRIBUTE_NOT_SUPPORTED} value + * or the {@link #ATTRIBUTE_READ_ONLY} value.
  • + *
+ *

+ * The status message can contain more information. + *

+ * If the subclass does not override this method, then the default behavior is + * to return {@link IStatus#OK OK} if and only if the includepath container can + * be updated (see {@link #canUpdateJsGlobalScopeContainer(IPath, IJavaScriptProject)}). + *

+ * + * @param containerPath the path of the container which requires to be + * updated + * @param project the project for which the container is to be updated + * @param attributeKey the key of the extra attribute + * @return returns the extra attribute status + * @see IIncludePathAttribute + */ + public IStatus getAttributeStatus(IPath containerPath, IJavaScriptProject project, String attributeKey) { + + if (canUpdateJsGlobalScopeContainer(containerPath, project)) { + return Status.OK_STATUS; + } + return new JavaModelStatus(ATTRIBUTE_READ_ONLY); + } + + /** + * Returns the source attachment attribute status according to this initializer. + *

+ * The returned {@link IStatus status} can have one of the following severities: + *

    + *
  • {@link IStatus#OK OK}: means that the attribute is supported + * and is modifiable
  • + *
  • {@link IStatus#ERROR ERROR}: means that either the attribute + * is not supported or is not modifiable.
    + * In this case, the {@link IStatus#getCode() code}will have + * respectively the {@link #ATTRIBUTE_NOT_SUPPORTED} value + * or the {@link #ATTRIBUTE_READ_ONLY} value.
  • + *
+ *

+ * The status message can contain more information. + *

+ * If the subclass does not override this method, then the default behavior is + * to return {@link IStatus#OK OK} if and only if the includepath container can + * be updated (see {@link #canUpdateJsGlobalScopeContainer(IPath, IJavaScriptProject)}). + *

+ * + * @param containerPath the path of the container which requires to be + * updated + * @param project the project for which the container is to be updated + * @return returns the source attachment attribute status + */ + public IStatus getSourceAttachmentStatus(IPath containerPath, IJavaScriptProject project) { + + if (canUpdateJsGlobalScopeContainer(containerPath, project)) { + return Status.OK_STATUS; + } + return new JavaModelStatus(ATTRIBUTE_READ_ONLY); + } + + + /* (non-Javadoc) + * @see org.eclipse.wst.jsdt.core.IJsGlobalScopeContainerInitialzer#getInferenceID() + */ + public String getInferenceID() + { + return null; + } + + public void removeFromProject(IJavaScriptProject project) {} + +} + diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JsGlobalScopeVariableInitializer.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JsGlobalScopeVariableInitializer.java new file mode 100644 index 0000000..5d6540b --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JsGlobalScopeVariableInitializer.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core; + +/** + * Abstract base implementation of all includepath variable initializers. + * Includepath variable initializers are used in conjunction with the + * "org.eclipse.wst.jsdt.core.JsGlobalScopeVariableInitializer" extension point. + *

+ * Clients should subclass this class to implement a specific includepath + * variable initializer. The subclass must have a public 0-argument + * constructor and a concrete implementation of initialize. + * + * @see IIncludePathEntry + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public abstract class JsGlobalScopeVariableInitializer { + + /** + * Creates a new includepath variable initializer. + */ + public JsGlobalScopeVariableInitializer() { + // a includepath variable initializer must have a public 0-argument constructor + } + + /** + * Binds a value to the workspace includepath variable with the given name, + * or fails silently if this cannot be done. + *

+ * A variable initializer is automatically activated whenever a variable value + * is needed and none has been recorded so far. The implementation of + * the initializer can set the corresponding variable using + * JavaScriptCore#setClasspathVariable. + * + * @param variable the name of the workspace includepath variable + * that requires a binding + * + * @see JavaScriptCore#getIncludepathVariable(String) + * @see JavaScriptCore#setIncludepathVariable(String, org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IProgressMonitor) + * @see JavaScriptCore#setIncludepathVariables(String[], org.eclipse.core.runtime.IPath[], org.eclipse.core.runtime.IProgressMonitor) + */ + public abstract void initialize(String variable); +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/LibrarySuperType.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/LibrarySuperType.java new file mode 100644 index 0000000..67cc8e2 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/LibrarySuperType.java @@ -0,0 +1,196 @@ +/******************************************************************************* + * Copyright (c) 2005, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +/** + * + */ +package org.eclipse.wst.jsdt.core; + +import java.util.ArrayList; + +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; + + +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + * + */ +public class LibrarySuperType { + IPath cpEntry; + String superTypeName; + String libraryName; + IJavaScriptProject javaProject; + + public static final String SUPER_TYPE_CONTAINER= "org.eclipse.wst.jsdt.ui.superType.container"; //$NON-NLS-1$ + public static final String SUPER_TYPE_NAME= "org.eclipse.wst.jsdt.ui.superType.name"; //$NON-NLS-1$ + + /* Only one superTypeName per instance so enforce that */ + public LibrarySuperType(IPath classPathEntry, IJavaScriptProject project, String superTypeName) { + this.cpEntry = classPathEntry; + this.superTypeName = superTypeName; + this.javaProject = project; + this.libraryName = initLibraryName(); + + } + + public LibrarySuperType(String classPathEntry, IJavaScriptProject project, String superTypeName) { + this(new Path(classPathEntry),project,superTypeName); + } + /* Construct parent */ + public LibrarySuperType(IPath classPathEntry, IJavaScriptProject project) { + this(classPathEntry,project, null); + } + + public IPath getRawContainerPath() { + return cpEntry; + } + + public boolean hasChildren() { + /* defined super type meeans I'm a child */ + if(superTypeName!=null) return false; + JsGlobalScopeContainerInitializer init = getContainerInitializer(); + if (init == null) return false; + String[] availableSuperTypes = init.containerSuperTypes(); + return availableSuperTypes!=null && availableSuperTypes.length>0; + } + + public LibrarySuperType[] getChildren() { + if(superTypeName!=null) return new LibrarySuperType[0]; + return getFlatLibrarySuperTypes(cpEntry,javaProject); + } + + public LibrarySuperType getParent() { + if(superTypeName==null) return null; + return new LibrarySuperType(cpEntry,javaProject, null); + } + + public boolean isParent() { + return getParent()==null; + } + + public JsGlobalScopeContainerInitializer getContainerInitializer() { + return getContainerInitializer(cpEntry); + } + + public IIncludePathEntry[] getClasspathEntries() { + IJsGlobalScopeContainer container=null; + try { + container = JavaScriptCore.getJsGlobalScopeContainer(this.cpEntry, this.javaProject); + } catch (JavaScriptModelException ex) { + // TODO Auto-generated catch block + ex.printStackTrace(); + } + if(container!=null) return container.getIncludepathEntries(); + + return new IIncludePathEntry[0]; + } + + private static LibrarySuperType[] getFlatLibrarySuperTypes(IPath classPathEntry, IJavaScriptProject javaProject) { + JsGlobalScopeContainerInitializer init = getContainerInitializer(classPathEntry); + if (init == null) return new LibrarySuperType[0]; + String[] availableSuperTypes = init.containerSuperTypes(); + LibrarySuperType[] libSupers = new LibrarySuperType[availableSuperTypes.length]; + for (int i = 0; i < availableSuperTypes.length; i++) { + libSupers[i] = new LibrarySuperType(classPathEntry, javaProject, availableSuperTypes[i]); + } + return libSupers; + } + + public String getSuperTypeName() { + return superTypeName; + } + + public String getLibraryName() { + return libraryName; + } + + private String initLibraryName() { + JsGlobalScopeContainerInitializer init = getContainerInitializer(); + + /* parent node */ + if(superTypeName==null) { + if(init==null) { + return cpEntry.toString(); + } + return init.getDescription(); + } + Object parent = getParent(); + if(!(parent instanceof LibrarySuperType)) return null; + return ((LibrarySuperType)parent).getLibraryName(); + } + + public String toString() { + //JsGlobalScopeContainerInitializer init = getContainerInitializer(); + + /* parent node */ + if(isParent()) { + return getLibraryName(); + + } + + return Messages.getString("LibrarySuperType.0", new Object[]{superTypeName, getLibraryName()}); //$NON-NLS-1$ + } + + public boolean equals(Object o) { + if(!(o instanceof LibrarySuperType)) return false; + + LibrarySuperType other = (LibrarySuperType)o; + + + + if(other.cpEntry!=null && !other.cpEntry.equals(cpEntry)) { + return false; + } + + if((other.superTypeName==superTypeName)) { + return true; + } + + if(other.superTypeName!=null && superTypeName!=null) { + return other.superTypeName.equals(superTypeName); + } + + return false; + } + + public IPackageFragment[] getPackageFragments(){ + IIncludePathEntry[] entries = getClasspathEntries(); + ArrayList allFrags = new ArrayList(); + + try { + for(int i = 0;i + * The behavior of the methods is dependent of several JavaScriptCore options. + *

+ * The possible options are : + *

    + *
  • {@link JavaScriptCore#CODEASSIST_FIELD_PREFIXES} : Define the Prefixes for Field Name.
  • + *
  • {@link JavaScriptCore#CODEASSIST_STATIC_FIELD_PREFIXES} : Define the Prefixes for Static Field Name.
  • + *
  • {@link JavaScriptCore#CODEASSIST_LOCAL_PREFIXES} : Define the Prefixes for Local Variable Name.
  • + *
  • {@link JavaScriptCore#CODEASSIST_ARGUMENT_PREFIXES} : Define the Prefixes for Argument Name.
  • + *
  • {@link JavaScriptCore#CODEASSIST_FIELD_SUFFIXES} : Define the Suffixes for Field Name.
  • + *
  • {@link JavaScriptCore#CODEASSIST_STATIC_FIELD_SUFFIXES} : Define the Suffixes for Static Field Name.
  • + *
  • {@link JavaScriptCore#CODEASSIST_LOCAL_SUFFIXES} : Define the Suffixes for Local Variable Name.
  • + *
  • {@link JavaScriptCore#CODEASSIST_ARGUMENT_SUFFIXES} : Define the Suffixes for Argument Name.
  • + *
+ *

+ *

+ * For a complete description of the configurable options, see getDefaultOptions. + * For programmaticaly change these options, see JavaScriptCore#setOptions(). + *

+ *

+ * This class provides static methods and constants only; it is not intended to be + * instantiated or subclassed by clients. + *

+ * + * @see JavaScriptCore#setOptions(java.util.Hashtable) + * @see JavaScriptCore#getDefaultOptions() + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public final class NamingConventions { + private static final char[] GETTER_BOOL_NAME = "is".toCharArray(); //$NON-NLS-1$ + private static final char[] GETTER_NAME = "get".toCharArray(); //$NON-NLS-1$ + private static final char[] SETTER_NAME = "set".toCharArray(); //$NON-NLS-1$ + + static class NamingRequestor implements INamingRequestor { + private final static int SIZE = 10; + + // for acceptNameWithPrefixAndSuffix + private char[][] firstPrefixAndFirstSuffixResults = new char[SIZE][]; + private int firstPrefixAndFirstSuffixResultsCount = 0; + private char[][] firstPrefixAndSuffixResults = new char[SIZE][]; + private int firstPrefixAndSuffixResultsCount = 0; + private char[][] prefixAndFirstSuffixResults = new char[SIZE][]; + private int prefixAndFirstSuffixResultsCount = 0; + private char[][] prefixAndSuffixResults = new char[SIZE][]; + private int prefixAndSuffixResultsCount = 0; + + // for acceptNameWithPrefix + private char[][] firstPrefixResults = new char[SIZE][]; + private int firstPrefixResultsCount = 0; + private char[][] prefixResults = new char[SIZE][]; + private int prefixResultsCount = 0; + + // for acceptNameWithSuffix + private char[][] firstSuffixResults = new char[SIZE][]; + private int firstSuffixResultsCount = 0; + private char[][] suffixResults = new char[SIZE][]; + private int suffixResultsCount = 0; + + // for acceptNameWithoutPrefixAndSuffix + private char[][] otherResults = new char[SIZE][]; + private int otherResultsCount = 0; + public void acceptNameWithPrefixAndSuffix(char[] name, boolean isFirstPrefix, boolean isFirstSuffix, int reusedCharacters) { + if(isFirstPrefix && isFirstSuffix) { + int length = this.firstPrefixAndFirstSuffixResults.length; + if(length == this.firstPrefixAndFirstSuffixResultsCount) { + System.arraycopy( + this.firstPrefixAndFirstSuffixResults, + 0, + this.firstPrefixAndFirstSuffixResults = new char[length * 2][], + 0, + length); + } + this.firstPrefixAndFirstSuffixResults[this.firstPrefixAndFirstSuffixResultsCount++] = name; + } else if (isFirstPrefix) { + int length = this.firstPrefixAndSuffixResults.length; + if(length == this.firstPrefixAndSuffixResultsCount) { + System.arraycopy( + this.firstPrefixAndSuffixResults, + 0, + this.firstPrefixAndSuffixResults = new char[length * 2][], + 0, + length); + } + this.firstPrefixAndSuffixResults[this.firstPrefixAndSuffixResultsCount++] = name; + } else if(isFirstSuffix) { + int length = this.prefixAndFirstSuffixResults.length; + if(length == this.prefixAndFirstSuffixResultsCount) { + System.arraycopy( + this.prefixAndFirstSuffixResults, + 0, + this.prefixAndFirstSuffixResults = new char[length * 2][], + 0, + length); + } + this.prefixAndFirstSuffixResults[this.prefixAndFirstSuffixResultsCount++] = name; + } else { + int length = this.prefixAndSuffixResults.length; + if(length == this.prefixAndSuffixResultsCount) { + System.arraycopy( + this.prefixAndSuffixResults, + 0, + this.prefixAndSuffixResults = new char[length * 2][], + 0, + length); + } + this.prefixAndSuffixResults[this.prefixAndSuffixResultsCount++] = name; + } + } + + public void acceptNameWithPrefix(char[] name, boolean isFirstPrefix, int reusedCharacters) { + if(isFirstPrefix) { + int length = this.firstPrefixResults.length; + if(length == this.firstPrefixResultsCount) { + System.arraycopy( + this.firstPrefixResults, + 0, + this.firstPrefixResults = new char[length * 2][], + 0, + length); + } + this.firstPrefixResults[this.firstPrefixResultsCount++] = name; + } else{ + int length = this.prefixResults.length; + if(length == this.prefixResultsCount) { + System.arraycopy( + this.prefixResults, + 0, + this.prefixResults = new char[length * 2][], + 0, + length); + } + this.prefixResults[this.prefixResultsCount++] = name; + } + } + + public void acceptNameWithSuffix(char[] name, boolean isFirstSuffix, int reusedCharacters) { + if(isFirstSuffix) { + int length = this.firstSuffixResults.length; + if(length == this.firstSuffixResultsCount) { + System.arraycopy( + this.firstSuffixResults, + 0, + this.firstSuffixResults = new char[length * 2][], + 0, + length); + } + this.firstSuffixResults[this.firstSuffixResultsCount++] = name; + } else { + int length = this.suffixResults.length; + if(length == this.suffixResultsCount) { + System.arraycopy( + this.suffixResults, + 0, + this.suffixResults = new char[length * 2][], + 0, + length); + } + this.suffixResults[this.suffixResultsCount++] = name; + } + } + + public void acceptNameWithoutPrefixAndSuffix(char[] name, int reusedCharacters) { + int length = this.otherResults.length; + if(length == this.otherResultsCount) { + System.arraycopy( + this.otherResults, + 0, + this.otherResults = new char[length * 2][], + 0, + length); + } + this.otherResults[this.otherResultsCount++] = name; + } + public char[][] getResults(){ + int count = + this.firstPrefixAndFirstSuffixResultsCount + + this.firstPrefixAndSuffixResultsCount + + this.prefixAndFirstSuffixResultsCount + + this.prefixAndSuffixResultsCount + + this.firstPrefixResultsCount + + this.prefixResultsCount + + this.firstSuffixResultsCount + + this.suffixResultsCount + + this.otherResultsCount; + + char[][] results = new char[count][]; + + int index = 0; + System.arraycopy(this.firstPrefixAndFirstSuffixResults, 0, results, index, this.firstPrefixAndFirstSuffixResultsCount); + index += this.firstPrefixAndFirstSuffixResultsCount; + System.arraycopy(this.firstPrefixAndSuffixResults, 0, results, index, this.firstPrefixAndSuffixResultsCount); + index += this.firstPrefixAndSuffixResultsCount; + System.arraycopy(this.prefixAndFirstSuffixResults, 0, results, index, this.prefixAndFirstSuffixResultsCount); + index += this.prefixAndFirstSuffixResultsCount; + System.arraycopy(this.prefixAndSuffixResults, 0, results, index, this.prefixAndSuffixResultsCount); + index += this.prefixAndSuffixResultsCount; + System.arraycopy(this.firstPrefixResults, 0, results, index, this.firstPrefixResultsCount); + index += this.firstPrefixResultsCount; + System.arraycopy(this.prefixResults, 0, results, index, this.prefixResultsCount); + index += this.prefixResultsCount; + System.arraycopy(this.firstSuffixResults, 0, results, index, this.firstSuffixResultsCount); + index += this.firstSuffixResultsCount; + System.arraycopy(this.suffixResults, 0, results, index, this.suffixResultsCount); + index += this.suffixResultsCount; + System.arraycopy(this.otherResults, 0, results, index, this.otherResultsCount); + + return results; + } + } + + + private NamingConventions() { + // Not instantiable + } + + private static char[] removePrefixAndSuffix(char[] name, char[][] prefixes, char[][] suffixes) { + // remove longer prefix + char[] withoutPrefixName = name; + if (prefixes != null) { + int bestLength = 0; + for (int i= 0; i < prefixes.length; i++) { + char[] prefix = prefixes[i]; + if (CharOperation.prefixEquals(prefix, name)) { + int currLen = prefix.length; + boolean lastCharIsLetter = ScannerHelper.isLetter(prefix[currLen - 1]); + if(!lastCharIsLetter || (lastCharIsLetter && name.length > currLen && ScannerHelper.isUpperCase(name[currLen]))) { + if (bestLength < currLen && name.length != currLen) { + withoutPrefixName = CharOperation.subarray(name, currLen, name.length); + bestLength = currLen; + } + } + } + } + } + + // remove longer suffix + char[] withoutSuffixName = withoutPrefixName; + if(suffixes != null) { + int bestLength = 0; + for (int i = 0; i < suffixes.length; i++) { + char[] suffix = suffixes[i]; + if(CharOperation.endsWith(withoutPrefixName, suffix)) { + int currLen = suffix.length; + if(bestLength < currLen && withoutPrefixName.length != currLen) { + withoutSuffixName = CharOperation.subarray(withoutPrefixName, 0, withoutPrefixName.length - currLen); + bestLength = currLen; + } + } + } + } + + withoutSuffixName[0] = ScannerHelper.toLowerCase(withoutSuffixName[0]); + return withoutSuffixName; + } + + /** + * Remove prefix and suffix from an argument name. + *

+ * If argument name prefix is pre and argument name suffix is suf + * then for an argument named preArgsuf the result of this method is arg. + * If there is no prefix or suffix defined in JavaScriptCore options the result is the unchanged + * name preArgsuf. + *

+ *

+ * This method is affected by the following JavaScriptCore options : {@link JavaScriptCore#CODEASSIST_ARGUMENT_PREFIXES} and + * {@link JavaScriptCore#CODEASSIST_ARGUMENT_SUFFIXES}. + *

+ *

+ * For a complete description of these configurable options, see getDefaultOptions. + * For programmaticaly change these options, see JavaScriptCore#setOptions(). + *

+ * + * @param javaProject project which contains the argument. + * @param argumentName argument's name. + * @return char[] the name without prefix and suffix. + * @see JavaScriptCore#setOptions(java.util.Hashtable) + * @see JavaScriptCore#getDefaultOptions() + */ + public static char[] removePrefixAndSuffixForArgumentName(IJavaScriptProject javaProject, char[] argumentName) { + AssistOptions assistOptions = new AssistOptions(javaProject.getOptions(true)); + return removePrefixAndSuffix( + argumentName, + assistOptions.argumentPrefixes, + assistOptions.argumentSuffixes); + } + + /** + * Remove prefix and suffix from an argument name. + *

+ * If argument name prefix is pre and argument name suffix is suf + * then for an argument named preArgsuf the result of this method is arg. + * If there is no prefix or suffix defined in JavaScriptCore options the result is the unchanged + * name preArgsuf. + *

+ *

+ * This method is affected by the following JavaScriptCore options : {@link JavaScriptCore#CODEASSIST_ARGUMENT_PREFIXES} and + * {@link JavaScriptCore#CODEASSIST_ARGUMENT_SUFFIXES}. + *

+ *

+ * For a complete description of these configurable options, see getDefaultOptions. + * For programmaticaly change these options, see JavaScriptCore#setOptions(). + *

+ * + * @param javaProject project which contains the argument. + * @param argumentName argument's name. + * @return char[] the name without prefix and suffix. + * @see JavaScriptCore#setOptions(java.util.Hashtable) + * @see JavaScriptCore#getDefaultOptions() + */ + public static String removePrefixAndSuffixForArgumentName(IJavaScriptProject javaProject, String argumentName) { + return String.valueOf(removePrefixAndSuffixForArgumentName(javaProject, argumentName.toCharArray())); + } + + /** + * Remove prefix and suffix from a field name. + *

+ * If field name prefix is pre and field name suffix is suf + * then for a field named preFieldsuf the result of this method is field. + * If there is no prefix or suffix defined in JavaScriptCore options the result is the unchanged + * name preFieldsuf. + *

+ *

+ * This method is affected by the following JavaScriptCore options : {@link JavaScriptCore#CODEASSIST_FIELD_PREFIXES} } , + * {@link JavaScriptCore#CODEASSIST_FIELD_SUFFIXES} for instance field and {@link JavaScriptCore#CODEASSIST_STATIC_FIELD_PREFIXES}, + * {@link JavaScriptCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. + *

+ *

+ * For a complete description of these configurable options, see getDefaultOptions. + * For programmaticaly change these options, see JavaScriptCore#setOptions(). + *

+ * + * @param javaProject project which contains the field. + * @param fieldName field's name. + * @param modifiers field's modifiers as defined by the class + * Flags. + * @return char[] the name without prefix and suffix. + * @see Flags + * @see JavaScriptCore#setOptions(java.util.Hashtable) + * @see JavaScriptCore#getDefaultOptions() + */ + public static char[] removePrefixAndSuffixForFieldName(IJavaScriptProject javaProject, char[] fieldName, int modifiers) { + boolean isStatic = Flags.isStatic(modifiers); + AssistOptions assistOptions = new AssistOptions(javaProject.getOptions(true)); + return removePrefixAndSuffix( + fieldName, + isStatic ? assistOptions.staticFieldPrefixes : assistOptions.fieldPrefixes, + isStatic ? assistOptions.staticFieldSuffixes : assistOptions.fieldSuffixes); + } + + /** + * Remove prefix and suffix from a field name. + *

+ * If field name prefix is pre and field name suffix is suf + * then for a field named preFieldsuf the result of this method is field. + * If there is no prefix or suffix defined in JavaScriptCore options the result is the unchanged + * name preFieldsuf. + *

+ *

+ * This method is affected by the following JavaScriptCore options : {@link JavaScriptCore#CODEASSIST_FIELD_PREFIXES}, + * {@link JavaScriptCore#CODEASSIST_FIELD_SUFFIXES} for instance field and {@link JavaScriptCore#CODEASSIST_STATIC_FIELD_PREFIXES}, + * {@link JavaScriptCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. + *

+ *

+ * For a complete description of these configurable options, see getDefaultOptions. + * For programmaticaly change these options, see JavaScriptCore#setOptions(). + *

+ * + * @param javaProject project which contains the field. + * @param fieldName field's name. + * @param modifiers field's modifiers as defined by the class + * Flags. + * @return char[] the name without prefix and suffix. + * @see Flags + * @see JavaScriptCore#setOptions(java.util.Hashtable) + * @see JavaScriptCore#getDefaultOptions() + */ + public static String removePrefixAndSuffixForFieldName(IJavaScriptProject javaProject, String fieldName, int modifiers) { + return String.valueOf(removePrefixAndSuffixForFieldName(javaProject, fieldName.toCharArray(), modifiers)); + } + /** + * Remove prefix and suffix from a local variable name. + *

+ * If local variable name prefix is pre and local variable name suffix is suf + * then for a local variable named preLocalsuf the result of this method is local. + * If there is no prefix or suffix defined in JavaScriptCore options the result is the unchanged + * name preLocalsuf. + *

+ *

+ * This method is affected by the following JavaScriptCore options : {@link JavaScriptCore#CODEASSIST_LOCAL_PREFIXES} and + * {@link JavaScriptCore#CODEASSIST_LOCAL_SUFFIXES}. + *

+ *

+ * For a complete description of these configurable options, see getDefaultOptions. + * For programmaticaly change these options, see JavaScriptCore#setOptions(). + *

+ * + * @param javaProject project which contains the variable. + * @param localName variable's name. + * @return char[] the name without prefix and suffix. + * @see JavaScriptCore#setOptions(java.util.Hashtable) + * @see JavaScriptCore#getDefaultOptions() + */ + public static char[] removePrefixAndSuffixForLocalVariableName(IJavaScriptProject javaProject, char[] localName) { + AssistOptions assistOptions = new AssistOptions(javaProject.getOptions(true)); + return removePrefixAndSuffix( + localName, + assistOptions.localPrefixes, + assistOptions.localSuffixes); + } + + /** + * Remove prefix and suffix from a local variable name. + *

+ * If local variable name prefix is pre and local variable name suffix is suf + * then for a local variable named preLocalsuf the result of this method is local. + * If there is no prefix or suffix defined in JavaScriptCore options the result is the unchanged + * name preLocalsuf. + *

+ *

+ * This method is affected by the following JavaScriptCore options : {@link JavaScriptCore#CODEASSIST_LOCAL_PREFIXES} and + * {@link JavaScriptCore#CODEASSIST_LOCAL_SUFFIXES}. + *

+ *

+ * For a complete description of these configurable options, see getDefaultOptions. + * For programmaticaly change these options, see JavaScriptCore#setOptions(). + *

+ * + * @param javaProject project which contains the variable. + * @param localName variable's name. + * @return char[] the name without prefix and suffix. + * @see JavaScriptCore#setOptions(java.util.Hashtable) + * @see JavaScriptCore#getDefaultOptions() + */ + public static String removePrefixAndSuffixForLocalVariableName(IJavaScriptProject javaProject, String localName) { + return String.valueOf(removePrefixAndSuffixForLocalVariableName(javaProject, localName.toCharArray())); + } + + /** + * Suggest names for an argument. The name is computed from argument's type + * and possible prefixes or suffixes are added. + *

+ * If the type of the argument is TypeName, the prefix for argument is pre + * and the suffix for argument is suf then the proposed names are preTypeNamesuf + * and preNamesuf. If there is no prefix or suffix the proposals are typeName + * and name. + *

+ *

+ * This method is affected by the following JavaScriptCore options : {@link JavaScriptCore#CODEASSIST_ARGUMENT_PREFIXES} and + * {@link JavaScriptCore#CODEASSIST_ARGUMENT_SUFFIXES}. + *

+ *

+ * For a complete description of these configurable options, see getDefaultOptions. + * For programmaticaly change these options, see JavaScriptCore#setOptions(). + *

+ * + * @param javaProject project which contains the argument. + * @param packageName package of the argument's type. + * @param qualifiedTypeName argument's type. + * @param dim argument's dimension (0 if the argument is not an array). + * @param excludedNames a list of names which cannot be suggested (already used names). + * Can be null if there is no excluded names. + * @return char[][] an array of names. + * @see JavaScriptCore#setOptions(java.util.Hashtable) + * @see JavaScriptCore#getDefaultOptions() + */ + public static char[][] suggestArgumentNames(IJavaScriptProject javaProject, char[] packageName, char[] qualifiedTypeName, int dim, char[][] excludedNames) { + NamingRequestor requestor = new NamingRequestor(); + InternalNamingConventions.suggestArgumentNames( + javaProject, + packageName, + qualifiedTypeName, + dim, + null, + excludedNames, + requestor); + + return requestor.getResults(); + } + + /** + * Suggest names for an argument. The name is computed from argument's type + * and possible prefixes or suffixes are added. + *

+ * If the type of the argument is TypeName, the prefix for argument is pre + * and the suffix for argument is suf then the proposed names are preTypeNamesuf + * and preNamesuf. If there is no prefix or suffix the proposals are typeName + * and name. + *

+ *

+ * This method is affected by the following JavaScriptCore options : {@link JavaScriptCore#CODEASSIST_ARGUMENT_PREFIXES} and + * {@link JavaScriptCore#CODEASSIST_ARGUMENT_SUFFIXES}. + *

+ *

+ * For a complete description of these configurable options, see getDefaultOptions. + * For programmaticaly change these options, see JavaScriptCore#setOptions(). + *

+ * + * @param javaProject project which contains the argument. + * @param packageName package of the argument's type. + * @param qualifiedTypeName argument's type. + * @param dim argument's dimension (0 if the argument is not an array). + * @param excludedNames a list of names which cannot be suggested (already used names). + * Can be null if there is no excluded names. + * @return char[][] an array of names. + * @see JavaScriptCore#setOptions(java.util.Hashtable) + * @see JavaScriptCore#getDefaultOptions() + */ + public static String[] suggestArgumentNames(IJavaScriptProject javaProject, String packageName, String qualifiedTypeName, int dim, String[] excludedNames) { + return convertCharsToString( + suggestArgumentNames( + javaProject, + packageName!=null ? packageName.toCharArray() : null, + qualifiedTypeName!=null ? qualifiedTypeName.toCharArray():null, + dim, + convertStringToChars(excludedNames))); + } + /** + * Suggest names for a field. The name is computed from field's type + * and possible prefixes or suffixes are added. + *

+ * If the type of the field is TypeName, the prefix for field is pre + * and the suffix for field is suf then the proposed names are preTypeNamesuf + * and preNamesuf. If there is no prefix or suffix the proposals are typeName + * and name. + *

+ *

+ * This method is affected by the following JavaScriptCore options : {@link JavaScriptCore#CODEASSIST_FIELD_PREFIXES}, + * {@link JavaScriptCore#CODEASSIST_FIELD_SUFFIXES} and for instance field and {@link JavaScriptCore#CODEASSIST_STATIC_FIELD_PREFIXES}, + * {@link JavaScriptCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. + *

+ *

+ * For a complete description of these configurable options, see getDefaultOptions. + * For programmaticaly change these options, see JavaScriptCore#setOptions(). + *

+ * + * @param javaProject project which contains the field. + * @param packageName package of the field's type. + * @param qualifiedTypeName field's type. + * @param dim field's dimension (0 if the field is not an array). + * @param modifiers field's modifiers as defined by the class + * Flags. + * @param excludedNames a list of names which cannot be suggested (already used names). + * Can be null if there is no excluded names. + * @return char[][] an array of names. + * @see Flags + * @see JavaScriptCore#setOptions(java.util.Hashtable) + * @see JavaScriptCore#getDefaultOptions() + */ + public static char[][] suggestFieldNames(IJavaScriptProject javaProject, char[] packageName, char[] qualifiedTypeName, int dim, int modifiers, char[][] excludedNames) { + NamingRequestor requestor = new NamingRequestor(); + InternalNamingConventions.suggestFieldNames( + javaProject, + packageName, + qualifiedTypeName, + dim, + modifiers, + null, + excludedNames, + requestor); + + return requestor.getResults(); + } + + /** + * Suggest names for a field. The name is computed from field's type + * and possible prefixes or suffixes are added. + *

+ * If the type of the field is TypeName, the prefix for field is pre + * and the suffix for field is suf then the proposed names are preTypeNamesuf + * and preNamesuf. If there is no prefix or suffix the proposals are typeName + * and name. + *

+ *

+ * This method is affected by the following JavaScriptCore options : {@link JavaScriptCore#CODEASSIST_FIELD_PREFIXES}, + * {@link JavaScriptCore#CODEASSIST_FIELD_SUFFIXES} and for instance field and {@link JavaScriptCore#CODEASSIST_STATIC_FIELD_PREFIXES}, + * {@link JavaScriptCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. + *

+ *

+ * For a complete description of these configurable options, see getDefaultOptions. + * For programmaticaly change these options, see JavaScriptCore#setOptions(). + *

+ * + * @param javaProject project which contains the field. + * @param packageName package of the field's type. + * @param qualifiedTypeName field's type. + * @param dim field's dimension (0 if the field is not an array). + * @param modifiers field's modifiers as defined by the class + * Flags. + * @param excludedNames a list of names which cannot be suggested (already used names). + * Can be null if there is no excluded names. + * @return char[][] an array of names. + * @see Flags + * @see JavaScriptCore#setOptions(java.util.Hashtable) + * @see JavaScriptCore#getDefaultOptions() + */ + public static String[] suggestFieldNames(IJavaScriptProject javaProject, String packageName, String qualifiedTypeName, int dim, int modifiers, String[] excludedNames) { + return convertCharsToString( + suggestFieldNames( + javaProject, + packageName.toCharArray(), + qualifiedTypeName.toCharArray(), + dim, + modifiers, + convertStringToChars(excludedNames))); + } + + /** + * Suggest names for a local variable. The name is computed from variable's type + * and possible prefixes or suffixes are added. + *

+ * If the type of the local variable is TypeName, the prefix for local variable is pre + * and the suffix for local variable is suf then the proposed names are preTypeNamesuf + * and preNamesuf. If there is no prefix or suffix the proposals are typeName + * and name. + *

+ *

+ * This method is affected by the following JavaScriptCore options : {@link JavaScriptCore#CODEASSIST_LOCAL_PREFIXES} and + * {@link JavaScriptCore#CODEASSIST_LOCAL_SUFFIXES}. + *

+ *

+ * For a complete description of these configurable options, see getDefaultOptions. + * For programmaticaly change these options, see JavaScriptCore#setOptions(). + *

+ * + * @param javaProject project which contains the variable. + * @param packageName package of the variable's type. + * @param qualifiedTypeName variable's type. + * @param dim variable's dimension (0 if the variable is not an array). + * @param excludedNames a list of names which cannot be suggested (already used names). + * Can be null if there is no excluded names. + * @return char[][] an array of names. + * @see JavaScriptCore#setOptions(java.util.Hashtable) + * @see JavaScriptCore#getDefaultOptions() + */ + public static char[][] suggestLocalVariableNames(IJavaScriptProject javaProject, char[] packageName, char[] qualifiedTypeName, int dim, char[][] excludedNames) { + NamingRequestor requestor = new NamingRequestor(); + InternalNamingConventions.suggestLocalVariableNames( + javaProject, + packageName, + qualifiedTypeName, + dim, + null, + excludedNames, + requestor); + + return requestor.getResults(); + } + + /** + * Suggest names for a local variable. The name is computed from variable's type + * and possible prefixes or suffixes are added. + *

+ * If the type of the local variable is TypeName, the prefix for local variable is pre + * and the suffix for local variable is suf then the proposed names are preTypeNamesuf + * and preNamesuf. If there is no prefix or suffix the proposals are typeName + * and name. + *

+ *

+ * This method is affected by the following JavaScriptCore options : {@link JavaScriptCore#CODEASSIST_LOCAL_PREFIXES} and + * {@link JavaScriptCore#CODEASSIST_LOCAL_SUFFIXES}. + *

+ *

+ * For a complete description of these configurable options, see getDefaultOptions. + * For programmaticaly change these options, see JavaScriptCore#setOptions(). + *

+ * + * @param javaProject project which contains the variable. + * @param packageName package of the variable's type. + * @param qualifiedTypeName variable's type. + * @param dim variable's dimension (0 if the variable is not an array). + * @param excludedNames a list of names which cannot be suggested (already used names). + * Can be null if there is no excluded names. + * @return char[][] an array of names. + * @see JavaScriptCore#setOptions(java.util.Hashtable) + * @see JavaScriptCore#getDefaultOptions() + */ + public static String[] suggestLocalVariableNames(IJavaScriptProject javaProject, String packageName, String qualifiedTypeName, int dim, String[] excludedNames) { + return convertCharsToString( + suggestLocalVariableNames( + javaProject, + packageName.toCharArray(), + qualifiedTypeName.toCharArray(), + dim, + convertStringToChars(excludedNames))); + } + + /** + * Suggest name for a getter method. The name is computed from field's name + * and possible prefixes or suffixes are removed. + *

+ * If the field name is preFieldNamesuf and the prefix for field is pre and + * the suffix for field is suf then the prosposed name is isFieldName for boolean field or + * getFieldName for others. If there is no prefix and suffix the proposal is isPreFieldNamesuf + * for boolean field or getPreFieldNamesuf for others. + *

+ *

+ * This method is affected by the following JavaScriptCore options : {@link JavaScriptCore#CODEASSIST_FIELD_PREFIXES}, + * {@link JavaScriptCore#CODEASSIST_FIELD_SUFFIXES} for instance field and {@link JavaScriptCore#CODEASSIST_STATIC_FIELD_PREFIXES}, + * {@link JavaScriptCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. + *

+ *

+ * For a complete description of these configurable options, see getDefaultOptions. + * For programmaticaly change these options, see JavaScriptCore#setOptions(). + *

+ * + * @param project project which contains the field. + * @param fieldName field's name's. + * @param modifiers field's modifiers as defined by the class + * Flags. + * @param isBoolean true if the field's type is boolean + * @param excludedNames a list of names which cannot be suggested (already used names). + * Can be null if there is no excluded names. + * @return char[] a name. + * @see Flags + * @see JavaScriptCore#setOptions(java.util.Hashtable) + * @see JavaScriptCore#getDefaultOptions() + */ + public static char[] suggestGetterName(IJavaScriptProject project, char[] fieldName, int modifiers, boolean isBoolean, char[][] excludedNames) { + if (isBoolean) { + char[] name = removePrefixAndSuffixForFieldName(project, fieldName, modifiers); + int prefixLen = GETTER_BOOL_NAME.length; + if (CharOperation.prefixEquals(GETTER_BOOL_NAME, name) + && name.length > prefixLen && ScannerHelper.isUpperCase(name[prefixLen])) { + return suggestNewName(name, excludedNames); + } else { + return suggestNewName( + CharOperation.concat(GETTER_BOOL_NAME, suggestAccessorName(project, fieldName, modifiers)), + excludedNames + ); + } + } else { + return suggestNewName( + CharOperation.concat(GETTER_NAME, suggestAccessorName(project, fieldName, modifiers)), + excludedNames + ); + } + } + + /** + * Suggest name for a getter method. The name is computed from field's name + * and possible prefixes or suffixes are removed. + *

+ * If the field name is preFieldNamesuf and the prefix for field is pre and + * the suffix for field is suf then the prosposed name is isFieldName for boolean field or + * getFieldName for others. If there is no prefix and suffix the proposal is isPreFieldNamesuf + * for boolean field or getPreFieldNamesuf for others. + *

+ *

+ * This method is affected by the following JavaScriptCore options : {@link JavaScriptCore#CODEASSIST_FIELD_PREFIXES}, + * {@link JavaScriptCore#CODEASSIST_FIELD_SUFFIXES} for instance field and {@link JavaScriptCore#CODEASSIST_STATIC_FIELD_PREFIXES}, + * {@link JavaScriptCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. + *

+ *

+ * For a complete description of these configurable options, see getDefaultOptions. + * For programmaticaly change these options, see JavaScriptCore#setOptions(). + *

+ * + * @param project project which contains the field. + * @param fieldName field's name's. + * @param modifiers field's modifiers as defined by the class + * Flags. + * @param isBoolean true if the field's type is boolean + * @param excludedNames a list of names which cannot be suggested (already used names). + * Can be null if there is no excluded names. + * @return char[] a name. + * @see Flags + * @see JavaScriptCore#setOptions(java.util.Hashtable) + * @see JavaScriptCore#getDefaultOptions() + */ + public static String suggestGetterName(IJavaScriptProject project, String fieldName, int modifiers, boolean isBoolean, String[] excludedNames) { + return String.valueOf( + suggestGetterName( + project, + fieldName.toCharArray(), + modifiers, + isBoolean, + convertStringToChars(excludedNames))); + } + + /** + * Suggest name for a setter method. The name is computed from field's name + * and possible prefixes or suffixes are removed. + *

+ * If the field name is preFieldNamesuf and the prefix for field is pre and + * the suffix for field is suf then the proposed name is setFieldName. + * If there is no prefix and suffix the proposal is setPreFieldNamesuf. + *

+ *

+ * This method is affected by the following JavaScriptCore options : {@link JavaScriptCore#CODEASSIST_FIELD_PREFIXES}, + * {@link JavaScriptCore#CODEASSIST_FIELD_SUFFIXES} for instance field and {@link JavaScriptCore#CODEASSIST_STATIC_FIELD_PREFIXES}, + * {@link JavaScriptCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. + *

+ *

+ * For a complete description of these configurable options, see getDefaultOptions. + * For programmaticaly change these options, see JavaScriptCore#setOptions(). + *

+ * + * @param project project which contains the field. + * @param fieldName field's name's. + * @param modifiers field's modifiers as defined by the class + * Flags. + * @param isBoolean true if the field's type is boolean + * @param excludedNames a list of names which cannot be suggested (already used names). + * Can be null if there is no excluded names. + * @return char[] a name. + * @see Flags + * @see JavaScriptCore#setOptions(java.util.Hashtable) + * @see JavaScriptCore#getDefaultOptions() + */ + public static char[] suggestSetterName(IJavaScriptProject project, char[] fieldName, int modifiers, boolean isBoolean, char[][] excludedNames) { + + if (isBoolean) { + char[] name = removePrefixAndSuffixForFieldName(project, fieldName, modifiers); + int prefixLen = GETTER_BOOL_NAME.length; + if (CharOperation.prefixEquals(GETTER_BOOL_NAME, name) + && name.length > prefixLen && ScannerHelper.isUpperCase(name[prefixLen])) { + name = CharOperation.subarray(name, prefixLen, name.length); + return suggestNewName( + CharOperation.concat(SETTER_NAME, suggestAccessorName(project, name, modifiers)), + excludedNames + ); + } else { + return suggestNewName( + CharOperation.concat(SETTER_NAME, suggestAccessorName(project, fieldName, modifiers)), + excludedNames + ); + } + } else { + return suggestNewName( + CharOperation.concat(SETTER_NAME, suggestAccessorName(project, fieldName, modifiers)), + excludedNames + ); + } + } + + /** + * Suggest name for a setter method. The name is computed from field's name + * and possible prefixes or suffixes are removed. + *

+ * If the field name is preFieldNamesuf and the prefix for field is pre and + * the suffix for field is suf then the proposed name is setFieldName. + * If there is no prefix and suffix the proposal is setPreFieldNamesuf. + *

+ *

+ * This method is affected by the following JavaScriptCore options : {@link JavaScriptCore#CODEASSIST_FIELD_PREFIXES}, + * {@link JavaScriptCore#CODEASSIST_FIELD_SUFFIXES} for instance field and {@link JavaScriptCore#CODEASSIST_STATIC_FIELD_PREFIXES}, + * {@link JavaScriptCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. + *

+ *

+ * For a complete description of these configurable options, see getDefaultOptions. + * For programmaticaly change these options, see JavaScriptCore#setOptions(). + *

+ * + * @param project project which contains the field. + * @param fieldName field's name's. + * @param modifiers field's modifiers as defined by the class + * Flags. + * @param isBoolean true if the field's type is boolean + * @param excludedNames a list of names which cannot be suggested (already used names). + * Can be null if there is no excluded names. + * @return char[] a name. + * @see Flags + * @see JavaScriptCore#setOptions(java.util.Hashtable) + * @see JavaScriptCore#getDefaultOptions() + */ + public static String suggestSetterName(IJavaScriptProject project, String fieldName, int modifiers, boolean isBoolean, String[] excludedNames) { + return String.valueOf( + suggestSetterName( + project, + fieldName.toCharArray(), + modifiers, + isBoolean, + convertStringToChars(excludedNames))); + } + + private static char[] suggestAccessorName(IJavaScriptProject project, char[] fieldName, int modifiers) { + char[] name = removePrefixAndSuffixForFieldName(project, fieldName, modifiers); + if (name.length > 0 && ScannerHelper.isLowerCase(name[0])) { + name[0] = ScannerHelper.toUpperCase(name[0]); + } + return name; + } + + private static char[] suggestNewName(char[] name, char[][] excludedNames){ + if(excludedNames == null) { + return name; + } + + char[] newName = name; + int count = 2; + int i = 0; + while (i < excludedNames.length) { + if(CharOperation.equals(newName, excludedNames[i], false)) { + newName = CharOperation.concat(name, String.valueOf(count++).toCharArray()); + i = 0; + } else { + i++; + } + } + return newName; + } + + private static String[] convertCharsToString(char[][] c) { + int length = c == null ? 0 : c.length; + String[] s = new String[length]; + for (int i = 0; i < length; i++) { + s[i] = String.valueOf(c[i]); + } + return s; + } + + private static char[][] convertStringToChars(String[] s) { + int length = s == null ? 0 : s.length; + char[][] c = new char[length][]; + for (int i = 0; i < length; i++) { + if(s[i] == null) { + c[i] = CharOperation.NO_CHAR; + } else { + c[i] = s[i].toCharArray(); + } + } + return c; + } +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/Signature.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/Signature.java new file mode 100644 index 0000000..07c2dbb --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/Signature.java @@ -0,0 +1,1644 @@ +/******************************************************************************* + * Copyright (c) 2000, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * IBM Corporation - added J2SE 1.5 support + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.wst.jsdt.core.compiler.CharOperation; +import org.eclipse.wst.jsdt.internal.compiler.parser.ScannerHelper; +import org.eclipse.wst.jsdt.internal.core.util.Util; + + +/** + * Provides methods for encoding and decoding type and method signature strings. + *

+ * This class provides static methods and constants only; it is not intended to be + * instantiated or subclassed by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public final class Signature { + + /** + * Character constant indicating the semicolon in a signature. + * Value is ';'. + */ + public static final char C_SEMICOLON = ';'; + + /** + * Character constant indicating the colon in a signature. + * Value is ':'. + * 3.0 + */ + public static final char C_COLON = ':'; + + /** + * Character constant indicating result type void in a signature. + * Value is 'V'. + */ + public static final char C_VOID = 'V'; + + + /** + * Character constant indicating any type in a signature. + * Value is 'A'. + */ + public static final char C_ANY = 'A'; + + /** + * Character constant indicating the dot in a signature. + * Value is '.'. + */ + public static final char C_DOT = '.'; + + /** + * Character constant indicating the dollar in a signature. + * Value is '$'. + */ + public static final char C_DOLLAR = '$'; + + /** + * Character constant indicating an array type in a signature. + * Value is '['. + */ + public static final char C_ARRAY = '['; + + /** + * Character constant indicating the start of a resolved, named type in a + * signature. Value is 'L'. + */ + public static final char C_RESOLVED = 'L'; + + + /** + * Character constant indicating a compilation unit. + * Value is 'X'. + */ + public static final char C_COMPILATION_UNIT = 'X'; + + + /** + * Character constant indicating the start of an unresolved, named type in a + * signature. Value is 'Q'. + */ + public static final char C_UNRESOLVED = 'Q'; + + /** + * Character constant indicating the end of a named type in a signature. + * Value is ';'. + */ + public static final char C_NAME_END = ';'; + + /** + * Character constant indicating the start of a parameter type list in a + * signature. Value is '('. + */ + public static final char C_PARAM_START = '('; + + /** + * Character constant indicating the end of a parameter type list in a + * signature. Value is ')'. + */ + public static final char C_PARAM_END = ')'; + + /** String constant for the signature of result type void. + * Value is "V". + */ + public static final String SIG_VOID = "V"; //$NON-NLS-1$ + + public static final String SIG_ANY = "A"; //$NON-NLS-1$ + + public static final String SIG_COMPILATION_UNIT = "X"; //$NON-NLS-1$ + + /** + * Kind constant for a class type signature. + * @see #getTypeSignatureKind(String) + * + */ + public static final int CLASS_TYPE_SIGNATURE = 1; + + /** + * Kind constant for a base (primitive or void) type signature. + * @see #getTypeSignatureKind(String) + * + */ + public static final int BASE_TYPE_SIGNATURE = 2; + + /** + * Kind constant for an array type signature. + * @see #getTypeSignatureKind(String) + * + */ + public static final int ARRAY_TYPE_SIGNATURE = 4; + + private static final char[] VOID = "void".toCharArray(); //$NON-NLS-1$ + public static final char[] ANY = "any".toCharArray(); //$NON-NLS-1$ + +private Signature() { + // Not instantiable +} + +private static int checkName(char[] name, char[] typeName, int pos, int length) { + if (CharOperation.fragmentEquals(name, typeName, pos, true)) { + pos += name.length; + if (pos == length) return pos; + char currentChar = typeName[pos]; + switch (currentChar) { + case ' ' : + case '.' : + case '[' : + case ',' : + return pos; + default: + if (ScannerHelper.isWhitespace(currentChar)) + return pos; + + } + } + return -1; +} + +/** + * Creates a new type signature with the given amount of array nesting added + * to the given type signature. + * + * @param typeSignature the type signature + * @param arrayCount the desired number of levels of array nesting + * @return the encoded array type signature + * + * + */ +public static char[] createArraySignature(char[] typeSignature, int arrayCount) { + if (arrayCount == 0) return typeSignature; + int sigLength = typeSignature.length; + char[] result = new char[arrayCount + sigLength]; + for (int i = 0; i < arrayCount; i++) { + result[i] = C_ARRAY; + } + System.arraycopy(typeSignature, 0, result, arrayCount, sigLength); + return result; +} +/** + * Creates a new type signature with the given amount of array nesting added + * to the given type signature. + * + * @param typeSignature the type signature + * @param arrayCount the desired number of levels of array nesting + * @return the encoded array type signature + */ +public static String createArraySignature(String typeSignature, int arrayCount) { + return new String(createArraySignature(typeSignature.toCharArray(), arrayCount)); +} + +/** + * Creates a method signature from the given parameter and return type + * signatures. The encoded method signature is dot-based. + * + * @param parameterTypes the list of parameter type signatures + * @param returnType the return type signature + * @return the encoded method signature + * + * + */ +public static char[] createMethodSignature(char[][] parameterTypes, char[] returnType) { + int parameterTypesLength = parameterTypes.length; + int parameterLength = 0; + for (int i = 0; i < parameterTypesLength; i++) { + parameterLength += parameterTypes[i].length; + + } + int returnTypeLength = returnType.length; + char[] result = new char[1 + parameterLength + 1 + returnTypeLength]; + result[0] = C_PARAM_START; + int index = 1; + for (int i = 0; i < parameterTypesLength; i++) { + char[] parameterType = parameterTypes[i]; + int length = parameterType.length; + System.arraycopy(parameterType, 0, result, index, length); + index += length; + } + result[index] = C_PARAM_END; + System.arraycopy(returnType, 0, result, index+1, returnTypeLength); + return result; +} + +/** + * Creates a method signature from the given parameter and return type + * signatures. The encoded method signature is dot-based. This method + * is equivalent to + * createMethodSignature(parameterTypes, returnType). + * + * @param parameterTypes the list of parameter type signatures + * @param returnType the return type signature + * @return the encoded method signature + * @see Signature#createMethodSignature(char[][], char[]) + */ +public static String createMethodSignature(String[] parameterTypes, String returnType) { + int parameterTypesLenth = parameterTypes.length; + char[][] parameters = new char[parameterTypesLenth][]; + for (int i = 0; i < parameterTypesLenth; i++) { + parameters[i] = parameterTypes[i].toCharArray(); + } + return new String(createMethodSignature(parameters, returnType.toCharArray())); +} + +/** + * Creates a new type signature from the given type name encoded as a character + * array. The type name may contain primitive types, array types or parameterized types. + * This method is equivalent to + * createTypeSignature(new String(typeName),isResolved), although + * more efficient for callers with character arrays rather than strings. If the + * type name is qualified, then it is expected to be dot-based. + * + * @param typeName the possibly qualified type name + * @param isResolved true if the type name is to be considered + * resolved (for example, a type name from a binary class file), and + * false if the type name is to be considered unresolved + * (for example, a type name found in source code) + * @return the encoded type signature + * @see #createTypeSignature(java.lang.String,boolean) + */ +public static String createTypeSignature(char[] typeName, boolean isResolved) { + return new String(createCharArrayTypeSignature(typeName, isResolved)); +} + +/** + * Creates a new type signature from the given type name encoded as a character + * array. The type name may contain primitive types or array types or parameterized types. + * This method is equivalent to + * createTypeSignature(new String(typeName),isResolved).toCharArray(), + * although more efficient for callers with character arrays rather than strings. + * If the type name is qualified, then it is expected to be dot-based. + * + * @param typeName the possibly qualified type name + * @param isResolved true if the type name is to be considered + * resolved (for example, a type name from a binary class file), and + * false if the type name is to be considered unresolved + * (for example, a type name found in source code) + * @return the encoded type signature + * @see #createTypeSignature(java.lang.String,boolean) + * + * + */ +public static char[] createCharArrayTypeSignature(char[] typeName, boolean isResolved) { + if (typeName == null || typeName.length == 0) + { + return new char[]{C_ANY}; + } + + int length = typeName.length; + StringBuffer buffer = new StringBuffer(5); + int pos = encodeTypeSignature(typeName, 0, isResolved, length, buffer); + pos = consumeWhitespace(typeName, pos, length); + if (pos < length) throw new IllegalArgumentException(new String(typeName)); + char[] result = new char[length = buffer.length()]; + buffer.getChars(0, length, result, 0); + return result; +} +private static int consumeWhitespace(char[] typeName, int pos, int length) { + while (pos < length) { + char currentChar = typeName[pos]; + if (currentChar != ' ' && !CharOperation.isWhitespace(currentChar)) { + break; + } + pos++; + } + return pos; +} +private static int encodeQualifiedName(char[] typeName, int pos, int length, StringBuffer buffer) { + int count = 0; + char lastAppendedChar = 0; + nameLoop: while (pos < length) { + char currentChar = typeName[pos]; + switch (currentChar) { + case '[' : + case ',' : + break nameLoop; + case '.' : + buffer.append(C_DOT); + lastAppendedChar = C_DOT; + count++; + break; + default: + if (currentChar == ' ' || ScannerHelper.isWhitespace(currentChar)) { + if (lastAppendedChar == C_DOT) { // allow spaces after a dot + pos = consumeWhitespace(typeName, pos, length) - 1; // will be incremented + break; + } + // allow spaces before a dot + int checkPos = checkNextChar(typeName, '.', pos, length, true); + if (checkPos > 0) { + buffer.append(C_DOT); // process dot immediately to avoid one iteration + lastAppendedChar = C_DOT; + count++; + pos = checkPos; + break; + } + break nameLoop; + } + buffer.append(currentChar); + lastAppendedChar = currentChar; + count++; + break; + } + pos++; + } + if (count == 0) throw new IllegalArgumentException(new String(typeName)); + return pos; +} + +private static int encodeArrayDimension(char[] typeName, int pos, int length, StringBuffer buffer) { + int checkPos; + while (pos < length && (checkPos = checkNextChar(typeName, '[', pos, length, true)) > 0) { + pos = checkNextChar(typeName, ']', checkPos, length, false); + buffer.append(C_ARRAY); + } + return pos; +} +private static int checkArrayDimension(char[] typeName, int pos, int length) { + int genericBalance = 0; + while (pos < length) { + switch(typeName[pos]) { + case ',' : + if (genericBalance == 0) return -1; + break; + case '[': + if (genericBalance == 0) { + return pos; + } + } + pos++; + } + return -1; +} +private static int checkNextChar(char[] typeName, char expectedChar, int pos, int length, boolean isOptional) { + pos = consumeWhitespace(typeName, pos, length); + if (pos < length && typeName[pos] == expectedChar) + return pos + 1; + if (!isOptional) throw new IllegalArgumentException(new String(typeName)); + return -1; +} + +private static int encodeTypeSignature(char[] typeName, int start, boolean isResolved, int length, StringBuffer buffer) { + int pos = start; + pos = consumeWhitespace(typeName, pos, length); + if (pos >= length) throw new IllegalArgumentException(new String(typeName)); + int checkPos; + char currentChar = typeName[pos]; + switch (currentChar) { + // primitive type? + case 'v': + checkPos = checkName(VOID, typeName, pos, length); + if (checkPos > 0) { + pos = encodeArrayDimension(typeName, checkPos, length, buffer); + buffer.append(C_VOID); + return pos; + } + break; + } + // non primitive type + checkPos = checkArrayDimension(typeName, pos, length); + int end; + if (checkPos > 0) { + end = encodeArrayDimension(typeName, checkPos, length, buffer); + } else { + end = -1; + } + buffer.append(isResolved ? C_RESOLVED : C_UNRESOLVED); + while (true) { // loop on qualifiedName[][.qualifiedName[]* + pos = encodeQualifiedName(typeName, pos, length, buffer); + checkPos = checkNextChar(typeName, '.', pos, length, true); + if (checkPos > 0) { + buffer.append(C_DOT); + pos = checkPos; + } else { + break; + } + } + buffer.append(C_NAME_END); + if (end > 0) pos = end; // skip array dimension which were preprocessed + return pos; +} + +/** + * Creates a new type signature from the given type name. If the type name is qualified, + * then it is expected to be dot-based. The type name may contain primitive + * types or array types. However, parameterized types are not supported. + *

+ * For example: + *

+ * 
+ * createTypeSignature("int", hucairz) -> "I"
+ * createTypeSignature("java.lang.String", true) -> "Ljava.lang.String;"
+ * createTypeSignature("String", false) -> "QString;"
+ * createTypeSignature("java.lang.String", false) -> "Qjava.lang.String;"
+ * createTypeSignature("int []", false) -> "[I"
+ * 
+ * 
+ *

+ * + * @param typeName the possibly qualified type name + * @param isResolved true if the type name is to be considered + * resolved (for example, a type name from a binary class file), and + * false if the type name is to be considered unresolved + * (for example, a type name found in source code) + * @return the encoded type signature + */ +public static String createTypeSignature(String typeName, boolean isResolved) { + return createTypeSignature(typeName == null ? null : typeName.toCharArray(), isResolved); +} + +/** + * Returns the array count (array nesting depth) of the given type signature. + * + * @param typeSignature the type signature + * @return the array nesting depth, or 0 if not an array + * @exception IllegalArgumentException if the signature is not syntactically + * correct + * + * + */ +public static int getArrayCount(char[] typeSignature) throws IllegalArgumentException { + try { + int count = 0; + while (typeSignature[count] == C_ARRAY) { + ++count; + } + return count; + } catch (ArrayIndexOutOfBoundsException e) { // signature is syntactically incorrect if last character is C_ARRAY + throw new IllegalArgumentException(); + } +} +/** + * Returns the array count (array nesting depth) of the given type signature. + * + * @param typeSignature the type signature + * @return the array nesting depth, or 0 if not an array + * @exception IllegalArgumentException if the signature is not syntactically + * correct + */ +public static int getArrayCount(String typeSignature) throws IllegalArgumentException { + return getArrayCount(typeSignature.toCharArray()); +} +/** + * Returns the type signature without any array nesting. + *

+ * For example: + *

+ * 
+ * getElementType({'[', '[', 'I'}) --> {'I'}.
+ * 
+ * 
+ *

+ * + * @param typeSignature the type signature + * @return the type signature without arrays + * @exception IllegalArgumentException if the signature is not syntactically + * correct + * + * + */ +public static char[] getElementType(char[] typeSignature) throws IllegalArgumentException { + int count = getArrayCount(typeSignature); + if (count == 0) return typeSignature; + int length = typeSignature.length; + char[] result = new char[length-count]; + System.arraycopy(typeSignature, count, result, 0, length-count); + return result; +} +/** + * Returns the type signature without any array nesting. + *

+ * For example: + *

+ * 
+ * getElementType("[[I") --> "I".
+ * 
+ * 
+ *

+ * + * @param typeSignature the type signature + * @return the type signature without arrays + * @exception IllegalArgumentException if the signature is not syntactically + * correct + */ +public static String getElementType(String typeSignature) throws IllegalArgumentException { + return new String(getElementType(typeSignature.toCharArray())); +} +/** + * Returns the number of parameter types in the given method signature. + * + * @param methodSignature the method signature + * @return the number of parameters + * @exception IllegalArgumentException if the signature is not syntactically + * correct + * + */ +public static int getParameterCount(char[] methodSignature) throws IllegalArgumentException { + if (methodSignature==null) + return 0; + try { + int count = 0; + int i = CharOperation.indexOf(C_PARAM_START, methodSignature); + if (i < 0) { + throw new IllegalArgumentException(); + } else { + i++; + } + for (;;) { + if (methodSignature[i] == C_PARAM_END) { + return count; + } + int e= Util.scanTypeSignature(methodSignature, i); + if (e < 0) { + throw new IllegalArgumentException(); + } else { + i = e + 1; + } + count++; + } + } catch (ArrayIndexOutOfBoundsException e) { + throw new IllegalArgumentException(); + } +} + +/** + * Returns the kind of type signature encoded by the given string. + * + * @param typeSignature the type signature string + * @return the kind of type signature; one of the kind constants: + * {@link #ARRAY_TYPE_SIGNATURE}, {@link #CLASS_TYPE_SIGNATURE}, + * {@link #BASE_TYPE_SIGNATURE}, or {@link #TYPE_VARIABLE_SIGNATURE}, + * or {@link #CAPTURE_TYPE_SIGNATURE} + * @exception IllegalArgumentException if this is not a type signature + * + */ +public static int getTypeSignatureKind(char[] typeSignature) { + // need a minimum 1 char + if (typeSignature.length < 1) { + throw new IllegalArgumentException(); + } + char c = typeSignature[0]; + switch (c) { + case C_ARRAY : + return ARRAY_TYPE_SIGNATURE; + case C_RESOLVED : + case C_UNRESOLVED : + return CLASS_TYPE_SIGNATURE; + case C_VOID : + case C_ANY : + return BASE_TYPE_SIGNATURE; + default : + throw new IllegalArgumentException(); + } +} + +/** + * Returns the kind of type signature encoded by the given string. + * + * @param typeSignature the type signature string + * @return the kind of type signature; one of the kind constants: + * {@link #ARRAY_TYPE_SIGNATURE}, {@link #CLASS_TYPE_SIGNATURE}, + * {@link #BASE_TYPE_SIGNATURE}, or {@link #TYPE_VARIABLE_SIGNATURE}, + * or {@link #CAPTURE_TYPE_SIGNATURE} + * @exception IllegalArgumentException if this is not a type signature + * + */ +public static int getTypeSignatureKind(String typeSignature) { + if (typeSignature.length() < 1) { + // uknown return type + return BASE_TYPE_SIGNATURE; + } + char c = typeSignature.charAt(0); + switch (c) { + case C_ARRAY : + return ARRAY_TYPE_SIGNATURE; + case C_RESOLVED : + case C_UNRESOLVED : + return CLASS_TYPE_SIGNATURE; + case C_VOID : + case C_ANY : + + return BASE_TYPE_SIGNATURE; + default : + throw new IllegalArgumentException(); + } +} + +/** + * Returns the number of parameter types in the given method signature. + * + * @param methodSignature the method signature + * @return the number of parameters + * @exception IllegalArgumentException if the signature is not syntactically + * correct + */ +public static int getParameterCount(String methodSignature) throws IllegalArgumentException { + return getParameterCount(methodSignature.toCharArray()); +} + +/** + * Extracts the parameter type signatures from the given method signature. + * The method signature is expected to be dot-based. + * + * @param methodSignature the method signature + * @return the list of parameter type signatures + * @exception IllegalArgumentException if the signature is syntactically + * incorrect + * + * + */ +public static char[][] getParameterTypes(char[] methodSignature) throws IllegalArgumentException { + try { + int count = getParameterCount(methodSignature); + char[][] result = new char[count][]; + if (count == 0) { + return result; + } + int i = CharOperation.indexOf(C_PARAM_START, methodSignature); + if (i < 0) { + throw new IllegalArgumentException(); + } else { + i++; + } + int t = 0; + for (;;) { + if (methodSignature[i] == C_PARAM_END) { + return result; + } + int e = Util.scanTypeSignature(methodSignature, i); + if (e < 0) { + throw new IllegalArgumentException(); + } + result[t] = CharOperation.subarray(methodSignature, i, e + 1); + t++; + i = e + 1; + } + } catch (ArrayIndexOutOfBoundsException e) { + throw new IllegalArgumentException(); + } +} + +/** + * Extracts the parameter type signatures from the given method signature. + * The method signature is expected to be dot-based. + * + * @param methodSignature the method signature + * @return the list of parameter type signatures + * @exception IllegalArgumentException if the signature is syntactically + * incorrect + */ +public static String[] getParameterTypes(String methodSignature) throws IllegalArgumentException { + char[][] parameterTypes = getParameterTypes(methodSignature.toCharArray()); + return CharOperation.toStrings(parameterTypes); +} + +/** + * Extracts the type variable name from the given formal type parameter + * signature. The signature is expected to be dot-based. + * + * @param formalTypeParameterSignature the formal type parameter signature + * @return the name of the type variable + * @exception IllegalArgumentException if the signature is syntactically + * incorrect + * + */ +public static String getTypeVariable(String formalTypeParameterSignature) throws IllegalArgumentException { + return new String(getTypeVariable(formalTypeParameterSignature.toCharArray())); +} + +/** + * Extracts the type variable name from the given formal type parameter + * signature. The signature is expected to be dot-based. + * + * @param formalTypeParameterSignature the formal type parameter signature + * @return the name of the type variable + * @exception IllegalArgumentException if the signature is syntactically + * incorrect + * + */ +public static char[] getTypeVariable(char[] formalTypeParameterSignature) throws IllegalArgumentException { + int p = CharOperation.indexOf(C_COLON, formalTypeParameterSignature); + if (p < 0) { + // no ":" means can't be a formal type parameter signature + throw new IllegalArgumentException(); + } + return CharOperation.subarray(formalTypeParameterSignature, 0, p); +} + +/** + * Returns a char array containing all but the last segment of the given + * dot-separated qualified name. Returns the empty char array if it is not qualified. + *

+ * For example: + *

+ * 
+ * getQualifier({'j', 'a', 'v', 'a', '.', 'l', 'a', 'n', 'g', '.', 'O', 'b', 'j', 'e', 'c', 't'}) -> {'j', 'a', 'v', 'a', '.', 'l', 'a', 'n', 'g'}
+ * getQualifier({'O', 'u', 't', 'e', 'r', '.', 'I', 'n', 'n', 'e', 'r'}) -> {'O', 'u', 't', 'e', 'r'}
+ * getQualifier({'j', 'a', 'v', 'a', '.', 'u', 't', 'i', 'l', '.', 'L', 'i', 's', 't', '<', 'j', 'a', 'v', 'a', '.', 'l', 'a', 'n', 'g', '.', 'S', 't', 'r', 'i', 'n', 'g', '>'}) -> {'j', 'a', 'v', 'a', '.', 'u', 't', 'i', 'l'}
+ * 
+ * 
+ *

+ * + * @param name the name + * @return the qualifier prefix, or the empty char array if the name contains no + * dots + * @exception NullPointerException if name is null + * + */ +public static char[] getQualifier(char[] name) { + int lastDot = CharOperation.lastIndexOf(C_DOT, name, 0, name.length-1); + if (lastDot == -1) { + return CharOperation.NO_CHAR; + } + return CharOperation.subarray(name, 0, lastDot); +} +/** + * Returns a string containing all but the last segment of the given + * dot-separated qualified name. Returns the empty string if it is not qualified. + *

+ * For example: + *

+ * 
+ * getQualifier("java.lang.Object") -> "java.lang"
+ * getQualifier("Outer.Inner") -> "Outer"
+ * getQualifier("java.util.List<java.lang.String>") -> "java.util"
+ * 
+ * 
+ *

+ * + * @param name the name + * @return the qualifier prefix, or the empty string if the name contains no + * dots + * @exception NullPointerException if name is null + */ +public static String getQualifier(String name) { + char[] qualifier = getQualifier(name.toCharArray()); + if (qualifier.length == 0) return org.eclipse.wst.jsdt.internal.compiler.util.Util.EMPTY_STRING; + return new String(qualifier); +} +/** + * Extracts the return type from the given method signature. The method signature is + * expected to be dot-based. + * + * @param methodSignature the method signature + * @return the type signature of the return type + * @exception IllegalArgumentException if the signature is syntactically + * incorrect + * + * + */ +public static char[] getReturnType(char[] methodSignature) throws IllegalArgumentException { + // skip type parameters + if (methodSignature==null) + return CharOperation.NO_CHAR; + int paren = CharOperation.lastIndexOf(C_PARAM_END, methodSignature); + if (paren == -1) { + // could not be determined + return CharOperation.NO_CHAR; + } + // there could be thrown exceptions behind, thus scan one type exactly + int last = Util.scanTypeSignature(methodSignature, paren+1); + return CharOperation.subarray(methodSignature, paren + 1, last+1); +} +/** + * Extracts the return type from the given method signature. The method signature is + * expected to be dot-based. + * + * @param methodSignature the method signature + * @return the type signature of the return type + * @exception IllegalArgumentException if the signature is syntactically + * incorrect + */ +public static String getReturnType(String methodSignature) throws IllegalArgumentException { + return new String(getReturnType(methodSignature.toCharArray())); +} +/** + * Returns package fragment of a type signature. The package fragment separator must be '.' + * and the type fragment separator must be '$'. + *

+ * For example: + *

+ * 
+ * getSignatureQualifier({'L', 'j', 'a', 'v', 'a', '.', 'u', 't', 'i', 'l', '.', 'M', 'a', 'p', '$', 'E', 'n', 't', 'r', 'y', ';'}) -> {'j', 'a', 'v', 'a', '.', 'u', 't', 'i', 'l'}
+ * 
+ * 
+ *

+ * + * @param typeSignature the type signature + * @return the package fragment (separators are '.') + * + */ +public static char[] getSignatureQualifier(char[] typeSignature) { + if(typeSignature == null) return CharOperation.NO_CHAR; + + char[] qualifiedType = Signature.toCharArray(typeSignature); + + int dotCount = 0; + indexFound: for(int i = 0; i < typeSignature.length; i++) { + switch(typeSignature[i]) { + case C_DOT: + dotCount++; + break; + case C_DOLLAR: + break indexFound; + } + } + + if(dotCount > 0) { + for(int i = 0; i < qualifiedType.length; i++) { + if(qualifiedType[i] == '.') { + dotCount--; + } + if(dotCount <= 0) { + return CharOperation.subarray(qualifiedType, 0, i); + } + } + } + return CharOperation.NO_CHAR; +} +/** + * Returns package fragment of a type signature. The package fragment separator must be '.' + * and the type fragment separator must be '$'. + *

+ * For example: + *

+ * 
+ * getSignatureQualifier("Ljava.util.Map$Entry") -> "java.util"
+ * 
+ * 
+ *

+ * + * @param typeSignature the type signature + * @return the package fragment (separators are '.') + * + */ +public static String getSignatureQualifier(String typeSignature) { + return new String(getSignatureQualifier(typeSignature == null ? null : typeSignature.toCharArray())); +} +/** + * Returns type fragment of a type signature. The package fragment separator must be '.' + * and the type fragment separator must be '$'. + *

+ * For example: + *

+ * 
+ * getSignatureSimpleName({'L', 'j', 'a', 'v', 'a', '.', 'u', 't', 'i', 'l', '.', 'M', 'a', 'p', '$', 'E', 'n', 't', 'r', 'y', ';'}) -> {'M', 'a', 'p', '.', 'E', 'n', 't', 'r', 'y'}
+ * 
+ * 
+ *

+ * + * @param typeSignature the type signature + * @return the type fragment (separators are '.') + * + */ +public static char[] getSignatureSimpleName(char[] typeSignature) { + if(typeSignature == null) return CharOperation.NO_CHAR; + + char[] qualifiedType = Signature.toCharArray(typeSignature); + +// int dotCount = 0; +// indexFound: for(int i = 0; i < typeSignature.length; i++) { +// switch(typeSignature[i]) { +// case C_DOT: +// dotCount++; +// break; +// case C_GENERIC_START: +// break indexFound; +// case C_DOLLAR: +// break indexFound; +// } +// } +// +// if(dotCount > 0) { +// for(int i = 0; i < qualifiedType.length; i++) { +// if(qualifiedType[i] == '.') { +// dotCount--; +// } +// if(dotCount <= 0) { +// return CharOperation.subarray(qualifiedType, i + 1, qualifiedType.length); +// } +// } +// } + return qualifiedType; +} +/** + * Returns type fragment of a type signature. The package fragment separator must be '.' + * and the type fragment separator must be '$'. + *

+ * For example: + *

+ * 
+ * getSignatureSimpleName("Ljava.util.Map$Entry") -> "Map.Entry"
+ * 
+ * 
+ *

+ * + * @param typeSignature the type signature + * @return the type fragment (separators are '.') + * + */ +public static String getSignatureSimpleName(String typeSignature) { + return new String(getSignatureSimpleName(typeSignature == null ? null : typeSignature.toCharArray())); +} + +/** + * Returns the last segment of the given dot-separated qualified name. + * Returns the given name if it is not qualified. + *

+ * For example: + *

+ * 
+ * getSimpleName({'j', 'a', 'v', 'a', '.', 'l', 'a', 'n', 'g', '.', 'O', 'b', 'j', 'e', 'c', 't'}) -> {'O', 'b', 'j', 'e', 'c', 't'}
+ * 
+ * 
+ *

+ * + * @param name the name + * @return the last segment of the qualified name + * @exception NullPointerException if name is null + * + */ +public static char[] getSimpleName(char[] name) { + + int lastDot = -1; + int depth = 0; + int length = name.length; + lastDotLookup: for (int i = length -1; i >= 0; i--) { + switch (name[i]) { + case '.': + if (depth == 0) { + lastDot = i; + break lastDotLookup; + } + break; + } + } + + if (lastDot < 0) { + return name; + } + return CharOperation.subarray(name, lastDot + 1, length); +} +/** + * Returns the last segment of the given dot-separated qualified name. + * Returns the given name if it is not qualified. + *

+ * For example: + *

+ * 
+ * getSimpleName("java.lang.Object") -> "Object"
+ * 
+ * 
+ * getSimpleName("java.util.Map<java.lang.String, java.lang.Object>") -> "Map<String,Object>"
+ * 
+ * 
+ *

+ * + * @param name the name + * @return the last segment of the qualified name + * @exception NullPointerException if name is null + */ +public static String getSimpleName(String name) { + int lastDot = -1; + int depth = 0; + int length = name.length(); + lastDotLookup: for (int i = length -1; i >= 0; i--) { + switch (name.charAt(i)) { + case '.': + if (depth == 0) { + lastDot = i; + break lastDotLookup; + } + break; + } + } + if (lastDot < 0) { + return name; + } + return name.substring(lastDot + 1, length); +} + +/** + * Returns all segments of the given dot-separated qualified name. + * Returns an array with only the given name if it is not qualified. + * Returns an empty array if the name is empty. + *

+ * For example: + *

+ * 
+ * getSimpleNames({'j', 'a', 'v', 'a', '.', 'l', 'a', 'n', 'g', '.', 'O', 'b', 'j', 'e', 'c', 't'}) -> {{'j', 'a', 'v', 'a'}, {'l', 'a', 'n', 'g'}, {'O', 'b', 'j', 'e', 'c', 't'}}
+ * getSimpleNames({'O', 'b', 'j', 'e', 'c', 't'}) -> {{'O', 'b', 'j', 'e', 'c', 't'}}
+ * getSimpleNames({}) -> {}
+ * getSimpleNames({'j', 'a', 'v', 'a', '.', 'u', 't', 'i', 'l', '.', 'L', 'i', 's', 't', '<', 'j', 'a', 'v', 'a', '.', 'l', 'a', 'n', 'g', '.', 'S', 't', 'r', 'i', 'n', 'g', '>'}) -> {{'j', 'a', 'v', 'a'}, {'l', 'a', 'n', 'g'}, {'L', 'i', 's', 't', '<', 'j', 'a', 'v', 'a', '.', 'l', 'a', 'n', 'g', '.', 'S', 't', 'r', 'i', 'n', 'g'}}
+ * 
+ * 
+ * + * @param name the name + * @return the list of simple names, possibly empty + * @exception NullPointerException if name is null + * + */ +public static char[][] getSimpleNames(char[] name) { + int length = name == null ? 0 : name.length; + if (length == 0) + return CharOperation.NO_CHAR_CHAR; + + int wordCount = 1; + for (int i = 0; i < length; i++) + switch(name[i]) { + case C_DOT: + wordCount++; + break; + } + char[][] split = new char[wordCount][]; + int last = 0, currentWord = 0; + for (int i = 0; i < length; i++) { + if (name[i] == C_DOT) { + split[currentWord] = new char[i - last]; + System.arraycopy( + name, + last, + split[currentWord++], + 0, + i - last); + last = i + 1; + } + } + split[currentWord] = new char[length - last]; + System.arraycopy(name, last, split[currentWord], 0, length - last); + return split; +} +/** + * Returns all segments of the given dot-separated qualified name. + * Returns an array with only the given name if it is not qualified. + * Returns an empty array if the name is empty. + *

+ * For example: + *

+ * 
+ * getSimpleNames("java.lang.Object") -> {"java", "lang", "Object"}
+ * getSimpleNames("Object") -> {"Object"}
+ * getSimpleNames("") -> {}
+ * getSimpleNames("java.util.List<java.lang.String>") ->
+ *   {"java", "util", "List<java.lang.String>"}
+ * 
+ * 
+ * + * @param name the name + * @return the list of simple names, possibly empty + * @exception NullPointerException if name is null + */ +public static String[] getSimpleNames(String name) { + return CharOperation.toStrings(getSimpleNames(name.toCharArray())); +} + +/** + * Converts the given method signature to a readable form. The method signature is expected to + * be dot-based. + *

+ * For example: + *

+ * 
+ * toString("([Ljava.lang.String;)V", "main", new String[] {"args"}, false, true) -> "void main(String[] args)"
+ * 
+ * 
+ *

+ * + * @param methodSignature the method signature to convert + * @param methodName the name of the method to insert in the result, or + * null if no method name is to be included + * @param parameterNames the parameter names to insert in the result, or + * null if no parameter names are to be included; if supplied, + * the number of parameter names must match that of the method signature + * @param fullyQualifyTypeNames true if type names should be fully + * qualified, and false to use only simple names + * @param includeReturnType true if the return type is to be + * included + * @return the char array representation of the method signature + * + * + */ +public static char[] toCharArray(char[] methodSignature, char[] methodName, char[][] parameterNames, boolean fullyQualifyTypeNames, boolean includeReturnType) { + return toCharArray(methodSignature, methodName, parameterNames, fullyQualifyTypeNames, includeReturnType, false); +} +/** + * Converts the given method signature to a readable form. The method signature is expected to + * be dot-based. + *

+ * For example: + *

+ * 
+ * toString("([Ljava.lang.String;)V", "main", new String[] {"args"}, false, true) -> "void main(String[] args)"
+ * 
+ * 
+ *

+ * + * @param methodSignature the method signature to convert + * @param methodName the name of the method to insert in the result, or + * null if no method name is to be included + * @param parameterNames the parameter names to insert in the result, or + * null if no parameter names are to be included; if supplied, + * the number of parameter names must match that of the method signature + * @param fullyQualifyTypeNames true if type names should be fully + * qualified, and false to use only simple names + * @param includeReturnType true if the return type is to be + * included + * @param isVargArgs true if the last argument should be displayed as a + * variable argument, false otherwise. + * @return the char array representation of the method signature + * + * + */ +public static char[] toCharArray(char[] methodSignature, char[] methodName, char[][] parameterNames, boolean fullyQualifyTypeNames, boolean includeReturnType, boolean isVargArgs) { + int firstParen = CharOperation.indexOf(C_PARAM_START, methodSignature); + if (firstParen == -1) { + throw new IllegalArgumentException(); + } + + StringBuffer buffer = new StringBuffer(methodSignature.length + 10); + + // return type + if (includeReturnType) { + char[] rts = getReturnType(methodSignature); + appendTypeSignature(rts, 0 , fullyQualifyTypeNames, buffer); + buffer.append(' '); + } + + // selector + if (methodName != null) { + buffer.append(methodName); + } + + // parameters + buffer.append('('); + char[][] pts = getParameterTypes(methodSignature); + for (int i = 0, max = pts.length; i < max; i++) { + if (i == max - 1) { + appendTypeSignature(pts[i], 0 , fullyQualifyTypeNames, buffer, isVargArgs); + } else { + appendTypeSignature(pts[i], 0 , fullyQualifyTypeNames, buffer); + } + if (parameterNames != null) { + buffer.append(' '); + buffer.append(parameterNames[i]); + } + if (i != pts.length - 1) { + buffer.append(','); + buffer.append(' '); + } + } + buffer.append(')'); + char[] result = new char[buffer.length()]; + buffer.getChars(0, buffer.length(), result, 0); + return result; +} +/** + * Converts the given type signature to a readable string. The signature is expected to + * be dot-based. + * + *

+ * For example: + *

+ * 
+ * toString({'[', 'L', 'j', 'a', 'v', 'a', '.', 'l', 'a', 'n', 'g', '.', 'S', 't', 'r', 'i', 'n', 'g', ';'}) -> {'j', 'a', 'v', 'a', '.', 'l', 'a', 'n', 'g', '.', 'S', 't', 'r', 'i', 'n', 'g', '[', ']'}
+ * toString({'I'}) -> {'i', 'n', 't'}
+ * toString({'+', 'L', 'O', 'b', 'j', 'e', 'c', 't', ';'}) -> {'?', ' ', 'e', 'x', 't', 'e', 'n', 'd', 's', ' ', 'O', 'b', 'j', 'e', 'c', 't'}
+ * 
+ * 
+ *

+ *

+ * Note: This method assumes that a type signature containing a '$' + * is an inner type signature. While this is correct in most cases, someone could + * define a non-inner type name containing a '$'. Handling this + * correctly in all cases would have required resolving the signature, which + * generally not feasible. + *

+ * + * @param signature the type signature + * @return the string representation of the type + * @exception IllegalArgumentException if the signature is not syntactically + * correct + * + * + */ +public static char[] toCharArray(char[] signature) throws IllegalArgumentException { + int sigLength = signature.length; + if (sigLength == 0 || signature[0] == C_PARAM_START) { + return toCharArray(signature, CharOperation.NO_CHAR, null, true, true); + } + + StringBuffer buffer = new StringBuffer(signature.length + 10); + appendTypeSignature(signature, 0, true, buffer); + char[] result = new char[buffer.length()]; + buffer.getChars(0, buffer.length(), result, 0); + return result; +} + +/** + * Scans the given string for a type signature starting at the given + * index and appends it to the given buffer, and returns the index of the last + * character. + * + * @param string the signature string + * @param start the 0-based character index of the first character + * @param fullyQualifyTypeNames true if type names should be fully + * qualified, and false to use only simple names + * @param buffer the string buffer to append to + * @return the 0-based character index of the last character + * @exception IllegalArgumentException if this is not a type signature + * @see Util#scanTypeSignature(char[], int) + */ +private static int appendTypeSignature(char[] string, int start, boolean fullyQualifyTypeNames, StringBuffer buffer) { + return appendTypeSignature(string, start, fullyQualifyTypeNames, buffer, false); +} +/** + * Scans the given string for a type signature starting at the given + * index and appends it to the given buffer, and returns the index of the last + * character. + * + * @param string the signature string + * @param start the 0-based character index of the first character + * @param fullyQualifyTypeNames true if type names should be fully + * qualified, and false to use only simple names + * @param buffer the string buffer to append to + * @param isVarArgs true if the type must be displayed as a + * variable argument, false otherwise. In this case, the type must be an array type + * @return the 0-based character index of the last character + * @exception IllegalArgumentException if this is not a type signature, or if isVarArgs is true, + * and the type is not an array type signature. + * @see Util#scanTypeSignature(char[], int) + */ +private static int appendTypeSignature(char[] string, int start, boolean fullyQualifyTypeNames, StringBuffer buffer, boolean isVarArgs) { + // need a minimum 1 char + if (start >= string.length) { + throw new IllegalArgumentException(); + } + char c = string[start]; + if (isVarArgs) { + switch (c) { + case C_ARRAY : + return appendArrayTypeSignature(string, start, fullyQualifyTypeNames, buffer, true); + case C_RESOLVED : + case C_UNRESOLVED : + case C_VOID : + default: + throw new IllegalArgumentException(); // a var args is an array type + } + } else { + switch (c) { + case C_ARRAY : + return appendArrayTypeSignature(string, start, fullyQualifyTypeNames, buffer); + case C_RESOLVED : + case C_UNRESOLVED : + return appendClassTypeSignature(string, start, fullyQualifyTypeNames, buffer); + case C_COMPILATION_UNIT : + return appendCompilationUnitSignature(string, start, fullyQualifyTypeNames, buffer); + case C_ANY : + buffer.append(ANY); + return start; + case C_VOID : + buffer.append(VOID); + return start; + default : + /* either the string is not formated as a signature, or we do not know + * how to handle it, so just return it, this is preferable to throwing + * an unnecessary exception + */ + buffer.append(string); + return start; + } + } +} + + +private static int appendCompilationUnitSignature(char[] string, int start, boolean fullyQualifyTypeNames, StringBuffer buffer) { + // need a minimum 3 chars "Lx;" + if (start >= string.length - 2) { + throw new IllegalArgumentException(); + } + // must start in "L" or "Q" + char c = string[start]; + if (c != C_COMPILATION_UNIT) { + throw new IllegalArgumentException(); + } + int p = start + 1; + while (true) { + if (p >= string.length) { + throw new IllegalArgumentException(); + } + c = string[p]; + switch(c) { + case C_SEMICOLON : + // all done + return p; + default : + buffer.append(c); + } + p++; + } +} + + + +/** + * Scans the given string for an array type signature starting at the given + * index and appends it to the given buffer, and returns the index of the last + * character. + * + * @param string the signature string + * @param start the 0-based character index of the first character + * @param fullyQualifyTypeNames true if type names should be fully + * qualified, and false to use only simple names + * @return the 0-based character index of the last character + * @exception IllegalArgumentException if this is not an array type signature + * @see Util#scanArrayTypeSignature(char[], int) + */ +private static int appendArrayTypeSignature(char[] string, int start, boolean fullyQualifyTypeNames, StringBuffer buffer) { + return appendArrayTypeSignature(string, start, fullyQualifyTypeNames, buffer, false); +} + +/** + * Scans the given string for an array type signature starting at the given + * index and appends it to the given buffer, and returns the index of the last + * character. + * + * @param string the signature string + * @param start the 0-based character index of the first character + * @param fullyQualifyTypeNames true if type names should be fully + * qualified, and false to use only simple names + * @param isVarArgs true if the array type must be displayed as a + * variable argument, false otherwise + * @return the 0-based character index of the last character + * @exception IllegalArgumentException if this is not an array type signature + * @see Util#scanArrayTypeSignature(char[], int) + */ +private static int appendArrayTypeSignature(char[] string, int start, boolean fullyQualifyTypeNames, StringBuffer buffer, boolean isVarArgs) { + int length = string.length; + // need a minimum 2 char + if (start >= length - 1) { + throw new IllegalArgumentException(); + } + char c = string[start]; + if (c != C_ARRAY) { + throw new IllegalArgumentException(); + } + + int index = start; + c = string[++index]; + while(c == C_ARRAY) { + // need a minimum 2 char + if (index >= length - 1) { + throw new IllegalArgumentException(); + } + c = string[++index]; + } + + int e = appendTypeSignature(string, index, fullyQualifyTypeNames, buffer); + + for(int i = 1, dims = index - start; i < dims; i++) { + buffer.append('[').append(']'); + } + + if (isVarArgs) { + buffer.append('.').append('.').append('.'); + } else { + buffer.append('[').append(']'); + } + return e; +} +/** + * Scans the given string for a class type signature starting at the given + * index and appends it to the given buffer, and returns the index of the last + * character. + * + * @param string the signature string + * @param start the 0-based character index of the first character + * @param fullyQualifyTypeNames true if type names should be fully + * qualified, and false to use only simple names + * @param buffer the string buffer to append to + * @return the 0-based character index of the last character + * @exception IllegalArgumentException if this is not a class type signature + * @see Util#scanClassTypeSignature(char[], int) + */ +private static int appendClassTypeSignature(char[] string, int start, boolean fullyQualifyTypeNames, StringBuffer buffer) { + // need a minimum 3 chars "Lx;" + if (start >= string.length - 2) { + throw new IllegalArgumentException(); + } + // must start in "L" or "Q" + char c = string[start]; + if (c != C_RESOLVED && c != C_UNRESOLVED) { + throw new IllegalArgumentException(); + } + boolean resolved = (c == C_RESOLVED); + boolean removePackageQualifiers = !fullyQualifyTypeNames; + if (!resolved) { + // keep everything in an unresolved name + removePackageQualifiers = false; + } + int p = start + 1; + int checkpoint = buffer.length(); + int innerTypeStart = -1; + boolean inAnonymousType = false; + while (true) { + if (p >= string.length) { + throw new IllegalArgumentException(); + } + c = string[p]; + switch(c) { + case C_SEMICOLON : + // all done + return p; + case C_DOT : + if (removePackageQualifiers) { + // erase package prefix + buffer.setLength(checkpoint); + } else { + buffer.append('.'); + } + break; + case '/' : + if (removePackageQualifiers) { + // erase package prefix + buffer.setLength(checkpoint); + } else { + buffer.append('/'); + } + break; + default : + if (innerTypeStart != -1 && !inAnonymousType && Character.isDigit(c)) { + inAnonymousType = true; + buffer.setLength(innerTypeStart); // remove '.' + buffer.insert(checkpoint, "new "); //$NON-NLS-1$ + buffer.append("(){}"); //$NON-NLS-1$ + } + if (!inAnonymousType) + buffer.append(c); + innerTypeStart = -1; + } + p++; + } +} + +/** + * Converts the given array of qualified name segments to a qualified name. + *

+ * For example: + *

+ * 
+ * toQualifiedName({{'j', 'a', 'v', 'a'}, {'l', 'a', 'n', 'g'}, {'O', 'b', 'j', 'e', 'c', 't'}}) -> {'j', 'a', 'v', 'a', '.', 'l', 'a', 'n', 'g', '.', 'O', 'b', 'j', 'e', 'c', 't'}
+ * toQualifiedName({{'O', 'b', 'j', 'e', 'c', 't'}}) -> {'O', 'b', 'j', 'e', 'c', 't'}
+ * toQualifiedName({{}}) -> {}
+ * 
+ * 
+ *

+ * + * @param segments the list of name segments, possibly empty + * @return the dot-separated qualified name, or the empty string + * + * + */ +public static char[] toQualifiedName(char[][] segments) { + int length = segments.length; + if (length == 0) return CharOperation.NO_CHAR; + if (length == 1) return segments[0]; + + int resultLength = 0; + for (int i = 0; i < length; i++) { + resultLength += segments[i].length+1; + } + resultLength--; + char[] result = new char[resultLength]; + int index = 0; + for (int i = 0; i < length; i++) { + char[] segment = segments[i]; + int segmentLength = segment.length; + System.arraycopy(segment, 0, result, index, segmentLength); + index += segmentLength; + if (i != length-1) { + result[index++] = C_DOT; + } + } + return result; +} +/** + * Converts the given array of qualified name segments to a qualified name. + *

+ * For example: + *

+ * 
+ * toQualifiedName(new String[] {"java", "lang", "Object"}) -> "java.lang.Object"
+ * toQualifiedName(new String[] {"Object"}) -> "Object"
+ * toQualifiedName(new String[0]) -> ""
+ * 
+ * 
+ *

+ * + * @param segments the list of name segments, possibly empty + * @return the dot-separated qualified name, or the empty string + */ +public static String toQualifiedName(String[] segments) { + int length = segments.length; + char[][] charArrays = new char[length][]; + for (int i = 0; i < length; i++) { + charArrays[i] = segments[i].toCharArray(); + } + return new String(toQualifiedName(charArrays)); +} +/** + * Converts the given type signature to a readable string. The signature is expected to + * be dot-based. + * + *

+ * For example: + *

+ * 
+ * toString("[Ljava.lang.String;") -> "java.lang.String[]"
+ * toString("I") -> "int"
+ * toString("+QObject;") -> "? extends Object"
+ * 
+ * 
+ *

+ *

+ * Note: This method assumes that a type signature containing a '$' + * is an inner type signature. While this is correct in most cases, someone could + * define a non-inner type name containing a '$'. Handling this + * correctly in all cases would have required resolving the signature, which + * generally not feasible. + *

+ * + * @param signature the type signature + * @return the string representation of the type + * @exception IllegalArgumentException if the signature is not syntactically + * correct + */ +public static String toString(String signature) throws IllegalArgumentException { + return new String(toCharArray(signature.toCharArray())); +} +/** + * Converts the given method signature to a readable string. The method signature is expected to + * be dot-based. + * + * @param methodSignature the method signature to convert + * @param methodName the name of the method to insert in the result, or + * null if no method name is to be included + * @param parameterNames the parameter names to insert in the result, or + * null if no parameter names are to be included; if supplied, + * the number of parameter names must match that of the method signature + * @param fullyQualifyTypeNames true if type names should be fully + * qualified, and false to use only simple names + * @param includeReturnType true if the return type is to be + * included + * @see #toCharArray(char[], char[], char[][], boolean, boolean) + * @return the string representation of the method signature + */ +public static String toString(String methodSignature, String methodName, String[] parameterNames, boolean fullyQualifyTypeNames, boolean includeReturnType) { + return toString(methodSignature, methodName, parameterNames, fullyQualifyTypeNames, includeReturnType, false); +} +/** + * Converts the given method signature to a readable string. The method signature is expected to + * be dot-based. + * + * @param methodSignature the method signature to convert + * @param methodName the name of the method to insert in the result, or + * null if no method name is to be included + * @param parameterNames the parameter names to insert in the result, or + * null if no parameter names are to be included; if supplied, + * the number of parameter names must match that of the method signature + * @param fullyQualifyTypeNames true if type names should be fully + * qualified, and false to use only simple names + * @param includeReturnType true if the return type is to be + * included + * @param isVarArgs true if the last argument should be displayed as a + * variable argument, false otherwise + * @see #toCharArray(char[], char[], char[][], boolean, boolean) + * @return the string representation of the method signature + * + * + */ +public static String toString(String methodSignature, String methodName, String[] parameterNames, boolean fullyQualifyTypeNames, boolean includeReturnType, boolean isVarArgs) { + char[][] params; + if (parameterNames == null) { + params = null; + } else { + int paramLength = parameterNames.length; + params = new char[paramLength][]; + for (int i = 0; i < paramLength; i++) { + params[i] = parameterNames[i].toCharArray(); + } + } + return new String(toCharArray(methodSignature.toCharArray(), methodName == null ? null : methodName.toCharArray(), params, fullyQualifyTypeNames, includeReturnType, isVarArgs)); +} +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ToolFactory.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ToolFactory.java new file mode 100644 index 0000000..0722426 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ToolFactory.java @@ -0,0 +1,247 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.wst.jsdt.core.compiler.IScanner; +import org.eclipse.wst.jsdt.core.formatter.CodeFormatter; +import org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants; +import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants; +import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions; +import org.eclipse.wst.jsdt.internal.core.util.PublicScanner; +import org.eclipse.wst.jsdt.internal.formatter.DefaultCodeFormatter; + +/** + * Factory for creating various compiler tools, such as scanners, parsers and compilers. + *

+ * This class provides static methods only; it is not intended to be instantiated or subclassed by clients. + *

+ * + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public class ToolFactory { + + /** + * This mode is used for formatting new code when some formatter options should not be used. + * In particular, options that preserve the indentation of comments are not used. + * In the future, newly added options may be ignored as well. + *

Clients that are formatting new code are recommended to use this mode. + *

+ * + * @see DefaultCodeFormatterConstants#FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN + * @see DefaultCodeFormatterConstants#FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN + * @see #createCodeFormatter(Map, int) + */ + public static final int M_FORMAT_NEW = new Integer(0).intValue(); + + /** + * This mode is used for formatting existing code when all formatter options should be used. + * In particular, options that preserve the indentation of comments are used. + *

Clients that are formatting existing code are recommended to use this mode. + *

+ * + * @see DefaultCodeFormatterConstants#FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN + * @see DefaultCodeFormatterConstants#FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN + * @see #createCodeFormatter(Map, int) + */ + public static final int M_FORMAT_EXISTING = new Integer(1).intValue(); + + /** + * Create an instance of the built-in code formatter. + *

The given options should at least provide the source level ({@link JavaScriptCore#COMPILER_SOURCE}), + * the compiler compliance level ({@link JavaScriptCore#COMPILER_COMPLIANCE}) and the target platform + * ({@link JavaScriptCore#COMPILER_CODEGEN_TARGET_PLATFORM}). + * Without these options, it is not possible for the code formatter to know what kind of source it needs to format. + *

+ * Note this is equivalent to createCodeFormatter(options, M_FORMAT_NEW). Thus some code formatter options + * may be ignored. See @{link {@link #M_FORMAT_NEW} for more details. + *

+ * @param options - the options map to use for formatting with the default code formatter. Recognized options + * are documented on JavaScriptCore#getDefaultOptions(). If set to null, then use + * the current settings from JavaScriptCore#getOptions. + * @return an instance of the built-in code formatter + * @see CodeFormatter + * @see JavaScriptCore#getOptions() + */ + public static CodeFormatter createCodeFormatter(Map options){ + return createCodeFormatter(options, M_FORMAT_NEW); + } + + /** + * Create an instance of the built-in code formatter. + *

The given options should at least provide the source level ({@link JavaScriptCore#COMPILER_SOURCE}), + * the compiler compliance level ({@link JavaScriptCore#COMPILER_COMPLIANCE}) and the target platform + * ({@link JavaScriptCore#COMPILER_CODEGEN_TARGET_PLATFORM}). + * Without these options, it is not possible for the code formatter to know what kind of source it needs to format. + *

+ *

The given mode determines what options should be enabled when formatting the code. It can have the following + * values: {@link #M_FORMAT_NEW}, {@link #M_FORMAT_EXISTING}, but other values may be added in the future. + *

+ * + * @param options the options map to use for formatting with the default code formatter. Recognized options + * are documented on JavaScriptCore#getDefaultOptions(). If set to null, then use + * the current settings from JavaScriptCore#getOptions. + * @param mode the given mode to modify the given options. + * + * @return an instance of the built-in code formatter + * @see CodeFormatter + * @see JavaScriptCore#getOptions() + */ + public static CodeFormatter createCodeFormatter(Map options, int mode) { + if (options == null) options = JavaScriptCore.getOptions(); + Map currentOptions = new HashMap(options); + if (mode == M_FORMAT_NEW) { + // disable the option for not indenting comments starting on first column + currentOptions.put(DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN, DefaultCodeFormatterConstants.FALSE); + currentOptions.put(DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN, DefaultCodeFormatterConstants.FALSE); + } + return new DefaultCodeFormatter(currentOptions); + } + + + + + + /** + * Create a scanner, indicating the level of detail requested for tokenizing. The scanner can then be + * used to tokenize some source in a JavaScript aware way. + * Here is a typical scanning loop: + * + * + *
+	 *   IScanner scanner = ToolFactory.createScanner(false, false, false, false);
+	 *   scanner.setSource("int i = 0;".toCharArray());
+	 *   while (true) {
+	 *     int token = scanner.getNextToken();
+	 *     if (token == ITerminalSymbols.TokenNameEOF) break;
+	 *     System.out.println(token + " : " + new String(scanner.getCurrentTokenSource()));
+	 *   }
+	 * 
+ *
+ * + *

+ * The returned scanner will tolerate unterminated line comments (missing line separator). It can be made stricter + * by using API with extra boolean parameter (strictCommentMode). + *

+ * @param tokenizeComments if set to false, comments will be silently consumed + * @param tokenizeWhiteSpace if set to false, white spaces will be silently consumed, + * @param assertMode if set to false, occurrences of 'assert' will be reported as identifiers + * (ITerminalSymbols#TokenNameIdentifier), whereas if set to true, it + * would report assert keywords (ITerminalSymbols#TokenNameassert). + * @param recordLineSeparator if set to true, the scanner will record positions of encountered line + * separator ends. In case of multi-character line separators, the last character position is considered. These positions + * can then be extracted using IScanner#getLineEnds. Only non-unicode escape sequences are + * considered as valid line separators. + * @return a scanner + * @see org.eclipse.wst.jsdt.core.compiler.IScanner + */ + public static IScanner createScanner(boolean tokenizeComments, boolean tokenizeWhiteSpace, boolean assertMode, boolean recordLineSeparator){ + + PublicScanner scanner = new PublicScanner(tokenizeComments, tokenizeWhiteSpace, false/*nls*/, assertMode ? ClassFileConstants.JDK1_4 : ClassFileConstants.JDK1_3/*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/); + scanner.recordLineSeparator = recordLineSeparator; + return scanner; + } + + /** + * Create a scanner, indicating the level of detail requested for tokenizing. The scanner can then be + * used to tokenize some source in a JavaScript aware way. + * Here is a typical scanning loop: + * + * + *

+	 *   IScanner scanner = ToolFactory.createScanner(false, false, false, false);
+	 *   scanner.setSource("int i = 0;".toCharArray());
+	 *   while (true) {
+	 *     int token = scanner.getNextToken();
+	 *     if (token == ITerminalSymbols.TokenNameEOF) break;
+	 *     System.out.println(token + " : " + new String(scanner.getCurrentTokenSource()));
+	 *   }
+	 * 
+ * + * + *

+ * The returned scanner will tolerate unterminated line comments (missing line separator). It can be made stricter + * by using API with extra boolean parameter (strictCommentMode). + *

+ * @param tokenizeComments if set to false, comments will be silently consumed + * @param tokenizeWhiteSpace if set to false, white spaces will be silently consumed, + * @param recordLineSeparator if set to true, the scanner will record positions of encountered line + * separator ends. In case of multi-character line separators, the last character position is considered. These positions + * can then be extracted using IScanner#getLineEnds. Only non-unicode escape sequences are + * considered as valid line separators. + * @param sourceLevel if set to "1.3" or null, occurrences of 'assert' will be reported as identifiers + * (ITerminalSymbols#TokenNameIdentifier), whereas if set to "1.4", it + * would report assert keywords (ITerminalSymbols#TokenNameassert). + * @return a scanner + * @see org.eclipse.wst.jsdt.core.compiler.IScanner + */ + public static IScanner createScanner(boolean tokenizeComments, boolean tokenizeWhiteSpace, boolean recordLineSeparator, String sourceLevel) { + PublicScanner scanner = null; + long level = CompilerOptions.versionToJdkLevel(sourceLevel); + if (level == 0) level = ClassFileConstants.JDK1_3; // fault-tolerance + scanner = new PublicScanner(tokenizeComments, tokenizeWhiteSpace, false/*nls*/,level /*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/); + scanner.recordLineSeparator = recordLineSeparator; + return scanner; + } + + /** + * Create a scanner, indicating the level of detail requested for tokenizing. The scanner can then be + * used to tokenize some source in a JavaScript aware way. + * Here is a typical scanning loop: + * + * + *

+	 *   IScanner scanner = ToolFactory.createScanner(false, false, false, false);
+	 *   scanner.setSource("int i = 0;".toCharArray());
+	 *   while (true) {
+	 *     int token = scanner.getNextToken();
+	 *     if (token == ITerminalSymbols.TokenNameEOF) break;
+	 *     System.out.println(token + " : " + new String(scanner.getCurrentTokenSource()));
+	 *   }
+	 * 
+ * + * + *

+ * The returned scanner will tolerate unterminated line comments (missing line separator). It can be made stricter + * by using API with extra boolean parameter (strictCommentMode). + *

+ * @param tokenizeComments if set to false, comments will be silently consumed + * @param tokenizeWhiteSpace if set to false, white spaces will be silently consumed, + * @param recordLineSeparator if set to true, the scanner will record positions of encountered line + * separator ends. In case of multi-character line separators, the last character position is considered. These positions + * can then be extracted using IScanner#getLineEnds. Only non-unicode escape sequences are + * considered as valid line separators. + * @param sourceLevel if set to "1.3" or null, occurrences of 'assert' will be reported as identifiers + * (ITerminalSymbols#TokenNameIdentifier), whereas if set to "1.4", it + * would report assert keywords (ITerminalSymbols#TokenNameassert). + * @param complianceLevel This is used to support the Unicode 4.0 character sets. if set to 1.5 or above, + * the Unicode 4.0 is supporte, otherwise Unicode 3.0 is supported. + * @return a scanner + * @see org.eclipse.wst.jsdt.core.compiler.IScanner + * + */ + public static IScanner createScanner(boolean tokenizeComments, boolean tokenizeWhiteSpace, boolean recordLineSeparator, String sourceLevel, String complianceLevel) { + PublicScanner scanner = null; + long sourceLevelValue = CompilerOptions.versionToJdkLevel(sourceLevel); + if (sourceLevelValue == 0) sourceLevelValue = ClassFileConstants.JDK1_3; // fault-tolerance + long complianceLevelValue = CompilerOptions.versionToJdkLevel(complianceLevel); + if (complianceLevelValue == 0) complianceLevelValue = ClassFileConstants.JDK1_3; // fault-tolerance + scanner = new PublicScanner(tokenizeComments, tokenizeWhiteSpace, false/*nls*/,sourceLevelValue /*sourceLevel*/, complianceLevelValue, null/*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/); + scanner.recordLineSeparator = recordLineSeparator; + return scanner; + } +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/UnimplementedException.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/UnimplementedException.java new file mode 100644 index 0000000..e56246d --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/UnimplementedException.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +public class UnimplementedException extends RuntimeException { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public UnimplementedException() { + super(); + } + + public UnimplementedException(String arg0) { + super(arg0); + } + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/WorkingCopyOwner.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/WorkingCopyOwner.java new file mode 100644 index 0000000..c1c6202 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/WorkingCopyOwner.java @@ -0,0 +1,141 @@ +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.Path; +import org.eclipse.wst.jsdt.internal.core.BufferManager; +import org.eclipse.wst.jsdt.internal.core.CompilationUnit; +import org.eclipse.wst.jsdt.internal.core.DefaultWorkingCopyOwner; +import org.eclipse.wst.jsdt.internal.core.ExternalJavaProject; +import org.eclipse.wst.jsdt.internal.core.PackageFragment; + +/** + * The owner of an {@link IJavaScriptUnit} handle in working copy mode. + * An owner is used to identify a working copy and to create its buffer. + *

+ * Clients should subclass this class to instantiate a working copy owner that is specific to their need and that + * they can pass in to various APIs (e.g. {@link IType#resolveType(String, WorkingCopyOwner)}. + * Clients can also override the default implementation of {@link #createBuffer(IJavaScriptUnit)}. + *

+ * Note: even though this class has no abstract method, which means that it provides functional default behavior, + * it is still an abstract class, as clients are intended to own their owner implementation. + *

+ * @see IJavaScriptUnit#becomeWorkingCopy(org.eclipse.core.runtime.IProgressMonitor) + * @see IJavaScriptUnit#discardWorkingCopy() + * @see IJavaScriptUnit#getWorkingCopy(org.eclipse.core.runtime.IProgressMonitor) + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public abstract class WorkingCopyOwner { + + /** + * Sets the buffer provider of the primary working copy owner. Note that even if the + * buffer provider is a working copy owner, only its createBuffer(IJavaScriptUnit) + * method is used by the primary working copy owner. It doesn't replace the internal primary + * working owner. + *

+ * This method is for internal use by the jsdt-related plug-ins. + * Clients outside of the jsdt should not reference this method. + *

+ * + * @param primaryBufferProvider the primary buffer provider + */ + public static void setPrimaryBufferProvider(WorkingCopyOwner primaryBufferProvider) { + DefaultWorkingCopyOwner.PRIMARY.primaryBufferProvider = primaryBufferProvider; + } + + /** + * Creates a buffer for the given working copy. + * The new buffer will be initialized with the contents of the underlying file + * if and only if it was not already initialized by the compilation owner (a buffer is + * uninitialized if its content is null). + *

+ * Note: This buffer will be associated to the working copy for its entire life-cycle. Another + * working copy on same unit but owned by a different owner would not share the same buffer + * unless its owner decided to implement such a sharing behaviour. + *

+ * + * @param workingCopy the working copy of the buffer + * @return IBuffer the created buffer for the given working copy + * @see IBuffer + */ + public IBuffer createBuffer(IJavaScriptUnit workingCopy) { + + return BufferManager.createBuffer(workingCopy); + } + + /** + * Returns the problem requestor used by a working copy of this working copy owner. + *

+ * By default, no problem requestor is configured. Clients can override this + * method to provide a requestor. + *

+ * + * @param workingCopy The problem requestor used for the given working copy. + * @return the problem requestor to be used by working copies of this working + * copy owner or null if no problem requestor is configured. + * + */ + public IProblemRequestor getProblemRequestor(IJavaScriptUnit workingCopy) { + return null; + } + + /** + * Returns a new working copy with the given name using this working copy owner to + * create its buffer. + *

+ * This working copy always belongs to the default package in a package + * fragment root that corresponds to its JavaScript project, and this JavaScript project never exists. + * However this JavaScript project has the given includepath that is used when resolving names + * in this working copy. + *

+ * If a DOM AST is created using this working copy, then given includepath will be used + * if bindings need to be resolved. Problems will be reported to the problem requestor + * of the current working copy owner problem if it is not null. + *

+ * Options used to create the DOM AST are got from {@link JavaScriptCore#getOptions()} + * as it is not possible to set the options on a non-existing JavaScript project. + *

+ * When the working copy instance is created, an {@link IJavaScriptElementDelta#ADDED added delta} is + * reported on this working copy. + *

+ * Once done with the working copy, users of this method must discard it using + * {@link IJavaScriptUnit#discardWorkingCopy()}. + *

+ * Note that when such working copy is committed, only its buffer is saved (see + * {@link IBuffer#save(IProgressMonitor, boolean)}) but no resource is created. + *

+ * This method is not intended to be overriden by clients. + *

+ * + * @param name the name of the working copy (e.g. "X.js") + * @param classpath the includepath used to resolve names in this working copy + * @param monitor a progress monitor used to report progress while opening the working copy + * or null if no progress should be reported + * @throws JavaScriptModelException if the contents of this working copy can + * not be determined. + * @return a new working copy + * @see IJavaScriptUnit#becomeWorkingCopy(IProgressMonitor) + * + */ + public final IJavaScriptUnit newWorkingCopy(String name, IIncludePathEntry[] classpath, IProgressMonitor monitor) throws JavaScriptModelException { + ExternalJavaProject project = new ExternalJavaProject(classpath); + IPackageFragment parent = project.getPackageFragmentRoot(Path.EMPTY).getPackageFragment(IPackageFragment.DEFAULT_PACKAGE_NAME); + CompilationUnit result = new CompilationUnit((PackageFragment) parent, name, this); + result.becomeWorkingCopy(getProblemRequestor(result), monitor); + return result; + } + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ASTVisitor.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ASTVisitor.java new file mode 100644 index 0000000..4a808bf --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ASTVisitor.java @@ -0,0 +1,563 @@ +/******************************************************************************* + * Copyright (c) 2005, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core.ast; +import org.eclipse.wst.jsdt.core.compiler.IProblem; +import org.eclipse.wst.jsdt.core.infer.InferredAttribute; +import org.eclipse.wst.jsdt.core.infer.InferredMethod; +import org.eclipse.wst.jsdt.core.infer.InferredType; + + +/** + * + * A visitor for iterating through the AST Node tree. + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public abstract class ASTVisitor { + + + public void acceptProblem(IProblem problem) { + // do nothing by default + } + public void endVisit( IAllocationExpression allocationExpression) { + // do nothing by default + } + public void endVisit(IAND_AND_Expression and_and_Expression) { + // do nothing by default + } + public void endVisit(IArgument argument) { + // do nothing by default + } + + public void endVisit( IArrayAllocationExpression arrayAllocationExpression) { + // do nothing by default + } + public void endVisit(IArrayInitializer arrayInitializer) { + // do nothing by default + } + public void endVisit(IArrayQualifiedTypeReference arrayQualifiedTypeReference) { + // do nothing by default + } + public void endVisit(IArrayReference arrayReference) { + // do nothing by default + } + public void endVisit(IArrayTypeReference arrayTypeReference) { + // do nothing by default + } + public void endVisit(IAssignment assignment) { + // do nothing by default + } + public void endVisit(IBinaryExpression binaryExpression) { + // do nothing by default + } + public void endVisit(IBlock block) { + // do nothing by default + } + public void endVisit(IBreakStatement breakStatement) { + // do nothing by default + } + public void endVisit(ICaseStatement caseStatement) { + // do nothing by default + } + public void endVisit(IScriptFileDeclaration scriptFileDeclaration) { + // do nothing by default + } + public void endVisit(ICompoundAssignment compoundAssignment) { + // do nothing by default + } + public void endVisit(IConditionalExpression conditionalExpression) { + // do nothing by default + } + public void endVisit(IConstructorDeclaration constructorDeclaration) { + // do nothing by default + } + public void endVisit(IContinueStatement continueStatement) { + // do nothing by default + } + public void endVisit(IDoStatement doStatement) { + // do nothing by default + } + public void endVisit(IDoubleLiteral doubleLiteral) { + // do nothing by default + } + public void endVisit(IEmptyStatement emptyStatement) { + // do nothing by default + } + public void endVisit(IEqualExpression equalExpression) { + // do nothing by default + } + public void endVisit(IExplicitConstructorCall explicitConstructor) { + // do nothing by default + } + public void endVisit(IExtendedStringLiteral extendedStringLiteral) { + // do nothing by default + } + public void endVisit(IFalseLiteral falseLiteral) { + // do nothing by default + } + public void endVisit(IFieldDeclaration fieldDeclaration) { + // do nothing by default + } + + public void endVisit(IFieldReference fieldDeclaration) { + // do nothing by default + } + + public void endVisit(IForeachStatement forStatement) { + // do nothing by default + } + public void endVisit(IForStatement forStatement) { + // do nothing by default + } + public void endVisit(IForInStatement forInStatement) { + // do nothing by default + } + + public void endVisit(IFunctionExpression functionExpression) { + } + + public void endVisit(IIfStatement ifStatement) { + // do nothing by default + } + public void endVisit(IImportReference importRef) { + // do nothing by default + } + public void endVisit(InferredType inferredType) { + // do nothing by default + } + + public void endVisit(IInitializer initializer) { + // do nothing by default + } + public void endVisit(IInstanceOfExpression instanceOfExpression) { + // do nothing by default + } + public void endVisit(IIntLiteral intLiteral) { + // do nothing by default + } + public void endVisit(IJsDoc javadoc) { + // do nothing by default + } + public void endVisit(IJsDocAllocationExpression expression) { + // do nothing by default + } + public void endVisit(IJsDocArgumentExpression expression) { + // do nothing by default + } + public void endVisit(IJsDocArrayQualifiedTypeReference typeRef) { + // do nothing by default + } + public void endVisit(IJsDocArraySingleTypeReference typeRef) { + // do nothing by default + } + public void endVisit(IJsDocFieldReference fieldRef) { + // do nothing by default + } + public void endVisit(IJsDocImplicitTypeReference implicitTypeReference) { + // do nothing by default + } + public void endVisit(IJsDocMessageSend messageSend) { + // do nothing by default + } + public void endVisit(IJsDocQualifiedTypeReference typeRef) { + // do nothing by default + } + public void endVisit(IJsDocReturnStatement statement) { + // do nothing by default + } + public void endVisit(IJsDocSingleNameReference argument) { + // do nothing by default + } + public void endVisit(IJsDocSingleTypeReference typeRef) { + // do nothing by default + } + public void endVisit(ILabeledStatement labeledStatement) { + // do nothing by default + } + public void endVisit(ILocalDeclaration localDeclaration) { + // do nothing by default + } + public void endVisit(IListExpression listDeclaration) { + // do nothing by default + } + public void endVisit(IFunctionCall messageSend) { + // do nothing by default + } + public void endVisit(IFunctionDeclaration methodDeclaration) { + // do nothing by default + } + public void endVisit(IStringLiteralConcatenation literal) { + // do nothing by default + } + public void endVisit(INullLiteral nullLiteral) { + // do nothing by default + } + public void endVisit(IOR_OR_Expression or_or_Expression) { + // do nothing by default + } + public void endVisit(IPostfixExpression postfixExpression) { + // do nothing by default + } + public void endVisit(IPrefixExpression prefixExpression) { + // do nothing by default + } + public void endVisit(IQualifiedAllocationExpression qualifiedAllocationExpression) { + // do nothing by default + } + public void endVisit(IQualifiedNameReference qualifiedNameReference) { + // do nothing by default + } + public void endVisit(IQualifiedThisReference qualifiedThisReference) { + // do nothing by default + } + public void endVisit(IQualifiedTypeReference qualifiedTypeReference) { + // do nothing by default + } + + public void endVisit(IRegExLiteral stringLiteral) { + // do nothing by default + } + + + public void endVisit(IReturnStatement returnStatement) { + // do nothing by default + } + public void endVisit(ISingleNameReference singleNameReference) { + // do nothing by default + } + + public void endVisit(ISingleTypeReference singleTypeReference) { + // do nothing by default + } + public void endVisit(IStringLiteral stringLiteral) { + // do nothing by default + } + public void endVisit(ISuperReference superReference) { + // do nothing by default + } + public void endVisit(ISwitchStatement switchStatement) { + // do nothing by default + } + + public void endVisit(IThisReference thisReference) { + // do nothing by default + } + public void endVisit(IThrowStatement throwStatement) { + // do nothing by default + } + public void endVisit(ITrueLiteral trueLiteral) { + // do nothing by default + } + public void endVisit(ITryStatement tryStatement) { + // do nothing by default + } + public void endVisit(ITypeDeclaration memberTypeDeclaration) { + // do nothing by default + } + public void endVisit(IUnaryExpression unaryExpression) { + // do nothing by default + } + public void endVisit(IUndefinedLiteral undefinedLiteral) { + // do nothing by default + } + + public void endVisit(IWhileStatement whileStatement) { + // do nothing by default + } + public void endVisit(IWithStatement whileStatement) { + // do nothing by default + } + public boolean visit(IAllocationExpression allocationExpression) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IAND_AND_Expression and_and_Expression) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IArgument argument) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IArrayAllocationExpression arrayAllocationExpression) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IArrayInitializer arrayInitializer) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IArrayQualifiedTypeReference arrayQualifiedTypeReference) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IArrayReference arrayReference) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IArrayTypeReference arrayTypeReference) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IAssignment assignment) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IBinaryExpression binaryExpression) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IBlock block) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IBreakStatement breakStatement) { + return true; // do nothing by default, keep traversing + } + public boolean visit(ICaseStatement caseStatement) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IScriptFileDeclaration compilationUnitDeclaration) { + return true; // do nothing by default, keep traversing + } + public boolean visit(ICompoundAssignment compoundAssignment) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IConditionalExpression conditionalExpression) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IConstructorDeclaration constructorDeclaration) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IContinueStatement continueStatement) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IDoStatement doStatement) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IDoubleLiteral doubleLiteral) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IEmptyStatement emptyStatement) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IEqualExpression equalExpression) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IExplicitConstructorCall explicitConstructor) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IExtendedStringLiteral extendedStringLiteral) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IFalseLiteral falseLiteral) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IFieldDeclaration fieldDeclaration) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IFieldReference fieldReference) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IForeachStatement forStatement) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IForInStatement forInStatement) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IForStatement forStatement) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IFunctionExpression functionExpression) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IIfStatement ifStatement) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IImportReference importRef) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(InferredType inferredType) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(InferredMethod inferredMethod) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(InferredAttribute inferredField) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IInitializer initializer) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IInstanceOfExpression instanceOfExpression) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IIntLiteral intLiteral) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IJsDoc javadoc) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IJsDocAllocationExpression expression) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IJsDocArgumentExpression expression) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IJsDocArrayQualifiedTypeReference typeRef) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IJsDocArraySingleTypeReference typeRef) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IJsDocFieldReference fieldRef) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IJsDocImplicitTypeReference implicitTypeReference) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IJsDocMessageSend messageSend) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IJsDocQualifiedTypeReference typeRef) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IJsDocReturnStatement statement) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IJsDocSingleNameReference argument) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IJsDocSingleTypeReference typeRef) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(ILabeledStatement labeledStatement) { + return true; // do nothing by default, keep traversing + } + public boolean visit(ILocalDeclaration localDeclaration) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IListExpression listDeclaration) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IFunctionCall functionCall) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IFunctionDeclaration functionDeclaration) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IStringLiteralConcatenation literal) { + return true; // do nothing by default, keep traversing + } + public boolean visit(INullLiteral nullLiteral) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IOR_OR_Expression or_or_Expression) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IPostfixExpression postfixExpression) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IPrefixExpression prefixExpression) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IQualifiedAllocationExpression qualifiedAllocationExpression) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IQualifiedNameReference qualifiedNameReference) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IQualifiedThisReference qualifiedThisReference) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IQualifiedTypeReference qualifiedTypeReference) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IRegExLiteral stringLiteral) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IReturnStatement returnStatement) { + return true; // do nothing by default, keep traversing + } + public boolean visit(ISingleNameReference singleNameReference) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(ISingleTypeReference singleTypeReference) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IStringLiteral stringLiteral) { + return true; // do nothing by default, keep traversing + } + public boolean visit(ISuperReference superReference) { + return true; // do nothing by default, keep traversing + } + public boolean visit(ISwitchStatement switchStatement) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IThisReference thisReference) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IThrowStatement throwStatement) { + return true; // do nothing by default, keep traversing + } + public boolean visit(ITrueLiteral trueLiteral) { + return true; // do nothing by default, keep traversing + } + public boolean visit(ITryStatement tryStatement) { + return true; // do nothing by default, keep traversing + } + public boolean visit(ITypeDeclaration localTypeDeclaration) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IUnaryExpression unaryExpression) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IUndefinedLiteral undefined) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IWhileStatement whileStatement) { + return true; // do nothing by default, keep traversing + } + public boolean visit(IWithStatement whileStatement) { + return true; // do nothing by default, keep traversing + } + + public boolean visit(IObjectLiteral literal) { + return true; // do nothing by default, keep traversing + } + public void endVisit(IObjectLiteral literal) { + } + public boolean visit(IObjectLiteralField field) { + return true; // do nothing by default, keep traversing + } + public void endVisit(IObjectLiteralField field) { + } + + + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IAND_AND_Expression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IAND_AND_Expression.java new file mode 100644 index 0000000..3b64692 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IAND_AND_Expression.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + + +/** + * Representation of a && expression + *

+ * This interface is not intended to be implemented by clients. + *

+* Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IAND_AND_Expression extends IBinaryExpression{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IASTNode.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IASTNode.java new file mode 100644 index 0000000..be19c17 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IASTNode.java @@ -0,0 +1,145 @@ +/******************************************************************************* + * Copyright (c) 2005, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * Abstract base class for AST nodes. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IASTNode { + + + //public static final int AST_FUNCTION = 1; + //public static final int AST_ABSTRACT_METHOD_DECLARATION = 0; + public static final int AST_NODE=0; + public static final int ABSTRACT_FUNCTION_DECLARATION=1; + public static final int ABSTRACT_VARIABLE_DECLARATION=2; + public static final int ALLOCATION_EXPRESSION=3; + public static final int AND_AND_EXPRESSION=4; + public static final int ARGUMENT=7; + public static final int ARRAY_ALLOCATION_EXPRESSION=8; + public static final int ARRAY_INITIALIZER=9; + public static final int ARRAY_QUALIFIED_TYPE_REFERENCE=10; + public static final int ARRAY_REFERENCE=11; + public static final int ARRAY_TYPE_REFERENCE=12; + public static final int ASSIGNMENT=14; + public static final int BINARY_EXPRESSION=15; + public static final int BLOCK=16; + public static final int BRANCH_STATEMENT=17; + public static final int BREAK_STATEMENT=18; + public static final int CASE_STATEMENT=19; + public static final int CHAR_LITERAL=21; + public static final int COMBINED_BINARY_EXPRESSION=22; + public static final int COMPOUND_ASSIGNMENT=23; + public static final int CONDITIONAL_EXPRESSION=24; + public static final int CONSTRUCTOR_DECLARATION=25; + public static final int CONTINUE_STATEMENT=26; + public static final int DO_STATEMENT=27; + public static final int DOUBLE_LITERAL=28; + public static final int EMPTY_EXPRESSION=29; + public static final int EMPTY_STATEMENT=30; + public static final int EQUAL_EXPRESSION=31; + public static final int EXPLICIT_CONSTRUCTOR_CALL=32; + public static final int EXPRESSION=33; + public static final int EXTENDED_STRING_LITERAL=34; + public static final int FALSE_LITERAL=35; + public static final int FIELD_DECLARATION=36; + public static final int FIELD_REFERENCE=37; + public static final int FLOAT_LITERAL=38; + public static final int FOR_EACH_STATEMENT=39; + public static final int FOR_IN_STATEMENT=40; + public static final int FOR_STATEMENT=41; + public static final int FUNCTION_CALL=42; + public static final int FUNCTION_DECLARATION=43; + public static final int FUNCTION_EXPRESSION=44; + public static final int IF_STATEMENT=45; + public static final int IMPORT_REFERENCE=46; + public static final int INITIALIZER=47; + public static final int INSTANCEOF_EXPRESSION=48; + public static final int INT_LITERAL=49; + public static final int INT_LITERAL_MIN_VALUE=50; + public static final int JSDOC=51; + public static final int JSDOC_ALLOCATION_EXPRESSION=52; + public static final int JSDOC_ARGUMENTEXPRESSION=53; + public static final int JSDOC_ARRAY_QUALIFIED_TYPE_REFERENCE=54; + public static final int JSDOC_ARRAY_SINGLE_TYPE_REFERENCE=55; + public static final int JSDOC_FIELD_REFERENCE=56; + public static final int JSDOC_IMPLICIT_TYPE_REFERENCE=57; + public static final int JSDOC_MESSAGE_SEND=58; + public static final int JSDOC_QUALIFIED_TYPE_REFERENCE=59; + public static final int JSDOC_RETURN_STATEMENT=60; + public static final int JSDOC_SINGLE_NAME_REFERENCE=61; + public static final int JSDOC_SINGLE_TYPE_REFERENCE=62; + public static final int LABELED_STATEMENT=63; + public static final int LIST_EXPRESSION=64; + public static final int LITERAL=65; + public static final int LOCAL_DECLARATION=66; + public static final int LONG_LITERAL=67; + public static final int LONG_LITERAL_MIN_VALUE=68; + public static final int MAGIC_LITERAL=69; + public static final int NAME_REFERENCE=72; + public static final int NULL_LITERAL=74; + public static final int NUMBER_LITERAL=75; + public static final int OBJECT_LITERAL=76; + public static final int OBJECT_LITERAL_FIELD=77; + public static final int OPERATOR_EXPRESSION=78; + public static final int OR_OR_EXPRESSION=79; + public static final int PARAMETERIZED_QUALIFIED_TYPE_REFERENCE=80; + public static final int PARAMETERIZED_SINGLE_TYPE_REFERENCE=81; + public static final int POSTFIX_EXPRESSION=82; + public static final int PREFIX_EXPRESSION=83; + public static final int PROGRAM_ELEMENT=84; + public static final int QUALIFIED_ALLOCATION_EXPRESSION=85; + public static final int QUALIFIED_NAME_REFERENCE=86; + public static final int QUALIFIED_SUPER_REFERENCE=87; + public static final int QUALIFIED_THIS_REFERENCE=88; + public static final int QUALIFIED_TYPE_REFERENCE=89; + public static final int REFERENCE=90; + public static final int REG_EX_LITERAL=91; + public static final int RETURN_STATEMENT=92; + public static final int SCRIPT_FILE_DECLARATION=93; + public static final int SINGLE_NAME_REFERENCE=95; + public static final int SINGLE_TYPE_REFERENCE=96; + public static final int STATEMENT=97; + public static final int STRING_LITERAL=98; + public static final int STRING_LITERAL_CONCATENATION=99; + public static final int SUB_ROUTINE_STATEMENT=100; + public static final int SUPER_REFERENCE=101; + public static final int SWITCH_STATEMENT=102; + public static final int THIS_REFERENCE=103; + public static final int THROW_STATEMENT=104; + public static final int TRUE_LITERAL=105; + public static final int TRY_STATEMENT=106; + public static final int TYPE_DECLARATION=107; + public static final int TYPE_PARAMETER=108; + public static final int TYPE_REFERENCE=109; + public static final int UNARY_EXPRESSION=110; + public static final int UNDEFINED_LITERAL=111; + public static final int WHILE_STATEMENT=112; + public static final int WITH_STATEMENT=114; + public static final int CLASS_LITERAL_ACCESS=115; + public static final int CL_INIT=116; + public static final int OBJECT_GETTER_SETTER_FIELD=117; + public int sourceStart() ; + public int sourceEnd(); + public int getASTType(); + + public void traverse(ASTVisitor visitor); + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IAbstractFunctionDeclaration.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IAbstractFunctionDeclaration.java new file mode 100644 index 0000000..eb3cc2a --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IAbstractFunctionDeclaration.java @@ -0,0 +1,79 @@ +/******************************************************************************* + * Copyright (c) 2005, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +import org.eclipse.wst.jsdt.core.infer.InferredMethod; +import org.eclipse.wst.jsdt.core.infer.InferredType; + +/** + * Abstract representation of a Function declaration. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IAbstractFunctionDeclaration extends IStatement{ + + /** + * Set the function arguments + * @param args IArgument[] + */ + public void setArguments( IArgument[] args); + + /** + * Get the function arguments + * @return arguments + */ + public IArgument[] getArguments(); + + /** + * Get the function jsdoc + * @return jsdoc + */ + IJsDoc getJsDoc(); + + /** + * Get the function statements + * @return statements + */ + IProgramElement[] getStatements(); + + /** + * Get the function name + * + * @return name + */ + char[] getName(); + + /** + * Set the inferred return type + * + * @param inferred return type + */ + void setInferredType(InferredType type); + + /** + * Get the inferred return type for the function + * @return inferred type + */ + InferredType getInferredType(); + + /** + * Get the Inferred method associated with this function + * @return + */ + InferredMethod getInferredMethod(); +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IAbstractVariableDeclaration.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IAbstractVariableDeclaration.java new file mode 100644 index 0000000..ddc9b38 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IAbstractVariableDeclaration.java @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +import org.eclipse.wst.jsdt.core.infer.InferredType; +/** + * Abstract representation of a var. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IAbstractVariableDeclaration extends IStatement{ + /** + * Set the inferred type of the var + * @param inferred type + */ + public void setInferredType(InferredType type); + /** + * Get the inferred type of the var + * @return inferred type + */ + public InferredType getInferredType(); + /** + * get the var name + * @return name + */ + public char[] getName(); + /** + * Get the initialization expression of the var + * @return initialization expression + */ + public IExpression getInitialization(); + /** + * get the JSDoc for the var + * @return jsdoc + */ + public IJsDoc getJsDoc(); + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IAllocationExpression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IAllocationExpression.java new file mode 100644 index 0000000..058d59c --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IAllocationExpression.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * Representation of a new expression + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IAllocationExpression { + + /** + * The expression being allocated + * @return + */ + IExpression getMember(); + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArgument.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArgument.java new file mode 100644 index 0000000..38487b3 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArgument.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +import org.eclipse.wst.jsdt.internal.compiler.lookup.MethodScope; +import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding; + +/** + * Representation of a function argument + *

+ * This interface is not intended to be implemented by clients. + *

+* Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IArgument extends ILocalDeclaration{ + + public char[] getComment(); + public abstract void bind(MethodScope scope, TypeBinding typeBinding, boolean used); + public abstract StringBuffer print(int indent, StringBuffer output); +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArrayAllocationExpression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArrayAllocationExpression.java new file mode 100644 index 0000000..983fd03 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArrayAllocationExpression.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IArrayAllocationExpression extends IExpression{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArrayInitializer.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArrayInitializer.java new file mode 100644 index 0000000..92dce68 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArrayInitializer.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * representation of an array initializer + *

+ * This interface is not intended to be implemented by clients. + *

+* Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IArrayInitializer extends IExpression{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArrayQualifiedTypeReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArrayQualifiedTypeReference.java new file mode 100644 index 0000000..aa02642 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArrayQualifiedTypeReference.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + *

+ * This interface is not intended to be implemented by clients. + *

+* Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IArrayQualifiedTypeReference extends IQualifiedTypeReference{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArrayReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArrayReference.java new file mode 100644 index 0000000..e298f77 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArrayReference.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * Representation of an array reference + *

+ * This interface is not intended to be implemented by clients. + *

+* Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IArrayReference extends IReference{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArrayTypeReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArrayTypeReference.java new file mode 100644 index 0000000..75ef4a2 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IArrayTypeReference.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + *

+ * This interface is not intended to be implemented by clients. + *

+* Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IArrayTypeReference extends ISingleTypeReference { + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IAssignment.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IAssignment.java new file mode 100644 index 0000000..ee31a8d --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IAssignment.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2005, 2010 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +import org.eclipse.wst.jsdt.core.infer.InferredType; + +/** + * Representation of an assignment expression + *

+ * This interface is not intended to be implemented by clients. + *

+* Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IAssignment extends IExpression { + + /** + * get the expression being assigned + * @return expression + */ + IExpression getExpression(); + + /** + * The assignment target + * @return + */ + IExpression getLeftHandSide(); + + IJsDoc getJsDoc(); + + /** + * Set the inferred type of the assignment + * @param inferred type + */ + public void setInferredType(InferredType type); + /** + * Get the inferred type of the assignment + * @return inferred type + */ + public InferredType getInferredType(); + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IBinaryExpression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IBinaryExpression.java new file mode 100644 index 0000000..47c9186 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IBinaryExpression.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2010 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * Representation of binary expressions + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IBinaryExpression extends IOperatorExpression{ + public IExpression getLeft(); + public IExpression getRight(); +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IBlock.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IBlock.java new file mode 100644 index 0000000..5979000 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IBlock.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2005, 2010 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * Representation of blocks of statements. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IBlock extends IStatement { + public IStatement[] getStatements() ; +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IBranchStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IBranchStatement.java new file mode 100644 index 0000000..68cd4c5 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IBranchStatement.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a branch statement. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IBranchStatement extends IStatement { + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IBreakStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IBreakStatement.java new file mode 100644 index 0000000..c875f58 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IBreakStatement.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a break statment. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IBreakStatement extends IBranchStatement{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ICaseStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ICaseStatement.java new file mode 100644 index 0000000..c2e6a0c --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ICaseStatement.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a case statement. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface ICaseStatement extends IStatement{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ICombinedBinaryExpression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ICombinedBinaryExpression.java new file mode 100644 index 0000000..0fd006a --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ICombinedBinaryExpression.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of binary expression. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface ICombinedBinaryExpression extends IBinaryExpression{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ICompoundAssignment.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ICompoundAssignment.java new file mode 100644 index 0000000..27e70d6 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ICompoundAssignment.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + + +/** + * + * Representation of a compound assigment. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface ICompoundAssignment extends IAssignment { + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IConditionalExpression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IConditionalExpression.java new file mode 100644 index 0000000..0bebc76 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IConditionalExpression.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a conditional expression. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IConditionalExpression extends IOperatorExpression { + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IConstructorDeclaration.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IConstructorDeclaration.java new file mode 100644 index 0000000..2dc8647 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IConstructorDeclaration.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a constructor declaration. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IConstructorDeclaration extends IAbstractFunctionDeclaration{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IContinueStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IContinueStatement.java new file mode 100644 index 0000000..fbca0ec --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IContinueStatement.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a continue statement. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IContinueStatement extends IBranchStatement{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IDebuggerStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IDebuggerStatement.java new file mode 100644 index 0000000..94c32cd --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IDebuggerStatement.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a debugger statement (debugger;). + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IDebuggerStatement extends IStatement { + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IDoStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IDoStatement.java new file mode 100644 index 0000000..203d546 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IDoStatement.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a do statement. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IDoStatement extends IStatement{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IDoubleLiteral.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IDoubleLiteral.java new file mode 100644 index 0000000..b1b9bc1 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IDoubleLiteral.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IDoubleLiteral extends INumberLiteral{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IEmptyExpression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IEmptyExpression.java new file mode 100644 index 0000000..7786e7b --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IEmptyExpression.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of an empty expression. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IEmptyExpression extends IExpression{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IEmptyStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IEmptyStatement.java new file mode 100644 index 0000000..b13abe0 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IEmptyStatement.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of an empty statement (;). + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IEmptyStatement extends IStatement { + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IEqualExpression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IEqualExpression.java new file mode 100644 index 0000000..037bbf7 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IEqualExpression.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + + +/** + * + * Representation of = expression. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IEqualExpression extends IBinaryExpression{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IExplicitConstructorCall.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IExplicitConstructorCall.java new file mode 100644 index 0000000..c55570f --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IExplicitConstructorCall.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of constructor call. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IExplicitConstructorCall extends IStatement{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IExpression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IExpression.java new file mode 100644 index 0000000..d6472df --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IExpression.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Abstract base class for expression elements. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IExpression extends IStatement{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IExtendedStringLiteral.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IExtendedStringLiteral.java new file mode 100644 index 0000000..7f02874 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IExtendedStringLiteral.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a string literal. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IExtendedStringLiteral extends IStringLiteral{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFalseLiteral.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFalseLiteral.java new file mode 100644 index 0000000..47351ff --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFalseLiteral.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of the false literal. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IFalseLiteral extends IMagicLiteral { + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFieldDeclaration.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFieldDeclaration.java new file mode 100644 index 0000000..e994126 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFieldDeclaration.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IFieldDeclaration extends IAbstractVariableDeclaration{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFieldReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFieldReference.java new file mode 100644 index 0000000..96f88dc --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFieldReference.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2005, 2010 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a field reference. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IFieldReference extends IReference{ + public IExpression getReceiver(); + char[] getToken(); +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IForInStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IForInStatement.java new file mode 100644 index 0000000..c403d99 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IForInStatement.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of for .. in statement. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IForInStatement extends IStatement{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IForStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IForStatement.java new file mode 100644 index 0000000..03bea0c --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IForStatement.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a for statement. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IForStatement extends IStatement{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IForeachStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IForeachStatement.java new file mode 100644 index 0000000..aa1fafe --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IForeachStatement.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IForeachStatement extends IStatement{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFunctionCall.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFunctionCall.java new file mode 100644 index 0000000..967f1e0 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFunctionCall.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a function call. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IFunctionCall extends IExpression{ + public char[] getSelector(); + public IExpression[] getArguments(); + public IExpression getReceiver(); +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFunctionDeclaration.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFunctionDeclaration.java new file mode 100644 index 0000000..9f90e27 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFunctionDeclaration.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * Representation of a function declaration. + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IFunctionDeclaration extends IAbstractFunctionDeclaration{ +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFunctionExpression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFunctionExpression.java new file mode 100644 index 0000000..47e4b7f --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IFunctionExpression.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +import org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration; + +/** + * Representation of a function expression ( function (){}). + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IFunctionExpression extends IExpression{ + + public void setMethodDeclaration(MethodDeclaration methodDeclaration); + public MethodDeclaration getMethodDeclaration(); + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IIfStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IIfStatement.java new file mode 100644 index 0000000..4d5bdd1 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IIfStatement.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of an if statement. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IIfStatement extends IStatement{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IImportReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IImportReference.java new file mode 100644 index 0000000..ca7fe0e --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IImportReference.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IImportReference extends IASTNode{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IInitializer.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IInitializer.java new file mode 100644 index 0000000..14b6e84 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IInitializer.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IInitializer extends IFieldDeclaration{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IInstanceOfExpression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IInstanceOfExpression.java new file mode 100644 index 0000000..7041185 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IInstanceOfExpression.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IInstanceOfExpression extends IOperatorExpression{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IIntLiteral.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IIntLiteral.java new file mode 100644 index 0000000..ad8c50a --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IIntLiteral.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IIntLiteral extends INumberLiteral{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IIntLiteralMinValue.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IIntLiteralMinValue.java new file mode 100644 index 0000000..bf53a94 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IIntLiteralMinValue.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IIntLiteralMinValue extends IIntLiteral{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDoc.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDoc.java new file mode 100644 index 0000000..665ce92 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDoc.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a jsdoc comment. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IJsDoc extends IASTNode{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocAllocationExpression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocAllocationExpression.java new file mode 100644 index 0000000..45edb20 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocAllocationExpression.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IJsDocAllocationExpression extends IAllocationExpression{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocArgumentExpression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocArgumentExpression.java new file mode 100644 index 0000000..2f1f3f0 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocArgumentExpression.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IJsDocArgumentExpression extends IExpression{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocArrayQualifiedTypeReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocArrayQualifiedTypeReference.java new file mode 100644 index 0000000..0b1dfa4 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocArrayQualifiedTypeReference.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IJsDocArrayQualifiedTypeReference extends IArrayQualifiedTypeReference { + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocArraySingleTypeReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocArraySingleTypeReference.java new file mode 100644 index 0000000..c2608fb --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocArraySingleTypeReference.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IJsDocArraySingleTypeReference extends IArrayTypeReference{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocFieldReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocFieldReference.java new file mode 100644 index 0000000..59db014 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocFieldReference.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IJsDocFieldReference extends IFieldReference{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocImplicitTypeReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocImplicitTypeReference.java new file mode 100644 index 0000000..ce93950 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocImplicitTypeReference.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IJsDocImplicitTypeReference extends ITypeReference{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocMessageSend.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocMessageSend.java new file mode 100644 index 0000000..6b6d70a --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocMessageSend.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IJsDocMessageSend extends IFunctionCall{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocQualifiedTypeReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocQualifiedTypeReference.java new file mode 100644 index 0000000..913d529 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocQualifiedTypeReference.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + + +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IJsDocQualifiedTypeReference extends IQualifiedTypeReference{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocReturnStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocReturnStatement.java new file mode 100644 index 0000000..71c8e03 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocReturnStatement.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IJsDocReturnStatement extends IReturnStatement{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocSingleNameReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocSingleNameReference.java new file mode 100644 index 0000000..71c45ff --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocSingleNameReference.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IJsDocSingleNameReference extends ISingleNameReference{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocSingleTypeReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocSingleTypeReference.java new file mode 100644 index 0000000..e1b2039 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IJsDocSingleTypeReference.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IJsDocSingleTypeReference extends ISingleTypeReference{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ILabeledStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ILabeledStatement.java new file mode 100644 index 0000000..a060b5e --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ILabeledStatement.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a labeled statement. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface ILabeledStatement extends IStatement{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IListExpression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IListExpression.java new file mode 100644 index 0000000..4f28b28 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IListExpression.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of list expression. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IListExpression extends IExpression{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ILiteral.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ILiteral.java new file mode 100644 index 0000000..8698068 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ILiteral.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Abstract base class for literals. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface ILiteral extends IExpression { + + public abstract char[] source(); +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ILocalDeclaration.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ILocalDeclaration.java new file mode 100644 index 0000000..4a92fe6 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ILocalDeclaration.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2005, 2010 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +import org.eclipse.wst.jsdt.internal.compiler.lookup.InvocationSite; +import org.eclipse.wst.jsdt.internal.compiler.lookup.LocalVariableBinding; + +/** + * + * Representation of a local var declaration. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface ILocalDeclaration extends InvocationSite, IAbstractVariableDeclaration { + public void setBinding(LocalVariableBinding binding); + public LocalVariableBinding getBinding(); + /** + * Get the initialization expression of the var as an assignment + * @return initialization assignment expression or null + */ + public IAssignment getAssignment(); +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IMagicLiteral.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IMagicLiteral.java new file mode 100644 index 0000000..a6e87f6 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IMagicLiteral.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IMagicLiteral extends ILiteral{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/INameReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/INameReference.java new file mode 100644 index 0000000..7b289bf --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/INameReference.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Abstract base class for references. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface INameReference extends IReference{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/INullLiteral.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/INullLiteral.java new file mode 100644 index 0000000..c58d606 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/INullLiteral.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of the null literal. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface INullLiteral extends IMagicLiteral{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/INumberLiteral.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/INumberLiteral.java new file mode 100644 index 0000000..dc50387 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/INumberLiteral.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a numeric literal. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface INumberLiteral extends ILiteral{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IOR_OR_Expression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IOR_OR_Expression.java new file mode 100644 index 0000000..a9d7966 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IOR_OR_Expression.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of an or or (||) expression. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IOR_OR_Expression extends IBinaryExpression{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IObjectLiteral.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IObjectLiteral.java new file mode 100644 index 0000000..711c582 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IObjectLiteral.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +import org.eclipse.wst.jsdt.core.infer.InferredType; + +/** + * + * Representation of an Object literal. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IObjectLiteral extends IExpression { + public InferredType getInferredType(); + public void setInferredType(InferredType type); + public IObjectLiteralField[] getFields(); + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IObjectLiteralField.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IObjectLiteralField.java new file mode 100644 index 0000000..c0ac65b --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IObjectLiteralField.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of an object literal field. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IObjectLiteralField extends IExpression{ + public IExpression getFieldName(); + public IExpression getInitializer(); + public IJsDoc getJsDoc(); +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IOperatorExpression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IOperatorExpression.java new file mode 100644 index 0000000..37a7c78 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IOperatorExpression.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2010 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of an Operator expression. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IOperatorExpression extends IExpression { + public int getOperator(); +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IPostfixExpression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IPostfixExpression.java new file mode 100644 index 0000000..1a236e5 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IPostfixExpression.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a postfix expression. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IPostfixExpression extends ICompoundAssignment{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IPrefixExpression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IPrefixExpression.java new file mode 100644 index 0000000..e1ab94f --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IPrefixExpression.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a prefix expression. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IPrefixExpression extends ICompoundAssignment{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IProgramElement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IProgramElement.java new file mode 100644 index 0000000..5987ba3 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IProgramElement.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Abstract base class for most AST nodes. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IProgramElement extends IASTNode{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IQualifiedAllocationExpression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IQualifiedAllocationExpression.java new file mode 100644 index 0000000..bd79de4 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IQualifiedAllocationExpression.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IQualifiedAllocationExpression extends IAllocationExpression{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IQualifiedNameReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IQualifiedNameReference.java new file mode 100644 index 0000000..1bed12c --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IQualifiedNameReference.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IQualifiedNameReference extends INameReference{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IQualifiedThisReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IQualifiedThisReference.java new file mode 100644 index 0000000..b7a7abc --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IQualifiedThisReference.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IQualifiedThisReference extends IThisReference{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IQualifiedTypeReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IQualifiedTypeReference.java new file mode 100644 index 0000000..50df1b6 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IQualifiedTypeReference.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IQualifiedTypeReference extends ITypeReference{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IReference.java new file mode 100644 index 0000000..0e37db4 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IReference.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Abstract base class for references. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IReference extends IExpression{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IRegExLiteral.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IRegExLiteral.java new file mode 100644 index 0000000..5d7001b --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IRegExLiteral.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a regular expression literal. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IRegExLiteral extends ILiteral{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IReturnStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IReturnStatement.java new file mode 100644 index 0000000..6dabd13 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IReturnStatement.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a return statement. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IReturnStatement extends IStatement { + + IExpression getExpression(); + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IScriptFileDeclaration.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IScriptFileDeclaration.java new file mode 100644 index 0000000..1abb9a0 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IScriptFileDeclaration.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2005, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of javascript file. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IScriptFileDeclaration extends IASTNode{ + + IProgramElement []getStatements(); + + /** + * get the filename for the script if it can be determined + * @return the scripts file name, this could be null + */ + char[] getFileName(); + + /** + * get the inference ID for the script if it is located in a container that specified an Inference ID + * @return the inference ID for the script, could be null + */ + String getInferenceID(); + + public void addImport(char [] importName, int startPosition, int endPosition, int nameStartPosition); + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ISingleNameReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ISingleNameReference.java new file mode 100644 index 0000000..b037d88 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ISingleNameReference.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of name reference. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface ISingleNameReference extends INameReference{ + public char[] getToken(); + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ISingleTypeReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ISingleTypeReference.java new file mode 100644 index 0000000..b0a5bfb --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ISingleTypeReference.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; +/** + * + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface ISingleTypeReference extends ITypeReference{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IStatement.java new file mode 100644 index 0000000..3eda7cb --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IStatement.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Abstract base for statements. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IStatement extends IProgramElement{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IStringLiteral.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IStringLiteral.java new file mode 100644 index 0000000..7dc6ab7 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IStringLiteral.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a string literal. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IStringLiteral extends ILiteral{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IStringLiteralConcatenation.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IStringLiteralConcatenation.java new file mode 100644 index 0000000..447cf19 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IStringLiteralConcatenation.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a string literal. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IStringLiteralConcatenation extends IStringLiteral{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ISubRoutineStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ISubRoutineStatement.java new file mode 100644 index 0000000..afca555 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ISubRoutineStatement.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface ISubRoutineStatement extends IStatement{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ISuperReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ISuperReference.java new file mode 100644 index 0000000..af53982 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ISuperReference.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface ISuperReference extends IThisReference{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ISwitchStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ISwitchStatement.java new file mode 100644 index 0000000..389b8e9 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ISwitchStatement.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a switch statement. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface ISwitchStatement extends IStatement{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IThisReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IThisReference.java new file mode 100644 index 0000000..6d61e90 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IThisReference.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a 'this' reference . + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IThisReference extends IReference{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IThrowStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IThrowStatement.java new file mode 100644 index 0000000..2102d53 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IThrowStatement.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a throw statement. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IThrowStatement extends IStatement{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ITrueLiteral.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ITrueLiteral.java new file mode 100644 index 0000000..f6e91f8 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ITrueLiteral.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of the 'true' literal. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface ITrueLiteral extends IMagicLiteral{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ITryStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ITryStatement.java new file mode 100644 index 0000000..c88fef6 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ITryStatement.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a try statement. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface ITryStatement extends ISubRoutineStatement{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ITypeDeclaration.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ITypeDeclaration.java new file mode 100644 index 0000000..af5943b --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ITypeDeclaration.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface ITypeDeclaration extends IStatement{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ITypeReference.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ITypeReference.java new file mode 100644 index 0000000..ed76eb8 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/ITypeReference.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface ITypeReference extends IExpression { + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IUnaryExpression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IUnaryExpression.java new file mode 100644 index 0000000..3bbf6eb --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IUnaryExpression.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2010 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a unary expression. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IUnaryExpression extends IOperatorExpression{ + public IExpression getExpression(); +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IUndefinedLiteral.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IUndefinedLiteral.java new file mode 100644 index 0000000..2c75df5 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IUndefinedLiteral.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a the 'undefined' literal. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IUndefinedLiteral extends IMagicLiteral { + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IWhileStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IWhileStatement.java new file mode 100644 index 0000000..94e9276 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IWhileStatement.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of a while statement. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IWhileStatement extends IStatement{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IWithStatement.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IWithStatement.java new file mode 100644 index 0000000..d9ed8f3 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ast/IWithStatement.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.ast; + +/** + * + * Representation of the with statement. + *

+ * This interface is not intended to be implemented by clients. + *

+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ + +public interface IWithStatement extends IStatement{ + +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/BuildContext.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/BuildContext.java new file mode 100644 index 0000000..e14658c --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/BuildContext.java @@ -0,0 +1,133 @@ +/******************************************************************************* + * Copyright (c) 2006, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.compiler; + +import org.eclipse.core.resources.IFile; +import org.eclipse.wst.jsdt.internal.core.builder.ValidationParticipantResult; +import org.eclipse.wst.jsdt.internal.core.builder.SourceFile; + +/** + * The context of a validation event that is notified to interested validation + * participants when {@link ValidationParticipant#buildStarting(BuildContext[], boolean) a build is starting. + *

+ * This class is not intended to be instanciated or subclassed by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public class BuildContext extends ValidationParticipantResult { + +/** + * Creates a build context for the given source file. + *

+ * This constructor is not intended to be called by clients. + *

+ * + * @param sourceFile the source file being built + */ +public BuildContext(SourceFile sourceFile) { + super(sourceFile); +} + +/** + * Returns the contents of the javaScript unit. + * + * @return the contents of the javaScript unit + */ +public char[] getContents() { + return this.sourceFile.getContents(); +} + +/** + * Returns the IFile representing the javaScript unit. + * + * @return the IFile representing the javaScript unit + */ +public IFile getFile() { + return this.sourceFile.resource; +} + +/** + * Record the added/changed generated files that need to be compiled. + * + * @param addedGeneratedFiles the added/changed files + */ +public void recordAddedGeneratedFiles(IFile[] addedGeneratedFiles) { + int length2 = addedGeneratedFiles.length; + if (length2 == 0) return; + + int length1 = this.addedFiles == null ? 0 : this.addedFiles.length; + IFile[] merged = new IFile[length1 + length2]; + if (length1 > 0) // always make a copy even if currently empty + System.arraycopy(this.addedFiles, 0, merged, 0, length1); + System.arraycopy(addedGeneratedFiles, 0, merged, length1, length2); + this.addedFiles = merged; +} + +/** + * Record the generated files that need to be deleted. + * + * @param deletedGeneratedFiles the files that need to be deleted + */ +public void recordDeletedGeneratedFiles(IFile[] deletedGeneratedFiles) { + int length2 = deletedGeneratedFiles.length; + if (length2 == 0) return; + + int length1 = this.deletedFiles == null ? 0 : this.deletedFiles.length; + IFile[] merged = new IFile[length1 + length2]; + if (length1 > 0) // always make a copy even if currently empty + System.arraycopy(this.deletedFiles, 0, merged, 0, length1); + System.arraycopy(deletedGeneratedFiles, 0, merged, length1, length2); + this.deletedFiles = merged; +} + +/** + * Record the fully-qualified type names of any new dependencies, each name is of the form "p1.p2.A.B". + * + * @param typeNameDependencies the fully-qualified type names of new dependencies + */ +public void recordDependencies(String[] typeNameDependencies) { + int length2 = typeNameDependencies.length; + if (length2 == 0) return; + + int length1 = this.dependencies == null ? 0 : this.dependencies.length; + String[] merged = new String[length1 + length2]; + if (length1 > 0) // always make a copy even if currently empty + System.arraycopy(this.dependencies, 0, merged, 0, length1); + System.arraycopy(typeNameDependencies, 0, merged, length1, length2); + this.dependencies = merged; +} + +/** + * Record new problems to report against this compilationUnit. + * Markers are persisted for these problems only for the declared managed marker type + * (see the 'validationParticipant' extension point). + * + * @param newProblems the problems to report + */ +public void recordNewProblems(CategorizedProblem[] newProblems) { + int length2 = newProblems.length; + if (length2 == 0) return; + + int length1 = this.problems == null ? 0 : this.problems.length; + CategorizedProblem[] merged = new CategorizedProblem[length1 + length2]; + if (length1 > 0) // always make a copy even if currently empty + System.arraycopy(this.problems, 0, merged, 0, length1); + System.arraycopy(newProblems, 0, merged, length1, length2); + this.problems = merged; +} + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/CategorizedProblem.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/CategorizedProblem.java new file mode 100644 index 0000000..9afa3eb --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/CategorizedProblem.java @@ -0,0 +1,153 @@ +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core.compiler; + +import org.eclipse.wst.jsdt.internal.compiler.problem.DefaultProblem; + +/** + * Richer description of a JavaScript problem, as detected by the compiler or some of the underlying + * technology reusing the compiler. With the introduction of validationParticipant, + * the simpler problem interface IProblem did not carry enough information to better + * separate and categorize JavaScript problems. In order to minimize impact on existing API, JavaScript problems + * are still passed around as IProblem, though actual implementations should explicitly + * extend CategorizedProblem. Participants can produce their own problem definitions, + * and given these are categorized problems, they can be better handled by clients (such as user + * interface). + * + * A categorized problem provides access to: + *
    + *
  • its location (originating source file name, source position, line number),
  • + *
  • its message description and a predicate to check its severity (warning or error).
  • + *
  • its ID : a number identifying the very nature of this problem. All possible IDs for standard JavaScript + * problems are listed as constants on IProblem,
  • + *
  • its marker type : a string identifying the problem creator. It corresponds to the marker type + * chosen if this problem was to be persisted. Standard JavaScript problems are associated to marker + * type "org.eclipse.wst.jsdt.core.problem"),
  • + *
  • its category ID : a number identifying the category this problem belongs to. All possible IDs for + * standard JavaScript problem categories are listed in this class.
  • + *
+ * + * Note: the compiler produces IProblems internally, which are turned into markers by the validator + * so as to persist problem descriptions. This explains why there is no API allowing to reach IProblem detected + * when validating. However, the JavaScript problem markers carry equivalent information to IProblem, in particular + * their ID (attribute "id") is set to one of the IDs defined on this interface. + * + * Note: Standard JavaScript problems produced by JavaScript default tooling will be subclasses of this class. Technically, most + * API methods dealing with problems are referring to IProblem for backward compatibility reason. + * It is intended that CategorizedProblem will be subclassed for custom problem implementation when + * participating in compilation operations, so as to allow participant to contribute their own marker types, and thus + * defining their own domain specific problem/category IDs. + * + * Note: standard JavaScript problems produced by JavaScript default tooling will set the + * marker IMarker#GENERATED_BY attribute to JavaBuilder#GENERATED_BY; compiler + * participants may specify the IMarker#GENERATED_BY attribute of their markers + * by adding it to the extra marker attributes of the problems they generate; + * markers resulting from compiler participants' problems that do not have the + * IMarker#GENERATED_BY extra attribute set do not have the IMarker#GENERATED_BY + * attribute set either. + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public abstract class CategorizedProblem implements IProblem { + + /** + * List of standard category IDs used by JavaScript problems, more categories will be added + * in the future. + */ + public static final int CAT_UNSPECIFIED = 0; + /** Category for problems related to buildpath */ + public static final int CAT_BUILDPATH = 10; + /** Category for fatal problems related to syntax */ + public static final int CAT_SYNTAX = 20; + /** Category for fatal problems in import statements */ + public static final int CAT_IMPORT = 30; + /** Category for fatal problems related to types, could be addressed by some type change */ + public static final int CAT_TYPE = 40; + /** Category for fatal problems related to type members, could be addressed by some field or method change */ + public static final int CAT_MEMBER = 50; + /** Category for fatal problems which could not be addressed by external changes, but require an edit to be addressed */ + public static final int CAT_INTERNAL = 60; + /** Category for optional problems in Javadoc */ + public static final int CAT_JAVADOC = 70; + /** Category for optional problems related to coding style practices */ + public static final int CAT_CODE_STYLE = 80; + /** Category for optional problems related to potential programming flaws */ + public static final int CAT_POTENTIAL_PROGRAMMING_PROBLEM = 90; + /** Category for optional problems related to naming conflicts */ + public static final int CAT_NAME_SHADOWING_CONFLICT = 100; + /** Category for optional problems related to unnecessary code */ + public static final int CAT_UNNECESSARY_CODE = 120; + /** Category for optional problems related to access restrictions */ + public static final int CAT_RESTRICTION = 150; + +/** + * Returns an integer identifying the category of this problem. Categories, like problem IDs are + * defined in the context of some marker type. Custom implementations of CategorizedProblem + * may choose arbitrary values for problem/category IDs, as long as they are associated with a different + * marker type. + * Standard JavaScript problem markers (i.e. marker type is "org.eclipse.wst.jsdt.core.problem") carry an + * attribute "categoryId" persisting the originating problem category ID as defined by this method). + * @return id - an integer identifying the category of this problem + */ +public abstract int getCategoryID(); + +/** + * Returns the marker type associated to this problem, if it gets persisted into a marker by the JavaBuilder + * Standard JavaScript problems are associated to marker type "org.eclipse.wst.jsdt.core.problem"). + * Note: problem markers are expected to extend "org.eclipse.core.resources.problemmarker" marker type. + * @return the type of the marker which would be associated to the problem + */ +public abstract String getMarkerType(); + +/** + * Returns the names of the extra marker attributes associated to this problem when persisted into a marker + * by the JavaBuilder. Extra attributes are only optional, and are allowing client customization of generated + * markers. By default, no EXTRA attributes is persisted, and a categorized problem only persists the following attributes: + *
    + *
  • IMarker#MESSAGE -> {@link IProblem#getMessage()}
  • + *
  • IMarker#SEVERITY -> IMarker#SEVERITY_ERROR or + * IMarker#SEVERITY_WARNING depending on {@link IProblem#isError()} or {@link IProblem#isWarning()}
  • + *
  • IJavaScriptModelMarker#ID -> {@link IProblem#getID()}
  • + *
  • IMarker#CHAR_START -> {@link IProblem#getSourceStart()}
  • + *
  • IMarker#CHAR_END -> {@link IProblem#getSourceEnd()}
  • + *
  • IMarker#LINE_NUMBER -> {@link IProblem#getSourceLineNumber()}
  • + *
  • IJavaScriptModelMarker#ARGUMENTS -> some String[] used to compute quickfixes
  • + *
  • IJavaScriptModelMarker#CATEGORY_ID -> {@link CategorizedProblem#getCategoryID()}
  • + *
+ * The names must be eligible for marker creation, as defined by IMarker#setAttributes(String[], Object[]), + * and there must be as many names as values according to {@link #getExtraMarkerAttributeValues()}. + * Note that extra marker attributes will be inserted after default ones (as described in {@link CategorizedProblem#getMarkerType()}, + * and thus could be used to override defaults. + * @return the names of the corresponding marker attributes + */ +public String[] getExtraMarkerAttributeNames() { + return CharOperation.NO_STRINGS; +} + +/** + * Returns the respective values for the extra marker attributes associated to this problem when persisted into + * a marker by the JavaBuilder. Each value must correspond to a matching attribute name, as defined by + * {@link #getExtraMarkerAttributeNames()}. + * The values must be eligible for marker creation, as defined by IMarker#setAttributes(String[], Object[]). + * @return the values of the corresponding extra marker attributes + */ +public Object[] getExtraMarkerAttributeValues() { + return DefaultProblem.EMPTY_VALUES; +} + +public void setMessage(String msg) +{ + +} +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/CharOperation.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/CharOperation.java new file mode 100644 index 0000000..4dc1e2d --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/CharOperation.java @@ -0,0 +1,3433 @@ +/******************************************************************************* + * Copyright (c) 2000, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * Luiz-Otavio Zorzella - Improve CamelCase algorithm + *******************************************************************************/ +package org.eclipse.wst.jsdt.core.compiler; + +import org.eclipse.wst.jsdt.internal.compiler.parser.ScannerHelper; + +/** + * This class is a collection of helper methods to manipulate char arrays. + *

+ * This class is not intended to be instantiated or subclassed by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public final class CharOperation { + + /** + * Constant for an empty char array + */ + public static final char[] NO_CHAR = new char[0]; + + /** + * Constant for an empty char array with two dimensions. + */ + public static final char[][] NO_CHAR_CHAR = new char[0][]; + + /** + * Constant for an empty String array. + */ + public static final String[] NO_STRINGS = new String[0]; + +/** + * Answers a new array with appending the suffix character at the end of the array. + *
+ *
+ * For example:
+ *
    + *
  1. + *    array = { 'a', 'b' }
    + *    suffix = 'c'
    + *    => result = { 'a', 'b' , 'c' }
    + * 
    + *
  2. + *
  3. + *    array = null
    + *    suffix = 'c'
    + *    => result = { 'c' }
    + * 
  4. + *
+ * + * @param array the array that is concanated with the suffix character + * @param suffix the suffix character + * @return the new array + */ +public static final char[] append(char[] array, char suffix) { + if (array == null) + return new char[] { suffix }; + int length = array.length; + System.arraycopy(array, 0, array = new char[length + 1], 0, length); + array[length] = suffix; + return array; +} + +/** + * Append the given subarray to the target array starting at the given index in the target array. + * The start of the subarray is inclusive, the end is exclusive. + * Answers a new target array if it needs to grow, otherwise answers the same target array. + *
+ * For example:
+ *
    + *
  1. + *    target = { 'a', 'b', '0' }
    + *    index = 2
    + *    array = { 'c', 'd' }
    + *    start = 0
    + *    end = 1
    + *    => result = { 'a', 'b' , 'c' }
    + * 
    + *
  2. + *
  3. + *    target = { 'a', 'b' }
    + *    index = 2
    + *    array = { 'c', 'd' }
    + *    start = 0
    + *    end = 1
    + *    => result = { 'a', 'b' , 'c', '0', '0' , '0' } (new array)
    + * 
  4. + *
  5. + *    target = { 'a', 'b', 'c' }
    + *    index = 1
    + *    array = { 'c', 'd', 'e', 'f' }
    + *    start = 1
    + *    end = 4
    + *    => result = { 'a', 'd' , 'e', 'f', '0', '0', '0', '0' } (new array)
    + * 
  6. + *
+ * + * @param target the given target + * @param index the given index + * @param array the given array + * @param start the given start index + * @param end the given end index + * + * @return the new array + * @throws NullPointerException if the target array is null + */ +public static final char[] append(char[] target, int index, char[] array, int start, int end) { + int targetLength = target.length; + int subLength = end-start; + int newTargetLength = subLength+index; + if (newTargetLength > targetLength) { + System.arraycopy(target, 0, target = new char[newTargetLength*2], 0, index); + } + System.arraycopy(array, start, target, index, subLength); + return target; +} + +/** + * Answers the concatenation of the two arrays. It answers null if the two arrays are null. + * If the first array is null, then the second array is returned. + * If the second array is null, then the first array is returned. + *
+ *
+ * For example: + *
    + *
  1. + *    first = null
    + *    second = null
    + *    => result = null
    + * 
    + *
  2. + *
  3. + *    first = { { ' a' } }
    + *    second = null
    + *    => result = { { ' a' } }
    + * 
    + *
  4. + *
  5. + *    first = null
    + *    second = { { ' a' } }
    + *    => result = { { ' a' } }
    + * 
    + *
  6. + *
  7. + *    first = { { ' b' } }
    + *    second = { { ' a' } }
    + *    => result = { { ' b' }, { ' a' } }
    + * 
    + *
  8. + *
+ * + * @param first the first array to concatenate + * @param second the second array to concatenate + * @return the concatenation of the two arrays, or null if the two arrays are null. + */ +public static final char[][] arrayConcat(char[][] first, char[][] second) { + if (first == null) + return second; + if (second == null) + return first; + + int length1 = first.length; + int length2 = second.length; + char[][] result = new char[length1 + length2][]; + System.arraycopy(first, 0, result, 0, length1); + System.arraycopy(second, 0, result, length1, length2); + return result; +} + +/** + * Answers true if the pattern matches the given name using CamelCase rules, or false otherwise. + * char[] CamelCase matching does NOT accept explicit wild-cards '*' and '?' and is inherently case sensitive. + *
+ * CamelCase denotes the convention of writing compound names without spaces, and capitalizing every term. + * This function recognizes both upper and lower CamelCase, depending whether the leading character is capitalized + * or not. The leading part of an upper CamelCase pattern is assumed to contain a sequence of capitals which are appearing + * in the matching name; e.g. 'NPE' will match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern + * uses a lowercase first character. + *
+ * The pattern may contain lowercase characters, which will be match in a case sensitive way. These characters must + * appear in sequence in the name. + *

+ * Examples: + *
    + *
  1. + *    pattern = { 'N', 'P', 'E' }
    + *    name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' }
    + *    result => true
    + * 
    + *
  2. + *
  3. + *    pattern = { 'N', 'P', 'E' }
    + *    name = { 'N', 'o', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' }
    + *    result => true
    + * 
    + *
  4. + *
  5. + *    pattern = { 'N', 'u', 'P', 'o', 'E', 'x' }
    + *    name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' }
    + *    result => true
    + * 
    + *
  6. + *
  7. + *    pattern = { 'N', 'u', 'P', 'o', 'E', 'x' }
    + *    name = { 'N', 'o', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' }
    + *    result => false
    + * 
    + *
  8. + *
  9. + *    pattern = { 'n', p', 'e' }
    + *    name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' }
    + *    result => false
    + * 
    + *
  10. + *
+ * + * @param pattern the given pattern + * @param name the given name + * @return true if the pattern matches the given name, false otherwise + */ +public static final boolean camelCaseMatch(char[] pattern, char[] name) { + if (pattern == null) + return true; // null pattern is equivalent to '*' + if (name == null) + return false; // null name cannot match + + return camelCaseMatch(pattern, 0, pattern.length, name, 0, name.length); +} + +/** + * Answers true if a sub-pattern matches the subpart of the given name using CamelCase rules, or false otherwise. + * char[] CamelCase matching does NOT accept explicit wild-cards '*' and '?' and is inherently case sensitive. + * Can match only subset of name/pattern, considering end positions as non-inclusive. + * The subpattern is defined by the patternStart and patternEnd positions. + *
+ * CamelCase denotes the convention of writing compound names without spaces, and capitalizing every term. + * This function recognizes both upper and lower CamelCase, depending whether the leading character is capitalized + * or not. The leading part of an upper CamelCase pattern is assumed to contain a sequence of capitals which are appearing + * in the matching name; e.g. 'NPE' will match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern + * uses a lowercase first character. In JavaScript, type names follow the upper CamelCase convention, whereas method or field + * names follow the lower CamelCase convention. + *
+ * The pattern may contain lowercase characters, which will be match in a case sensitive way. These characters must + * appear in sequence in the name. For instance, 'NPExcep' will match 'NullPointerException', but not 'NullPointerExCEPTION' + * or 'NuPoEx' will match 'NullPointerException', but not 'NoPointerException'. + *

+ * Examples: + *
    + *
  1. + *    pattern = { 'N', 'P', 'E' }
    + *    patternStart = 0
    + *    patternEnd = 3
    + *    name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' }
    + *    nameStart = 0
    + *    nameEnd = 20
    + *    result => true
    + * 
    + *
  2. + *
  3. + *    pattern = { 'N', 'P', 'E' }
    + *    patternStart = 0
    + *    patternEnd = 3
    + *    name = { 'N', 'o', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' }
    + *    nameStart = 0
    + *    nameEnd = 21
    + *    result => true
    + * 
    + *
  4. + *
  5. + *    pattern = { 'N', 'u', 'P', 'o', 'E', 'x' }
    + *    patternStart = 0
    + *    patternEnd = 6
    + *    name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' }
    + *    nameStart = 0
    + *    nameEnd = 20
    + *    result => true
    + * 
    + *
  6. + *
  7. + *    pattern = { 'N', 'u', 'P', 'o', 'E', 'x' }
    + *    patternStart = 0
    + *    patternEnd = 6
    + *    name = { 'N', 'o', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' }
    + *    nameStart = 0
    + *    nameEnd = 21
    + *    result => false
    + * 
    + *
  8. + *
  9. + *    pattern = { 'n', p', 'e' }
    + *    patternStart = 0
    + *    patternEnd = 3
    + *    name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' }
    + *    nameStart = 0
    + *    nameEnd = 20
    + *    result => false
    + * 
    + *
  10. + *
+ * + * @param pattern the given pattern + * @param patternStart the start index of the pattern, inclusive + * @param patternEnd the end index of the pattern, exclusive + * @param name the given name + * @param nameStart the start index of the name, inclusive + * @param nameEnd the end index of the name, exclusive + * @return true if a sub-pattern matches the subpart of the given name, false otherwise + */ +public static final boolean camelCaseMatch(char[] pattern, int patternStart, int patternEnd, char[] name, int nameStart, int nameEnd) { + if (name == null) + return false; // null name cannot match + if (pattern == null) + return true; // null pattern is equivalent to '*' + if (patternEnd < 0) patternEnd = pattern.length; + if (nameEnd < 0) nameEnd = name.length; + + if (patternEnd <= patternStart) return nameEnd <= nameStart; + if (nameEnd <= nameStart) return false; + // check first pattern char + if (name[nameStart] != pattern[patternStart]) { + // first char must strictly match (upper/lower) + return false; + } + + char patternChar, nameChar; + int iPattern = patternStart; + int iName = nameStart; + + // Main loop is on pattern characters + while (true) { + + iPattern++; + iName++; + + if (iPattern == patternEnd) { + // We have exhausted pattern, so it's a match + return true; + } + + if (iName == nameEnd){ + // We have exhausted name (and not pattern), so it's not a match + return false; + } + + // For as long as we're exactly matching, bring it on (even if it's a lower case character) + if ((patternChar = pattern[iPattern]) == name[iName]) { + continue; + } + + // If characters are not equals, then it's not a match if patternChar is lowercase + if (patternChar < ScannerHelper.MAX_OBVIOUS) { + if ((ScannerHelper.OBVIOUS_IDENT_CHAR_NATURES[patternChar] & ScannerHelper.C_UPPER_LETTER) == 0) { + return false; + } + } + else if (Character.isJavaIdentifierPart(patternChar) && !Character.isUpperCase(patternChar)) { + return false; + } + + // patternChar is uppercase, so let's find the next uppercase in name + while (true) { + if (iName == nameEnd){ + // We have exhausted name (and not pattern), so it's not a match + return false; + } + + nameChar = name[iName]; + if (nameChar < ScannerHelper.MAX_OBVIOUS) { + if ((ScannerHelper.OBVIOUS_IDENT_CHAR_NATURES[nameChar] & (ScannerHelper.C_LOWER_LETTER | ScannerHelper.C_SPECIAL | ScannerHelper.C_DIGIT)) != 0) { + // nameChar is lowercase + iName++; + // nameChar is uppercase... + } else if (patternChar != nameChar) { + //.. and it does not match patternChar, so it's not a match + return false; + } else { + //.. and it matched patternChar. Back to the big loop + break; + } + } + else if (Character.isJavaIdentifierPart(nameChar) && !Character.isUpperCase(nameChar)) { + // nameChar is lowercase + iName++; + // nameChar is uppercase... + } else if (patternChar != nameChar) { + //.. and it does not match patternChar, so it's not a match + return false; + } else { + //.. and it matched patternChar. Back to the big loop + break; + } + } + // At this point, either name has been exhausted, or it is at an uppercase letter. + // Since pattern is also at an uppercase letter + } +} + +/** + * Returns the char arrays as an array of Strings + * + * @param charArrays the char array to convert + * @return the char arrays as an array of Strings or null if the given char arrays is null. + */ +public static String[] charArrayToStringArray(char[][] charArrays) { + if (charArrays == null) + return null; + int length = charArrays.length; + if (length == 0) + return NO_STRINGS; + String[] strings= new String[length]; + for (int i= 0; i < length; i++) + strings[i]= new String(charArrays[i]); + return strings; +} + +/** + * Returns the char array as a String + + * @param charArray the char array to convert + * @return the char array as a String or null if the given char array is null. + */ +public static String charToString(char[] charArray) { + if (charArray == null) return null; + return new String(charArray); +} + +/** + * Answers a new array adding the second array at the end of first array. + * It answers null if the first and second are null. + * If the first array is null, then a new array char[][] is created with second. + * If the second array is null, then the first array is returned. + *
+ *
+ * For example: + *
    + *
  1. + *    first = null
    + *    second = { 'a' }
    + *    => result = { { ' a' } }
    + * 
    + *
  2. + *    first = { { ' a' } }
    + *    second = null
    + *    => result = { { ' a' } }
    + * 
    + *
  3. + *
  4. + *    first = { { ' a' } }
    + *    second = { ' b' }
    + *    => result = { { ' a' } , { ' b' } }
    + * 
    + *
  5. + *
+ * + * @param first the first array to concatenate + * @param second the array to add at the end of the first array + * @return a new array adding the second array at the end of first array, or null if the two arrays are null. + */ +public static final char[][] arrayConcat(char[][] first, char[] second) { + if (second == null) + return first; + if (first == null) + return new char[][] { second }; + + int length = first.length; + char[][] result = new char[length + 1][]; + System.arraycopy(first, 0, result, 0, length); + result[length] = second; + return result; +} +/** + * Compares the two char arrays lexicographically. + * + * Returns a negative integer if array1 lexicographically precedes the array2, + * a positive integer if this array1 lexicographically follows the array2, or + * zero if both arrays are equal. + * + * @param array1 the first given array + * @param array2 the second given array + * @return the returned value of the comparison between array1 and array2 + * @throws NullPointerException if one of the arrays is null + */ +public static final int compareTo(char[] array1, char[] array2) { + int length1 = array1.length; + int length2 = array2.length; + int min = Math.min(length1, length2); + for (int i = 0; i < min; i++) { + if (array1[i] != array2[i]) { + return array1[i] - array2[i]; + } + } + return length1 - length2; +} +/** + * Compares the contents of the two arrays array and prefix. Returns + *
    + *
  • zero if the array starts with the prefix contents
  • + *
  • the difference between the first two characters that are not equal
  • + *
  • one if array length is lower than the prefix length and that the prefix starts with the + * array contents.
  • + *
+ *

+ * For example: + *

    + *
  1. + *    array = null
    + *    prefix = null
    + *    => result = NullPointerException
    + * 
    + *
  2. + *
  3. + *    array = { 'a', 'b', 'c', 'd', 'e' }
    + *    prefix = { 'a', 'b', 'c'}
    + *    => result = 0
    + * 
    + *
  4. + *
  5. + *    array = { 'a', 'b', 'c', 'd', 'e' }
    + *    prefix = { 'a', 'B', 'c'}
    + *    => result = 32
    + * 
    + *
  6. + *
  7. + *    array = { 'd', 'b', 'c', 'd', 'e' }
    + *    prefix = { 'a', 'b', 'c'}
    + *    => result = 3
    + * 
    + *
  8. + *
  9. + *    array = { 'a', 'b', 'c', 'd', 'e' }
    + *    prefix = { 'd', 'b', 'c'}
    + *    => result = -3
    + * 
    + *
  10. + *
  11. + *    array = { 'a', 'a', 'c', 'd', 'e' }
    + *    prefix = { 'a', 'e', 'c'}
    + *    => result = -4
    + * 
    + *
  12. + *
+ *

+ * + * @param array the given array + * @param prefix the given prefix + * @return the result of the comparison (>=0 if array>prefix) + * @throws NullPointerException if either array or prefix is null + */ +public static final int compareWith(char[] array, char[] prefix) { + int arrayLength = array.length; + int prefixLength = prefix.length; + int min = Math.min(arrayLength, prefixLength); + int i = 0; + while (min-- != 0) { + char c1 = array[i]; + char c2 = prefix[i++]; + if (c1 != c2) + return c1 - c2; + } + if (prefixLength == i) + return 0; + return -1; // array is shorter than prefix (e.g. array:'ab' < prefix:'abc'). +} + +/** + * Answers the concatenation of the two arrays. It answers null if the two arrays are null. + * If the first array is null, then the second array is returned. + * If the second array is null, then the first array is returned. + *
+ *
+ * For example: + *
    + *
  1. + *    first = null
    + *    second = { 'a' }
    + *    => result = { ' a' }
    + * 
    + *
  2. + *
  3. + *    first = { ' a' }
    + *    second = null
    + *    => result = { ' a' }
    + * 
    + *
  4. + *
  5. + *    first = { ' a' }
    + *    second = { ' b' }
    + *    => result = { ' a' , ' b' }
    + * 
    + *
  6. + *
+ * + * @param first the first array to concatenate + * @param second the second array to concatenate + * @return the concatenation of the two arrays, or null if the two arrays are null. + */ +public static final char[] concat(char[] first, char[] second) { + if (first == null) + return second; + if (second == null) + return first; + + int length1 = first.length; + int length2 = second.length; + char[] result = new char[length1 + length2]; + System.arraycopy(first, 0, result, 0, length1); + System.arraycopy(second, 0, result, length1, length2); + return result; +} + +/** + * Answers the concatenation of the three arrays. It answers null if the three arrays are null. + * If first is null, it answers the concatenation of second and third. + * If second is null, it answers the concatenation of first and third. + * If third is null, it answers the concatenation of first and second. + *
+ *
+ * For example: + *
    + *
  1. + *    first = null
    + *    second = { 'a' }
    + *    third = { 'b' }
    + *    => result = { ' a', 'b' }
    + * 
    + *
  2. + *
  3. + *    first = { 'a' }
    + *    second = null
    + *    third = { 'b' }
    + *    => result = { ' a', 'b' }
    + * 
    + *
  4. + *
  5. + *    first = { 'a' }
    + *    second = { 'b' }
    + *    third = null
    + *    => result = { ' a', 'b' }
    + * 
    + *
  6. + *
  7. + *    first = null
    + *    second = null
    + *    third = null
    + *    => result = null
    + * 
    + *
  8. + *
  9. + *    first = { 'a' }
    + *    second = { 'b' }
    + *    third = { 'c' }
    + *    => result = { 'a', 'b', 'c' }
    + * 
    + *
  10. + *
+ * + * @param first the first array to concatenate + * @param second the second array to concatenate + * @param third the third array to concatenate + * + * @return the concatenation of the three arrays, or null if the three arrays are null. + */ +public static final char[] concat( + char[] first, + char[] second, + char[] third) { + if (first == null) + return concat(second, third); + if (second == null) + return concat(first, third); + if (third == null) + return concat(first, second); + + int length1 = first.length; + int length2 = second.length; + int length3 = third.length; + char[] result = new char[length1 + length2 + length3]; + System.arraycopy(first, 0, result, 0, length1); + System.arraycopy(second, 0, result, length1, length2); + System.arraycopy(third, 0, result, length1 + length2, length3); + return result; +} + +/** + * Answers the concatenation of the two arrays inserting the separator character between the two arrays. + * It answers null if the two arrays are null. + * If the first array is null, then the second array is returned. + * If the second array is null, then the first array is returned. + *
+ *
+ * For example: + *
    + *
  1. + *    first = null
    + *    second = { 'a' }
    + *    separator = '/'
    + *    => result = { ' a' }
    + * 
    + *
  2. + *
  3. + *    first = { ' a' }
    + *    second = null
    + *    separator = '/'
    + *    => result = { ' a' }
    + * 
    + *
  4. + *
  5. + *    first = { ' a' }
    + *    second = { ' b' }
    + *    separator = '/'
    + *    => result = { ' a' , '/', 'b' }
    + * 
    + *
  6. + *
+ * + * @param first the first array to concatenate + * @param second the second array to concatenate + * @param separator the character to insert + * @return the concatenation of the two arrays inserting the separator character + * between the two arrays , or null if the two arrays are null. + */ +public static final char[] concat( + char[] first, + char[] second, + char separator) { + if (first == null) + return second; + if (second == null) + return first; + + int length1 = first.length; + if (length1 == 0) + return second; + int length2 = second.length; + if (length2 == 0) + return first; + + char[] result = new char[length1 + length2 + 1]; + System.arraycopy(first, 0, result, 0, length1); + result[length1] = separator; + System.arraycopy(second, 0, result, length1 + 1, length2); + return result; +} + +/** + * Answers the concatenation of the three arrays inserting the sep1 character between the + * first two arrays and sep2 between the last two. + * It answers null if the three arrays are null. + * If the first array is null, then it answers the concatenation of second and third inserting + * the sep2 character between them. + * If the second array is null, then it answers the concatenation of first and third inserting + * the sep1 character between them. + * If the third array is null, then it answers the concatenation of first and second inserting + * the sep1 character between them. + *
+ *
+ * For example: + *
    + *
  1. + *    first = null
    + *    sep1 = '/'
    + *    second = { 'a' }
    + *    sep2 = ':'
    + *    third = { 'b' }
    + *    => result = { ' a' , ':', 'b' }
    + * 
    + *
  2. + *
  3. + *    first = { 'a' }
    + *    sep1 = '/'
    + *    second = null
    + *    sep2 = ':'
    + *    third = { 'b' }
    + *    => result = { ' a' , '/', 'b' }
    + * 
    + *
  4. + *
  5. + *    first = { 'a' }
    + *    sep1 = '/'
    + *    second = { 'b' }
    + *    sep2 = ':'
    + *    third = null
    + *    => result = { ' a' , '/', 'b' }
    + * 
    + *
  6. + *
  7. + *    first = { 'a' }
    + *    sep1 = '/'
    + *    second = { 'b' }
    + *    sep2 = ':'
    + *    third = { 'c' }
    + *    => result = { ' a' , '/', 'b' , ':', 'c' }
    + * 
    + *
  8. + *
+ * + * @param first the first array to concatenate + * @param sep1 the character to insert + * @param second the second array to concatenate + * @param sep2 the character to insert + * @param third the second array to concatenate + * @return the concatenation of the three arrays inserting the sep1 character between the + * two arrays and sep2 between the last two. + */ +public static final char[] concat( + char[] first, + char sep1, + char[] second, + char sep2, + char[] third) { + if (first == null) + return concat(second, third, sep2); + if (second == null) + return concat(first, third, sep1); + if (third == null) + return concat(first, second, sep1); + + int length1 = first.length; + int length2 = second.length; + int length3 = third.length; + char[] result = new char[length1 + length2 + length3 + 2]; + System.arraycopy(first, 0, result, 0, length1); + result[length1] = sep1; + System.arraycopy(second, 0, result, length1 + 1, length2); + result[length1 + length2 + 1] = sep2; + System.arraycopy(third, 0, result, length1 + length2 + 2, length3); + return result; +} + +/** + * Answers a new array with prepending the prefix character and appending the suffix + * character at the end of the array. If array is null, it answers a new array containing the + * prefix and the suffix characters. + *
+ *
+ * For example:
+ *
    + *
  1. + *    prefix = 'a'
    + *    array = { 'b' }
    + *    suffix = 'c'
    + *    => result = { 'a', 'b' , 'c' }
    + * 
    + *
  2. + *
  3. + *    prefix = 'a'
    + *    array = null
    + *    suffix = 'c'
    + *    => result = { 'a', 'c' }
    + * 
  4. + *
+ * + * @param prefix the prefix character + * @param array the array that is concanated with the prefix and suffix characters + * @param suffix the suffix character + * @return the new array + */ +public static final char[] concat(char prefix, char[] array, char suffix) { + if (array == null) + return new char[] { prefix, suffix }; + + int length = array.length; + char[] result = new char[length + 2]; + result[0] = prefix; + System.arraycopy(array, 0, result, 1, length); + result[length + 1] = suffix; + return result; +} + +/** + * Answers the concatenation of the given array parts using the given separator between each + * part and appending the given name at the end. + *
+ *
+ * For example:
+ *
    + *
  1. + *    name = { 'c' }
    + *    array = { { 'a' }, { 'b' } }
    + *    separator = '.'
    + *    => result = { 'a', '.', 'b' , '.', 'c' }
    + * 
    + *
  2. + *
  3. + *    name = null
    + *    array = { { 'a' }, { 'b' } }
    + *    separator = '.'
    + *    => result = { 'a', '.', 'b' }
    + * 
  4. + *
  5. + *    name = { ' c' }
    + *    array = null
    + *    separator = '.'
    + *    => result = { 'c' }
    + * 
  6. + *
+ * + * @param name the given name + * @param array the given array + * @param separator the given separator + * @return the concatenation of the given array parts using the given separator between each + * part and appending the given name at the end + */ +public static final char[] concatWith( + char[] name, + char[][] array, + char separator) { + int nameLength = name == null ? 0 : name.length; + if (nameLength == 0) + return concatWith(array, separator); + + int length = array == null ? 0 : array.length; + if (length == 0) + return name; + + int size = nameLength; + int index = length; + while (--index >= 0) + if (array[index].length > 0) + size += array[index].length + 1; + char[] result = new char[size]; + index = size; + for (int i = length - 1; i >= 0; i--) { + int subLength = array[i].length; + if (subLength > 0) { + index -= subLength; + System.arraycopy(array[i], 0, result, index, subLength); + result[--index] = separator; + } + } + System.arraycopy(name, 0, result, 0, nameLength); + return result; +} + +/** + * Answers the concatenation of the given array parts using the given separator between each + * part and appending the given name at the end. + *
+ *
+ * For example:
+ *
    + *
  1. + *    name = { 'c' }
    + *    array = { { 'a' }, { 'b' } }
    + *    separator = '.'
    + *    => result = { 'a', '.', 'b' , '.', 'c' }
    + * 
    + *
  2. + *
  3. + *    name = null
    + *    array = { { 'a' }, { 'b' } }
    + *    separator = '.'
    + *    => result = { 'a', '.', 'b' }
    + * 
  4. + *
  5. + *    name = { ' c' }
    + *    array = null
    + *    separator = '.'
    + *    => result = { 'c' }
    + * 
  6. + *
+ * + * @param array the given array + * @param name the given name + * @param separator the given separator + * @return the concatenation of the given array parts using the given separator between each + * part and appending the given name at the end + */ +public static final char[] concatWith( + char[][] array, + char[] name, + char separator) { + int nameLength = name == null ? 0 : name.length; + if (nameLength == 0) + return concatWith(array, separator); + + int length = array == null ? 0 : array.length; + if (length == 0) + return name; + + int size = nameLength; + int index = length; + while (--index >= 0) + if (array[index].length > 0) + size += array[index].length + 1; + char[] result = new char[size]; + index = 0; + for (int i = 0; i < length; i++) { + int subLength = array[i].length; + if (subLength > 0) { + System.arraycopy(array[i], 0, result, index, subLength); + index += subLength; + result[index++] = separator; + } + } + System.arraycopy(name, 0, result, index, nameLength); + return result; +} + +public static final char[] fixLibPackageTail(char[] packageName) { + + if(packageName==null || packageName.length<3) return packageName; + int length = packageName.length; + if( packageName[length-3]=='/' && (packageName[length-2]=='j' || packageName[length-2]=='J') && (packageName[length-1]=='s' || packageName[length-1]=='S')){ + char[] newPname = packageName; + newPname[length-3] = '.'; + return newPname; + } + return packageName; +} + +/** + * Answers the concatenation of the given array parts using the given separator between each part. + *
+ *
+ * For example:
+ *
    + *
  1. + *    array = { { 'a' }, { 'b' } }
    + *    separator = '.'
    + *    => result = { 'a', '.', 'b' }
    + * 
    + *
  2. + *
  3. + *    array = null
    + *    separator = '.'
    + *    => result = { }
    + * 
  4. + *
+ * + *

NOTE: This implementation ignores any elements in the given array that are empty.

+ * + * @param array the given array + * @param separator the given separator + * + * @return the concatenation of the given array parts using the given separator between each part + * + * @see #concatWith(char[][], char, boolean) + */ +public static final char[] concatWith(char[][] array, char separator) { + return concatWith(array, separator, true); +} + +/** + * Answers the concatenation of the given array parts using the given separator between each part. + *
+ *
+ * For example:
+ *
    + *
  1. + *    array = { { 'a' }, { 'b' } }
    + *    separator = '.'
    + *    => result = { 'a', '.', 'b' }
    + * 
    + *
  2. + *
  3. + *    array = null
    + *    separator = '.'
    + *    => result = { }
    + * 
  4. + *
+ * + *

This implementation allows the caller to decide if empty elements in the array should be skipped or not

+ * + * @param array char string array to concatenate with itself + * @param separator the separator to use between each element of the char string array + * @param ignoreEmptyElements true to skip any empty elements in the char string array, + * false to include an empty element in the return char string + * + * @return the concatenation of the given array parts using the given separator between each part + */ +public static final char[] concatWith(char[][] array, char separator, boolean ignoreEmptyElements) { + int length = array == null ? 0 : array.length; + if (length == 0) + return CharOperation.NO_CHAR; + + int size = length - 1; + int index = length; + while (--index >= 0) { + if (array[index].length == 0 && ignoreEmptyElements) + size--; + else + size += array[index].length; + } + if (size <= 0) + return CharOperation.NO_CHAR; + char[] result = new char[size]; + index = length; + while (--index >= 0) { + length = array[index].length; + if (length > 0 || (length == 0 && !ignoreEmptyElements)) { + System.arraycopy( + array[index], + 0, + result, + (size -= length), + length); + if (--size >= 0) + result[size] = separator; + } + } + return result; +} + +/** + * Answers true if the array contains an occurrence of character, false otherwise. + * + *
+ *
+ * For example: + *
    + *
  1. + *    character = 'c'
    + *    array = { { ' a' }, { ' b' } }
    + *    result => false
    + * 
    + *
  2. + *
  3. + *    character = 'a'
    + *    array = { { ' a' }, { ' b' } }
    + *    result => true
    + * 
    + *
  4. + *
+ * + * @param character the character to search + * @param array the array in which the search is done + * @return true if the array contains an occurrence of character, false otherwise. + * @throws NullPointerException if array is null. + */ +public static final boolean contains(char character, char[][] array) { + for (int i = array.length; --i >= 0;) { + char[] subarray = array[i]; + for (int j = subarray.length; --j >= 0;) + if (subarray[j] == character) + return true; + } + return false; +} + +/** + * Answers true if the array contains an occurrence of character, false otherwise. + * + *
+ *
+ * For example: + *
    + *
  1. + *    character = 'c'
    + *    array = { ' b'  }
    + *    result => false
    + * 
    + *
  2. + *
  3. + *    character = 'a'
    + *    array = { ' a' , ' b' }
    + *    result => true
    + * 
    + *
  4. + *
+ * + * @param character the character to search + * @param array the array in which the search is done + * @return true if the array contains an occurrence of character, false otherwise. + * @throws NullPointerException if array is null. + */ +public static final boolean contains(char character, char[] array) { + for (int i = array.length; --i >= 0;) + if (array[i] == character) + return true; + return false; +} + +/** + * Answers true if the array contains an occurrence of one of the characters, false otherwise. + * + *
+ *
+ * For example: + *
    + *
  1. + *    characters = { 'c', 'd' }
    + *    array = { 'a', ' b'  }
    + *    result => false
    + * 
    + *
  2. + *
  3. + *    characters = { 'c', 'd' }
    + *    array = { 'a', ' b', 'c'  }
    + *    result => true
    + * 
    + *
  4. + *
+ * + * @param characters the characters to search + * @param array the array in which the search is done + * @return true if the array contains an occurrence of one of the characters, false otherwise. + * @throws NullPointerException if array is null. + */ +public static final boolean contains(char[] characters, char[] array) { + for (int i = array.length; --i >= 0;) + for (int j = characters.length; --j >= 0;) + if (array[i] == characters[j]) + return true; + return false; +} + +/** + * Answers a deep copy of the toCopy array. + * + * @param toCopy the array to copy + * @return a deep copy of the toCopy array. + */ + +public static final char[][] deepCopy(char[][] toCopy) { + int toCopyLength = toCopy.length; + char[][] result = new char[toCopyLength][]; + for (int i = 0; i < toCopyLength; i++) { + char[] toElement = toCopy[i]; + int toElementLength = toElement.length; + char[] resultElement = new char[toElementLength]; + System.arraycopy(toElement, 0, resultElement, 0, toElementLength); + result[i] = resultElement; + } + return result; +} + +/** + * Return true if array ends with the sequence of characters contained in toBeFound, + * otherwise false. + *
+ *
+ * For example: + *
    + *
  1. + *    array = { 'a', 'b', 'c', 'd' }
    + *    toBeFound = { 'b', 'c' }
    + *    result => false
    + * 
    + *
  2. + *
  3. + *    array = { 'a', 'b', 'c' }
    + *    toBeFound = { 'b', 'c' }
    + *    result => true
    + * 
    + *
  4. + *
+ * + * @param array the array to check + * @param toBeFound the array to find + * @return true if array ends with the sequence of characters contained in toBeFound, + * otherwise false. + * @throws NullPointerException if array is null or toBeFound is null + */ +public static final boolean endsWith(char[] array, char[] toBeFound) { + int i = toBeFound.length; + int j = array.length - i; + + if (j < 0) + return false; + while (--i >= 0) + if (toBeFound[i] != array[i + j]) + return false; + return true; +} + +/** + * Answers true if the two arrays are identical character by character, otherwise false. + * The equality is case sensitive. + *
+ *
+ * For example: + *
    + *
  1. + *    first = null
    + *    second = null
    + *    result => true
    + * 
    + *
  2. + *
  3. + *    first = { { } }
    + *    second = null
    + *    result => false
    + * 
    + *
  4. + *
  5. + *    first = { { 'a' } }
    + *    second = { { 'a' } }
    + *    result => true
    + * 
    + *
  6. + *
  7. + *    first = { { 'A' } }
    + *    second = { { 'a' } }
    + *    result => false
    + * 
    + *
  8. + *
+ * @param first the first array + * @param second the second array + * @return true if the two arrays are identical character by character, otherwise false + */ +public static final boolean equals(char[][] first, char[][] second) { + if (first == second) + return true; + if (first == null || second == null) + return false; + if (first.length != second.length) + return false; + + for (int i = first.length; --i >= 0;) + if (!equals(first[i], second[i])) + return false; + return true; +} + +/** + * If isCaseSensite is true, answers true if the two arrays are identical character + * by character, otherwise false. + * If it is false, answers true if the two arrays are identical character by + * character without checking the case, otherwise false. + *
+ *
+ * For example: + *
    + *
  1. + *    first = null
    + *    second = null
    + *    isCaseSensitive = true
    + *    result => true
    + * 
    + *
  2. + *
  3. + *    first = { { } }
    + *    second = null
    + *    isCaseSensitive = true
    + *    result => false
    + * 
    + *
  4. + *
  5. + *    first = { { 'A' } }
    + *    second = { { 'a' } }
    + *    isCaseSensitive = true
    + *    result => false
    + * 
    + *
  6. + *
  7. + *    first = { { 'A' } }
    + *    second = { { 'a' } }
    + *    isCaseSensitive = false
    + *    result => true
    + * 
    + *
  8. + *
+ * + * @param first the first array + * @param second the second array + * @param isCaseSensitive check whether or not the equality should be case sensitive + * @return true if the two arrays are identical character by character according to the value + * of isCaseSensitive, otherwise false + */ +public static final boolean equals( + char[][] first, + char[][] second, + boolean isCaseSensitive) { + + if (isCaseSensitive) { + return equals(first, second); + } + if (first == second) + return true; + if (first == null || second == null) + return false; + if (first.length != second.length) + return false; + + for (int i = first.length; --i >= 0;) + if (!equals(first[i], second[i], false)) + return false; + return true; +} + +/** + * Answers true if the two arrays are identical character by character, otherwise false. + * The equality is case sensitive. + *
+ *
+ * For example: + *
    + *
  1. + *    first = null
    + *    second = null
    + *    result => true
    + * 
    + *
  2. + *
  3. + *    first = { }
    + *    second = null
    + *    result => false
    + * 
    + *
  4. + *
  5. + *    first = { 'a' }
    + *    second = { 'a' }
    + *    result => true
    + * 
    + *
  6. + *
  7. + *    first = { 'a' }
    + *    second = { 'A' }
    + *    result => false
    + * 
    + *
  8. + *
+ * @param first the first array + * @param second the second array + * @return true if the two arrays are identical character by character, otherwise false + */ +public static final boolean equals(char[] first, char[] second) { + if (first == second) + return true; + if (first == null || second == null) + return false; + if (first.length != second.length) + return false; + + for (int i = first.length; --i >= 0;) + if (first[i] != second[i]) + return false; + return true; +} + +/** + * Answers true if the first array is identical character by character to a portion of the second array + * delimited from position secondStart (inclusive) to secondEnd(exclusive), otherwise false. + * The equality is case sensitive. + *
+ *
+ * For example: + *
    + *
  1. + *    first = null
    + *    second = null
    + *    secondStart = 0
    + *    secondEnd = 0
    + *    result => true
    + * 
    + *
  2. + *
  3. + *    first = { }
    + *    second = null
    + *    secondStart = 0
    + *    secondEnd = 0
    + *    result => false
    + * 
    + *
  4. + *
  5. + *    first = { 'a' }
    + *    second = { 'a' }
    + *    secondStart = 0
    + *    secondEnd = 1
    + *    result => true
    + * 
    + *
  6. + *
  7. + *    first = { 'a' }
    + *    second = { 'A' }
    + *    secondStart = 0
    + *    secondEnd = 1
    + *    result => false
    + * 
    + *
  8. + *
+ * @param first the first array + * @param second the second array + * @param secondStart inclusive start position in the second array to compare + * @param secondEnd exclusive end position in the second array to compare + * @return true if the first array is identical character by character to fragment of second array ranging from secondStart to secondEnd-1, otherwise false + */ +public static final boolean equals(char[] first, char[] second, int secondStart, int secondEnd) { + return equals(first, second, secondStart, secondEnd, true); +} +/** + *

Answers true if the first array is identical character by character to a portion of the second array + * delimited from position secondStart (inclusive) to secondEnd(exclusive), otherwise false. The equality could be either + * case sensitive or case insensitive according to the value of the isCaseSensitive parameter. + *

+ *

For example:

+ *
    + *
  1. + *    first = null
    + *    second = null
    + *    secondStart = 0
    + *    secondEnd = 0
    + *    isCaseSensitive = false
    + *    result => true
    + * 
    + *
  2. + *
  3. + *    first = { }
    + *    second = null
    + *    secondStart = 0
    + *    secondEnd = 0
    + *    isCaseSensitive = false
    + *    result => false
    + * 
    + *
  4. + *
  5. + *    first = { 'a' }
    + *    second = { 'a' }
    + *    secondStart = 0
    + *    secondEnd = 1
    + *    isCaseSensitive = true
    + *    result => true
    + * 
    + *
  6. + *
  7. + *    first = { 'a' }
    + *    second = { 'A' }
    + *    secondStart = 0
    + *    secondEnd = 1
    + *    isCaseSensitive = true
    + *    result => false
    + * 
    + *
  8. + *
  9. + *    first = { 'a' }
    + *    second = { 'A' }
    + *    secondStart = 0
    + *    secondEnd = 1
    + *    isCaseSensitive = false
    + *    result => true
    + * 
    + *
  10. + *
+ * @param first the first array + * @param second the second array + * @param secondStart inclusive start position in the second array to compare + * @param secondEnd exclusive end position in the second array to compare + * @param isCaseSensitive check whether or not the equality should be case sensitive + * @return true if the first array is identical character by character to fragment of second array ranging from secondStart to secondEnd-1, otherwise false + */ +public static final boolean equals(char[] first, char[] second, int secondStart, int secondEnd, boolean isCaseSensitive) { + if (first == second) + return true; + if (first == null || second == null) + return false; + if (first.length != secondEnd - secondStart) + return false; + if (isCaseSensitive) { + for (int i = first.length; --i >= 0;) + if (first[i] != second[i+secondStart]) + return false; + } else { + for (int i = first.length; --i >= 0;) + if (ScannerHelper.toLowerCase(first[i]) != ScannerHelper.toLowerCase(second[i+secondStart])) + return false; + } + return true; +} + +/** + * If isCaseSensite is true, answers true if the two arrays are identical character + * by character, otherwise false. + * If it is false, answers true if the two arrays are identical character by + * character without checking the case, otherwise false. + *
+ *
+ * For example: + *
    + *
  1. + *    first = null
    + *    second = null
    + *    isCaseSensitive = true
    + *    result => true
    + * 
    + *
  2. + *
  3. + *    first = { }
    + *    second = null
    + *    isCaseSensitive = true
    + *    result => false
    + * 
    + *
  4. + *
  5. + *    first = { 'A' }
    + *    second = { 'a' }
    + *    isCaseSensitive = true
    + *    result => false
    + * 
    + *
  6. + *
  7. + *    first = { 'A' }
    + *    second = { 'a' }
    + *    isCaseSensitive = false
    + *    result => true
    + * 
    + *
  8. + *
+ * + * @param first the first array + * @param second the second array + * @param isCaseSensitive check whether or not the equality should be case sensitive + * @return true if the two arrays are identical character by character according to the value + * of isCaseSensitive, otherwise false + */ +public static final boolean equals( + char[] first, + char[] second, + boolean isCaseSensitive) { + + if (isCaseSensitive) { + return equals(first, second); + } + if (first == second) + return true; + if (first == null || second == null) + return false; + if (first.length != second.length) + return false; + + for (int i = first.length; --i >= 0;) + if (ScannerHelper.toLowerCase(first[i]) + != ScannerHelper.toLowerCase(second[i])) + return false; + return true; +} + +/** + * If isCaseSensite is true, the equality is case sensitive, otherwise it is case insensitive. + * + * Answers true if the name contains the fragment at the starting index startIndex, otherwise false. + *
+ *
+ * For example: + *
    + *
  1. + *    fragment = { 'b', 'c' , 'd' }
    + *    name = { 'a', 'b', 'c' , 'd' }
    + *    startIndex = 1
    + *    isCaseSensitive = true
    + *    result => true
    + * 
    + *
  2. + *
  3. + *    fragment = { 'b', 'c' , 'd' }
    + *    name = { 'a', 'b', 'C' , 'd' }
    + *    startIndex = 1
    + *    isCaseSensitive = true
    + *    result => false
    + * 
    + *
  4. + *
  5. + *    fragment = { 'b', 'c' , 'd' }
    + *    name = { 'a', 'b', 'C' , 'd' }
    + *    startIndex = 0
    + *    isCaseSensitive = false
    + *    result => false
    + * 
    + *
  6. + *
  7. + *    fragment = { 'b', 'c' , 'd' }
    + *    name = { 'a', 'b'}
    + *    startIndex = 0
    + *    isCaseSensitive = true
    + *    result => false
    + * 
    + *
  8. + *
+ * + * @param fragment the fragment to check + * @param name the array to check + * @param startIndex the starting index + * @param isCaseSensitive check whether or not the equality should be case sensitive + * @return true if the name contains the fragment at the starting index startIndex according to the + * value of isCaseSensitive, otherwise false. + * @throws NullPointerException if fragment or name is null. + */ +public static final boolean fragmentEquals( + char[] fragment, + char[] name, + int startIndex, + boolean isCaseSensitive) { + + int max = fragment.length; + if (name.length < max + startIndex) + return false; + if (isCaseSensitive) { + for (int i = max; + --i >= 0; + ) // assumes the prefix is not larger than the name + if (fragment[i] != name[i + startIndex]) + return false; + return true; + } + for (int i = max; + --i >= 0; + ) // assumes the prefix is not larger than the name + if (ScannerHelper.toLowerCase(fragment[i]) + != ScannerHelper.toLowerCase(name[i + startIndex])) + return false; + return true; +} + +/** + * Answers a hashcode for the array + * + * @param array the array for which a hashcode is required + * @return the hashcode + * @throws NullPointerException if array is null + */ +public static final int hashCode(char[] array) { + int length = array.length; + int hash = length == 0 ? 31 : array[0]; + if (length < 8) { + for (int i = length; --i > 0;) + hash = (hash * 31) + array[i]; + } else { + // 8 characters is enough to compute a decent hash code, don't waste time examining every character + for (int i = length - 1, last = i > 16 ? i - 16 : 0; i > last; i -= 2) + hash = (hash * 31) + array[i]; + } + return hash & 0x7FFFFFFF; +} + +/** + * Answers true if c is a whitespace (\u000a, \u000c, \u000d, \u0009), otherwise false. + *
+ *
+ * For example: + *
    + *
  1. + *    c = ' '
    + *    result => true
    + * 
    + *
  2. + *
  3. + *    c = '\u3000'
    + *    result => false
    + * 
    + *
  4. + *
+ * + * @param c the character to check + * @return true if c is a whitespace according to the JLS, otherwise false. + */ +public static boolean isWhitespace(char c) { + return c < ScannerHelper.MAX_OBVIOUS && ((ScannerHelper.OBVIOUS_IDENT_CHAR_NATURES[c] & ScannerHelper.C_JLS_SPACE) != 0); +} + +/** + * Answers the first index in the array for which the corresponding character is + * equal to toBeFound. Answers -1 if no occurrence of this character is found. + *
+ *
+ * For example: + *
    + *
  1. + *    toBeFound = 'c'
    + *    array = { ' a', 'b', 'c', 'd' }
    + *    result => 2
    + * 
    + *
  2. + *
  3. + *    toBeFound = 'e'
    + *    array = { ' a', 'b', 'c', 'd' }
    + *    result => -1
    + * 
    + *
  4. + *
+ * + * @param toBeFound the character to search + * @param array the array to be searched + * @return the first index in the array for which the corresponding character is + * equal to toBeFound, -1 otherwise + * @throws NullPointerException if array is null + */ +public static final int indexOf(char toBeFound, char[] array) { + return indexOf(toBeFound, array, 0); +} + +/** + * Answers the first index in the array for which the toBeFound array is a matching + * subarray following the case rule. Answers -1 if no match is found. + *
+ *
+ * For example: + *
    + *
  1. + *    toBeFound = { 'c' }
    + *    array = { ' a', 'b', 'c', 'd' }
    + *    result => 2
    + * 
    + *
  2. + *
  3. + *    toBeFound = { 'e' }
    + *    array = { ' a', 'b', 'c', 'd' }
    + *    result => -1
    + * 
    + *
  4. + *
+ * + * @param toBeFound the subarray to search + * @param array the array to be searched + * @param isCaseSensitive flag to know if the matching should be case sensitive + * @return the first index in the array for which the toBeFound array is a matching + * subarray following the case rule, -1 otherwise + * @throws NullPointerException if array is null or toBeFound is null + */ +public static final int indexOf(char[] toBeFound, char[] array, boolean isCaseSensitive) { + return indexOf(toBeFound, array, isCaseSensitive, 0); +} + +/** + * Answers the first index in the array for which the toBeFound array is a matching + * subarray following the case rule starting at the index start. Answers -1 if no match is found. + *
+ *
+ * For example: + *
    + *
  1. + *    toBeFound = { 'c' }
    + *    array = { ' a', 'b', 'c', 'd' }
    + *    result => 2
    + * 
    + *
  2. + *
  3. + *    toBeFound = { 'e' }
    + *    array = { ' a', 'b', 'c', 'd' }
    + *    result => -1
    + * 
    + *
  4. + *
+ * + * @param toBeFound the subarray to search + * @param array the array to be searched + * @param isCaseSensitive flag to know if the matching should be case sensitive + * @param start the starting index + * @return the first index in the array for which the toBeFound array is a matching + * subarray following the case rule starting at the index start, -1 otherwise + * @throws NullPointerException if array is null or toBeFound is null + */ +public static final int indexOf(final char[] toBeFound, final char[] array, final boolean isCaseSensitive, final int start) { + return indexOf(toBeFound, array, isCaseSensitive, start, array.length); +} + +/** + * Answers the first index in the array for which the toBeFound array is a matching + * subarray following the case rule starting at the index start. Answers -1 if no match is found. + *
+ *
+ * For example: + *
    + *
  1. + *    toBeFound = { 'c' }
    + *    array = { ' a', 'b', 'c', 'd' }
    + *    result => 2
    + * 
    + *
  2. + *
  3. + *    toBeFound = { 'e' }
    + *    array = { ' a', 'b', 'c', 'd' }
    + *    result => -1
    + * 
    + *
  4. + *
+ * + * @param toBeFound the subarray to search + * @param array the array to be searched + * @param isCaseSensitive flag to know if the matching should be case sensitive + * @param start the starting index (inclusive) + * @param end the end index (exclusive) + * @return the first index in the array for which the toBeFound array is a matching + * subarray following the case rule starting at the index start, -1 otherwise + * @throws NullPointerException if array is null or toBeFound is null + */ +public static final int indexOf(final char[] toBeFound, final char[] array, final boolean isCaseSensitive, final int start, final int end) { + final int arrayLength = end; + final int toBeFoundLength = toBeFound.length; + if (toBeFoundLength > arrayLength) return -1; + if (toBeFoundLength == 0) return 0; + if (toBeFoundLength == arrayLength) { + if (isCaseSensitive) { + for (int i = start; i < arrayLength; i++) { + if (array[i] != toBeFound[i]) return -1; + } + return 0; + } else { + for (int i = start; i < arrayLength; i++) { + if (ScannerHelper.toLowerCase(array[i]) != ScannerHelper.toLowerCase(toBeFound[i])) return -1; + } + return 0; + } + } + if (isCaseSensitive) { + arrayLoop: for (int i = start, max = arrayLength - toBeFoundLength + 1; i < max; i++) { + if (array[i] == toBeFound[0]) { + for (int j = 1; j < toBeFoundLength; j++) { + if (array[i + j] != toBeFound[j]) continue arrayLoop; + } + return i; + } + } + } else { + arrayLoop: for (int i = start, max = arrayLength - toBeFoundLength + 1; i < max; i++) { + if (ScannerHelper.toLowerCase(array[i]) == ScannerHelper.toLowerCase(toBeFound[0])) { + for (int j = 1; j < toBeFoundLength; j++) { + if (ScannerHelper.toLowerCase(array[i + j]) != ScannerHelper.toLowerCase(toBeFound[j])) continue arrayLoop; + } + return i; + } + } + } + return -1; +} + +/** + * Answers the first index in the array for which the corresponding character is + * equal to toBeFound starting the search at index start. + * Answers -1 if no occurrence of this character is found. + *
+ *
+ * For example: + *
    + *
  1. + *    toBeFound = 'c'
    + *    array = { ' a', 'b', 'c', 'd' }
    + *    start = 2
    + *    result => 2
    + * 
    + *
  2. + *
  3. + *    toBeFound = 'c'
    + *    array = { ' a', 'b', 'c', 'd' }
    + *    start = 3
    + *    result => -1
    + * 
    + *
  4. + *
  5. + *    toBeFound = 'e'
    + *    array = { ' a', 'b', 'c', 'd' }
    + *    start = 1
    + *    result => -1
    + * 
    + *
  6. + *
+ * + * @param toBeFound the character to search + * @param array the array to be searched + * @param start the starting index + * @return the first index in the array for which the corresponding character is + * equal to toBeFound, -1 otherwise + * @throws NullPointerException if array is null + * @throws ArrayIndexOutOfBoundsException if start is lower than 0 + */ +public static final int indexOf(char toBeFound, char[] array, int start) { + for (int i = start; i < array.length; i++) + if (toBeFound == array[i]) + return i; + return -1; +} + +/** + * Answers the first index in the array for which the corresponding character is + * equal to toBeFound starting the search at index start and before the ending index. + * Answers -1 if no occurrence of this character is found. + *
+ *
+ * For example: + *
    + *
  1. + *    toBeFound = 'c'
    + *    array = { ' a', 'b', 'c', 'd' }
    + *    start = 2
    + *    result => 2
    + * 
    + *
  2. + *
  3. + *    toBeFound = 'c'
    + *    array = { ' a', 'b', 'c', 'd' }
    + *    start = 3
    + *    result => -1
    + * 
    + *
  4. + *
  5. + *    toBeFound = 'e'
    + *    array = { ' a', 'b', 'c', 'd' }
    + *    start = 1
    + *    result => -1
    + * 
    + *
  6. + *
+ * + * @param toBeFound the character to search + * @param array the array to be searched + * @param start the starting index (inclusive) + * @param end the ending index (exclusive) + * @return the first index in the array for which the corresponding character is + * equal to toBeFound, -1 otherwise + * @throws NullPointerException if array is null + * @throws ArrayIndexOutOfBoundsException if start is lower than 0 or ending greater than array length + */ +public static final int indexOf(char toBeFound, char[] array, int start, int end) { + for (int i = start; i < end; i++) + if (toBeFound == array[i]) + return i; + return -1; +} + +/** + * Answers the last index in the array for which the corresponding character is + * equal to toBeFound starting from the end of the array. + * Answers -1 if no occurrence of this character is found. + *
+ *
+ * For example: + *
    + *
  1. + *    toBeFound = 'c'
    + *    array = { ' a', 'b', 'c', 'd' , 'c', 'e' }
    + *    result => 4
    + * 
    + *
  2. + *
  3. + *    toBeFound = 'e'
    + *    array = { ' a', 'b', 'c', 'd' }
    + *    result => -1
    + * 
    + *
  4. + *
+ * + * @param toBeFound the character to search + * @param array the array to be searched + * @return the last index in the array for which the corresponding character is + * equal to toBeFound starting from the end of the array, -1 otherwise + * @throws NullPointerException if array is null + */ +public static final int lastIndexOf(char toBeFound, char[] array) { + for (int i = array.length; --i >= 0;) + if (toBeFound == array[i]) + return i; + return -1; +} + +/** + * Answers the last index in the array for which the corresponding character is + * equal to toBeFound stopping at the index startIndex. + * Answers -1 if no occurrence of this character is found. + *
+ *
+ * For example: + *
    + *
  1. + *    toBeFound = 'c'
    + *    array = { ' a', 'b', 'c', 'd' }
    + *    startIndex = 2
    + *    result => 2
    + * 
    + *
  2. + *
  3. + *    toBeFound = 'c'
    + *    array = { ' a', 'b', 'c', 'd', 'e' }
    + *    startIndex = 3
    + *    result => -1
    + * 
    + *
  4. + *
  5. + *    toBeFound = 'e'
    + *    array = { ' a', 'b', 'c', 'd' }
    + *    startIndex = 0
    + *    result => -1
    + * 
    + *
  6. + *
+ * + * @param toBeFound the character to search + * @param array the array to be searched + * @param startIndex the stopping index + * @return the last index in the array for which the corresponding character is + * equal to toBeFound stopping at the index startIndex, -1 otherwise + * @throws NullPointerException if array is null + * @throws ArrayIndexOutOfBoundsException if startIndex is lower than 0 + */ +public static final int lastIndexOf( + char toBeFound, + char[] array, + int startIndex) { + for (int i = array.length; --i >= startIndex;) + if (toBeFound == array[i]) + return i; + return -1; +} + +/** + * Answers the last index in the array for which the corresponding character is + * equal to toBeFound starting from endIndex to startIndex. + * Answers -1 if no occurrence of this character is found. + *
+ *
+ * For example: + *
    + *
  1. + *    toBeFound = 'c'
    + *    array = { ' a', 'b', 'c', 'd' }
    + *    startIndex = 2
    + *    endIndex = 2
    + *    result => 2
    + * 
    + *
  2. + *
  3. + *    toBeFound = 'c'
    + *    array = { ' a', 'b', 'c', 'd', 'e' }
    + *    startIndex = 3
    + *    endIndex = 4
    + *    result => -1
    + * 
    + *
  4. + *
  5. + *    toBeFound = 'e'
    + *    array = { ' a', 'b', 'c', 'd' }
    + *    startIndex = 0
    + *    endIndex = 3
    + *    result => -1
    + * 
    + *
  6. + *
+ * + * @param toBeFound the character to search + * @param array the array to be searched + * @param startIndex the stopping index + * @param endIndex the starting index + * @return the last index in the array for which the corresponding character is + * equal to toBeFound starting from endIndex to startIndex, -1 otherwise + * @throws NullPointerException if array is null + * @throws ArrayIndexOutOfBoundsException if endIndex is greater or equals to array length or starting is lower than 0 + */ +public static final int lastIndexOf( + char toBeFound, + char[] array, + int startIndex, + int endIndex) { + for (int i = endIndex; --i >= startIndex;) + if (toBeFound == array[i]) + return i; + return -1; +} + +/** + * Answers the last portion of a name given a separator. + *
+ *
+ * For example, + *
+ * 	lastSegment("my.namespace.Object".toCharArray(),'.') --> Object
+ * 
+ * + * @param array the array + * @param separator the given separator + * @return the last portion of a name given a separator + * @throws NullPointerException if array is null + */ +final static public char[] lastSegment(char[] array, char separator) { + int pos = lastIndexOf(separator, array); + if (pos < 0) + return array; + return subarray(array, pos + 1, array.length); +} + +/** + * Answers true if the pattern matches the given name, false otherwise. This char[] pattern matching + * accepts wild-cards '*' and '?'. + * + * When not case sensitive, the pattern is assumed to already be lowercased, the + * name will be lowercased character per character as comparing. + * If name is null, the answer is false. + * If pattern is null, the answer is true if name is not null. + *
+ *
+ * For example: + *
    + *
  1. + *    pattern = { '?', 'b', '*' }
    + *    name = { 'a', 'b', 'c' , 'd' }
    + *    isCaseSensitive = true
    + *    result => true
    + * 
    + *
  2. + *
  3. + *    pattern = { '?', 'b', '?' }
    + *    name = { 'a', 'b', 'c' , 'd' }
    + *    isCaseSensitive = true
    + *    result => false
    + * 
    + *
  4. + *
  5. + *    pattern = { 'b', '*' }
    + *    name = { 'a', 'b', 'c' , 'd' }
    + *    isCaseSensitive = true
    + *    result => false
    + * 
    + *
  6. + *
+ * + * @param pattern the given pattern + * @param name the given name + * @param isCaseSensitive flag to know whether or not the matching should be case sensitive + * @return true if the pattern matches the given name, false otherwise + */ +public static final boolean match( + char[] pattern, + char[] name, + boolean isCaseSensitive) { + + if (name == null) + return false; // null name cannot match + if (pattern == null) + return true; // null pattern is equivalent to '*' + + return match( + pattern, + 0, + pattern.length, + name, + 0, + name.length, + isCaseSensitive); +} + +/** + * Answers true if a sub-pattern matches the subpart of the given name, false otherwise. + * char[] pattern matching, accepting wild-cards '*' and '?'. Can match only subset of name/pattern. + * end positions are non-inclusive. + * The subpattern is defined by the patternStart and pattternEnd positions. + * When not case sensitive, the pattern is assumed to already be lowercased, the + * name will be lowercased character per character as comparing. + *
+ *
+ * For example: + *
    + *
  1. + *    pattern = { '?', 'b', '*' }
    + *    patternStart = 1
    + *    patternEnd = 3
    + *    name = { 'a', 'b', 'c' , 'd' }
    + *    nameStart = 1
    + *    nameEnd = 4
    + *    isCaseSensitive = true
    + *    result => true
    + * 
    + *
  2. + *
  3. + *    pattern = { '?', 'b', '*' }
    + *    patternStart = 1
    + *    patternEnd = 2
    + *    name = { 'a', 'b', 'c' , 'd' }
    + *    nameStart = 1
    + *    nameEnd = 2
    + *    isCaseSensitive = true
    + *    result => false
    + * 
    + *
  4. + *
+ * + * @param pattern the given pattern + * @param patternStart the given pattern start + * @param patternEnd the given pattern end + * @param name the given name + * @param nameStart the given name start + * @param nameEnd the given name end + * @param isCaseSensitive flag to know if the matching should be case sensitive + * @return true if a sub-pattern matches the subpart of the given name, false otherwise + */ +public static final boolean match( + char[] pattern, + int patternStart, + int patternEnd, + char[] name, + int nameStart, + int nameEnd, + boolean isCaseSensitive) { + + if (name == null) + return false; // null name cannot match + if (pattern == null) + return true; // null pattern is equivalent to '*' + int iPattern = patternStart; + int iName = nameStart; + + if (patternEnd < 0) + patternEnd = pattern.length; + if (nameEnd < 0) + nameEnd = name.length; + + /* check first segment */ + char patternChar = 0; + while ((iPattern < patternEnd) + && (patternChar = pattern[iPattern]) != '*') { + if (iName == nameEnd) + return false; + if ( (isCaseSensitive + ? patternChar + : ScannerHelper.toLowerCase(patternChar)) + != (isCaseSensitive + ? name[iName] + : ScannerHelper.toLowerCase(name[iName])) + && patternChar != '?') { + return false; + } + iName++; + iPattern++; + } + /* check sequence of star+segment */ + int segmentStart; + if (patternChar == '*') { + segmentStart = ++iPattern; // skip star + } else { + segmentStart = 0; // force iName check + } + int prefixStart = iName; + checkSegment : while (iName < nameEnd) { + if (iPattern == patternEnd) { + iPattern = segmentStart; // mismatch - restart current segment + iName = ++prefixStart; + continue checkSegment; + } + /* segment is ending */ + if ((patternChar = pattern[iPattern]) == '*') { + segmentStart = ++iPattern; // skip start + if (segmentStart == patternEnd) { + return true; + } + prefixStart = iName; + continue checkSegment; + } + /* check current name character */ + if ((isCaseSensitive ? name[iName] : ScannerHelper.toLowerCase(name[iName])) + != patternChar + && patternChar != '?') { + iPattern = segmentStart; // mismatch - restart current segment + iName = ++prefixStart; + continue checkSegment; + } + iName++; + iPattern++; + } + + return (segmentStart == patternEnd) + || (iName == nameEnd && iPattern == patternEnd) + || (iPattern == patternEnd - 1 && pattern[iPattern] == '*'); +} + +/** + * Answers true if the pattern matches the filepath using the pathSepatator, false otherwise. + * + * Path char[] pattern matching, accepting wild-cards '**', '*' and '?' (using Ant directory tasks + * conventions, also see "http://jakarta.apache.org/ant/manual/dirtasks.html#defaultexcludes"). + * Path pattern matching is enhancing regular pattern matching in supporting extra rule where '**' represent + * any folder combination. + * Special rule: + * - foo\ is equivalent to foo\** + * When not case sensitive, the pattern is assumed to already be lowercased, the + * name will be lowercased character per character as comparing. + * + * @param pattern the given pattern + * @param filepath the given path + * @param isCaseSensitive to find out whether or not the matching should be case sensitive + * @param pathSeparator the given path separator + * @return true if the pattern matches the filepath using the pathSepatator, false otherwise + */ +public static final boolean pathMatch( + char[] pattern, + char[] filepath, + boolean isCaseSensitive, + char pathSeparator) { + + if (filepath == null) + return false; // null name cannot match + if (pattern == null) + return true; // null pattern is equivalent to '*' + + // offsets inside pattern + int pSegmentStart = pattern[0] == pathSeparator ? 1 : 0; + int pLength = pattern.length; + int pSegmentEnd = CharOperation.indexOf(pathSeparator, pattern, pSegmentStart+1); + if (pSegmentEnd < 0) pSegmentEnd = pLength; + + // special case: pattern foo\ is equivalent to foo\** + boolean freeTrailingDoubleStar = pattern[pLength - 1] == pathSeparator; + + // offsets inside filepath + int fSegmentStart, fLength = filepath.length; + if (filepath[0] != pathSeparator){ + fSegmentStart = 0; + } else { + fSegmentStart = 1; + } + if (fSegmentStart != pSegmentStart) { + return false; // both must start with a separator or none. + } + int fSegmentEnd = CharOperation.indexOf(pathSeparator, filepath, fSegmentStart+1); + if (fSegmentEnd < 0) fSegmentEnd = fLength; + + // first segments + while (pSegmentStart < pLength + && !(pSegmentEnd == pLength && freeTrailingDoubleStar + || (pSegmentEnd == pSegmentStart + 2 + && pattern[pSegmentStart] == '*' + && pattern[pSegmentStart + 1] == '*'))) { + + if (fSegmentStart >= fLength) + return false; + if (!CharOperation + .match( + pattern, + pSegmentStart, + pSegmentEnd, + filepath, + fSegmentStart, + fSegmentEnd, + isCaseSensitive)) { + return false; + } + + // jump to next segment + pSegmentEnd = + CharOperation.indexOf( + pathSeparator, + pattern, + pSegmentStart = pSegmentEnd + 1); + // skip separator + if (pSegmentEnd < 0) + pSegmentEnd = pLength; + + fSegmentEnd = + CharOperation.indexOf( + pathSeparator, + filepath, + fSegmentStart = fSegmentEnd + 1); + // skip separator + if (fSegmentEnd < 0) fSegmentEnd = fLength; + } + + /* check sequence of doubleStar+segment */ + int pSegmentRestart; + if ((pSegmentStart >= pLength && freeTrailingDoubleStar) + || (pSegmentEnd == pSegmentStart + 2 + && pattern[pSegmentStart] == '*' + && pattern[pSegmentStart + 1] == '*')) { + pSegmentEnd = + CharOperation.indexOf( + pathSeparator, + pattern, + pSegmentStart = pSegmentEnd + 1); + // skip separator + if (pSegmentEnd < 0) pSegmentEnd = pLength; + pSegmentRestart = pSegmentStart; + } else { + if (pSegmentStart >= pLength) return fSegmentStart >= fLength; // true if filepath is done too. + pSegmentRestart = 0; // force fSegmentStart check + } + int fSegmentRestart = fSegmentStart; + checkSegment : while (fSegmentStart < fLength) { + + if (pSegmentStart >= pLength) { + if (freeTrailingDoubleStar) return true; + // mismatch - restart current path segment + pSegmentEnd = + CharOperation.indexOf(pathSeparator, pattern, pSegmentStart = pSegmentRestart); + if (pSegmentEnd < 0) pSegmentEnd = pLength; + + fSegmentRestart = + CharOperation.indexOf(pathSeparator, filepath, fSegmentRestart + 1); + // skip separator + if (fSegmentRestart < 0) { + fSegmentRestart = fLength; + } else { + fSegmentRestart++; + } + fSegmentEnd = + CharOperation.indexOf(pathSeparator, filepath, fSegmentStart = fSegmentRestart); + if (fSegmentEnd < 0) fSegmentEnd = fLength; + continue checkSegment; + } + + /* path segment is ending */ + if (pSegmentEnd == pSegmentStart + 2 + && pattern[pSegmentStart] == '*' + && pattern[pSegmentStart + 1] == '*') { + pSegmentEnd = + CharOperation.indexOf(pathSeparator, pattern, pSegmentStart = pSegmentEnd + 1); + // skip separator + if (pSegmentEnd < 0) pSegmentEnd = pLength; + pSegmentRestart = pSegmentStart; + fSegmentRestart = fSegmentStart; + if (pSegmentStart >= pLength) return true; + continue checkSegment; + } + /* chech current path segment */ + if (!CharOperation.match( + pattern, + pSegmentStart, + pSegmentEnd, + filepath, + fSegmentStart, + fSegmentEnd, + isCaseSensitive)) { + // mismatch - restart current path segment + pSegmentEnd = + CharOperation.indexOf(pathSeparator, pattern, pSegmentStart = pSegmentRestart); + if (pSegmentEnd < 0) pSegmentEnd = pLength; + + fSegmentRestart = + CharOperation.indexOf(pathSeparator, filepath, fSegmentRestart + 1); + // skip separator + if (fSegmentRestart < 0) { + fSegmentRestart = fLength; + } else { + fSegmentRestart++; + } + fSegmentEnd = + CharOperation.indexOf(pathSeparator, filepath, fSegmentStart = fSegmentRestart); + if (fSegmentEnd < 0) fSegmentEnd = fLength; + continue checkSegment; + } + // jump to next segment + pSegmentEnd = + CharOperation.indexOf( + pathSeparator, + pattern, + pSegmentStart = pSegmentEnd + 1); + // skip separator + if (pSegmentEnd < 0) + pSegmentEnd = pLength; + + fSegmentEnd = + CharOperation.indexOf( + pathSeparator, + filepath, + fSegmentStart = fSegmentEnd + 1); + // skip separator + if (fSegmentEnd < 0) + fSegmentEnd = fLength; + } + + return (pSegmentRestart >= pSegmentEnd) + || (fSegmentStart >= fLength && pSegmentStart >= pLength) + || (pSegmentStart == pLength - 2 + && pattern[pSegmentStart] == '*' + && pattern[pSegmentStart + 1] == '*') + || (pSegmentStart == pLength && freeTrailingDoubleStar); +} + +/** + * Answers the number of occurrences of the given character in the given array, 0 if any. + * + *
+ *
+ * For example: + *
    + *
  1. + *    toBeFound = 'b'
    + *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + *    result => 3
    + * 
    + *
  2. + *
  3. + *    toBeFound = 'c'
    + *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + *    result => 0
    + * 
    + *
  4. + *
+ * + * @param toBeFound the given character + * @param array the given array + * @return the number of occurrences of the given character in the given array, 0 if any + * @throws NullPointerException if array is null + */ +public static final int occurencesOf(char toBeFound, char[] array) { + int count = 0; + for (int i = 0; i < array.length; i++) + if (toBeFound == array[i]) + count++; + return count; +} + +/** + * Answers the number of occurrences of the given character in the given array starting + * at the given index, 0 if any. + * + *
+ *
+ * For example: + *
    + *
  1. + *    toBeFound = 'b'
    + *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + *    start = 2
    + *    result => 2
    + * 
    + *
  2. + *
  3. + *    toBeFound = 'c'
    + *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + *    start = 0
    + *    result => 0
    + * 
    + *
  4. + *
+ * + * @param toBeFound the given character + * @param array the given array + * @param start the given index + * @return the number of occurrences of the given character in the given array, 0 if any + * @throws NullPointerException if array is null + * @throws ArrayIndexOutOfBoundsException if start is lower than 0 + */ +public static final int occurencesOf( + char toBeFound, + char[] array, + int start) { + int count = 0; + for (int i = start; i < array.length; i++) + if (toBeFound == array[i]) + count++; + return count; +} + +/** + * Answers true if the given name starts with the given prefix, false otherwise. + * The comparison is case sensitive. + *
+ *
+ * For example: + *
    + *
  1. + *    prefix = { 'a' , 'b' }
    + *    name = { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + *    result => true
    + * 
    + *
  2. + *
  3. + *    prefix = { 'a' , 'c' }
    + *    name = { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + *    result => false
    + * 
    + *
  4. + *
+ * + * @param prefix the given prefix + * @param name the given name + * @return true if the given name starts with the given prefix, false otherwise + * @throws NullPointerException if the given name is null or if the given prefix is null + */ +public static final boolean prefixEquals(char[] prefix, char[] name) { + + int max = prefix.length; + if (name.length < max) + return false; + for (int i = max; + --i >= 0; + ) // assumes the prefix is not larger than the name + if (prefix[i] != name[i]) + return false; + return true; +} + +/** + * Answers true if the given name starts with the given prefix, false otherwise. + * isCaseSensitive is used to find out whether or not the comparison should be case sensitive. + *
+ *
+ * For example: + *
    + *
  1. + *    prefix = { 'a' , 'B' }
    + *    name = { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + *    isCaseSensitive = false
    + *    result => true
    + * 
    + *
  2. + *
  3. + *    prefix = { 'a' , 'B' }
    + *    name = { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + *    isCaseSensitive = true
    + *    result => false
    + * 
    + *
  4. + *
+ * + * @param prefix the given prefix + * @param name the given name + * @param isCaseSensitive to find out whether or not the comparison should be case sensitive + * @return true if the given name starts with the given prefix, false otherwise + * @throws NullPointerException if the given name is null or if the given prefix is null + */ +public static final boolean prefixEquals( + char[] prefix, + char[] name, + boolean isCaseSensitive) { + + int max = prefix.length; + if (name.length < max) + return false; + if (isCaseSensitive) { + for (int i = max; + --i >= 0; + ) // assumes the prefix is not larger than the name + if (prefix[i] != name[i]) + return false; + return true; + } + + for (int i = max; + --i >= 0; + ) // assumes the prefix is not larger than the name + if (ScannerHelper.toLowerCase(prefix[i]) + != ScannerHelper.toLowerCase(name[i])) + return false; + return true; +} + +/** + * Answers a new array removing a given character. Answers the given array if there is + * no occurence of the character to remove. + *
+ *
+ * For example: + *
    + *
  1. + *    array = { 'a' , 'b', 'b', 'c', 'b', 'a' }
    + *    toBeRemoved = 'b'
    + *    return { 'a' , 'c', 'a' }
    + * 
    + *
  2. + *
  3. + *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + *    toBeRemoved = 'c'
    + *    return array
    + * 
    + *
  4. + *
+ * + * @param array the given array + * @param toBeRemoved the character to be removed + * @return a new array removing given character + */ +public static final char[] remove(char[] array, char toBeRemoved) { + + if (array == null) return null; + int length = array.length; + if (length == 0) return array; + char[] result = null; + int count = 0; + for (int i = 0; i < length; i++) { + char c = array[i]; + if (c == toBeRemoved) { + if (result == null) { + result = new char[length]; + System.arraycopy(array, 0, result, 0, i); + count = i; + } + } else if (result != null) { + result[count++] = c; + } + } + if (result == null) return array; + System.arraycopy(result, 0, result = new char[count], 0, count); + return result; +} + +/** + * Replace all occurrence of the character to be replaced with the replacement character in the + * given array. + *
+ *
+ * For example: + *
    + *
  1. + *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + *    toBeReplaced = 'b'
    + *    replacementChar = 'a'
    + *    result => No returned value, but array is now equals to { 'a' , 'a', 'a', 'a', 'a', 'a' }
    + * 
    + *
  2. + *
  3. + *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + *    toBeReplaced = 'c'
    + *    replacementChar = 'a'
    + *    result => No returned value, but array is now equals to { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + * 
    + *
  4. + *
+ * + * @param array the given array + * @param toBeReplaced the character to be replaced + * @param replacementChar the replacement character + * @throws NullPointerException if the given array is null + */ +public static final void replace( + char[] array, + char toBeReplaced, + char replacementChar) { + if (toBeReplaced != replacementChar) { + for (int i = 0, max = array.length; i < max; i++) { + if (array[i] == toBeReplaced) + array[i] = replacementChar; + } + } +} + +/** + * Replace all occurrences of characters to be replaced with the replacement character in the + * given array. + *
+ *
+ * For example: + *
    + *
  1. + *    array = { 'a' , 'b', 'b', 'c', 'a', 'b', 'c', 'a' }
    + *    toBeReplaced = { 'b', 'c' }
    + *    replacementChar = 'a'
    + *    result => No returned value, but array is now equals to { 'a' , 'a', 'a', 'a', 'a', 'a', 'a', 'a' }
    + * 
    + *
  2. + *
+ * + * @param array the given array + * @param toBeReplaced characters to be replaced + * @param replacementChar the replacement character + * @throws NullPointerException if arrays are null. + */ +public static final void replace(char[] array, char[] toBeReplaced, char replacementChar) { + replace(array, toBeReplaced, replacementChar, 0, array.length); +} + +/** + * Replace all occurrences of characters to be replaced with the replacement character in the + * given array from the start position (inclusive) to the end position (exclusive). + *
+ *
+ * For example: + *
    + *
  1. + *    array = { 'a' , 'b', 'b', 'c', 'a', 'b', 'c', 'a' }
    + *    toBeReplaced = { 'b', 'c' }
    + *    replacementChar = 'a'
    + *    start = 4
    + *    end = 8
    + *    result => No returned value, but array is now equals to { 'a' , 'b', 'b', 'c', 'a', 'a', 'a', 'a' }
    + * 
    + *
  2. + *
+ * + * @param array the given array + * @param toBeReplaced characters to be replaced + * @param replacementChar the replacement character + * @param start the given start position (inclusive) + * @param end the given end position (exclusive) + * @throws NullPointerException if arrays are null. + */ +public static final void replace(char[] array, char[] toBeReplaced, char replacementChar, int start, int end) { + for (int i = end; --i >= start;) + for (int j = toBeReplaced.length; --j >= 0;) + if (array[i] == toBeReplaced[j]) + array[i] = replacementChar; +} +/** + * Answers a new array of characters with substitutions. No side-effect is operated on the original + * array, in case no substitution happened, then the result is the same as the + * original one. + *
+ *
+ * For example: + *
    + *
  1. + *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + *    toBeReplaced = { 'b' }
    + *    replacementChar = { 'a', 'a' }
    + *    result => { 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a' }
    + * 
    + *
  2. + *
  3. + *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + *    toBeReplaced = { 'c' }
    + *    replacementChar = { 'a' }
    + *    result => { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + * 
    + *
  4. + *
+ * + * @param array the given array + * @param toBeReplaced characters to be replaced + * @param replacementChars the replacement characters + * @return a new array of characters with substitutions or the given array if none + * @throws NullPointerException if the given array is null + */ +public static final char[] replace( + char[] array, + char[] toBeReplaced, + char[] replacementChars) { + + int max = array.length; + int replacedLength = toBeReplaced.length; + int replacementLength = replacementChars.length; + + int[] starts = new int[5]; + int occurrenceCount = 0; + + if (!equals(toBeReplaced, replacementChars)) { + + next : for (int i = 0; i < max;) { + int index = indexOf(toBeReplaced, array, true, i); + if (index == -1) { + i++; + continue next; + } + if (occurrenceCount == starts.length) { + System.arraycopy( + starts, + 0, + starts = new int[occurrenceCount * 2], + 0, + occurrenceCount); + } + starts[occurrenceCount++] = index; + i = index + replacedLength; + } + } + if (occurrenceCount == 0) + return array; + char[] result = + new char[max + + occurrenceCount * (replacementLength - replacedLength)]; + int inStart = 0, outStart = 0; + for (int i = 0; i < occurrenceCount; i++) { + int offset = starts[i] - inStart; + System.arraycopy(array, inStart, result, outStart, offset); + inStart += offset; + outStart += offset; + System.arraycopy( + replacementChars, + 0, + result, + outStart, + replacementLength); + inStart += replacedLength; + outStart += replacementLength; + } + System.arraycopy(array, inStart, result, outStart, max - inStart); + return result; +} + +/** + * Replace all occurrence of the character to be replaced with the replacement character + * in a copy of the given array. Returns the given array if no occurrences of the character + * to be replaced are found. + *
+ *
+ * For example: + *
    + *
  1. + *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + *    toBeReplaced = 'b'
    + *    replacementChar = 'a'
    + *    result => A new array that is equals to { 'a' , 'a', 'a', 'a', 'a', 'a' }
    + * 
    + *
  2. + *
  3. + *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + *    toBeReplaced = 'c'
    + *    replacementChar = 'a'
    + *    result => The original array that remains unchanged.
    + * 
    + *
  4. + *
+ * + * @param array the given array + * @param toBeReplaced the character to be replaced + * @param replacementChar the replacement character + * @throws NullPointerException if the given array is null + */ +public static final char[] replaceOnCopy( + char[] array, + char toBeReplaced, + char replacementChar) { + + char[] result = null; + for (int i = 0, length = array.length; i < length; i++) { + char c = array[i]; + if (c == toBeReplaced) { + if (result == null) { + result = new char[length]; + System.arraycopy(array, 0, result, 0, i); + } + result[i] = replacementChar; + } else if (result != null) { + result[i] = c; + } + } + if (result == null) return array; + return result; +} + +/** + * Return a new array which is the split of the given array using the given divider and triming each subarray to remove + * whitespaces equals to ' '. + *
+ *
+ * For example: + *
    + *
  1. + *    divider = 'b'
    + *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + *    result => { { 'a' }, {  }, { 'a' }, { 'a' } }
    + * 
    + *
  2. + *
  3. + *    divider = 'c'
    + *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + *    result => { { 'a', 'b', 'b', 'a', 'b', 'a' } }
    + * 
    + *
  4. + *
  5. + *    divider = 'b'
    + *    array = { 'a' , ' ', 'b', 'b', 'a', 'b', 'a' }
    + *    result => { { 'a' }, {  }, { 'a' }, { 'a' } }
    + * 
    + *
  6. + *
  7. + *    divider = 'c'
    + *    array = { ' ', ' ', 'a' , 'b', 'b', 'a', 'b', 'a', ' ' }
    + *    result => { { 'a', 'b', 'b', 'a', 'b', 'a' } }
    + * 
    + *
  8. + *
+ * + * @param divider the given divider + * @param array the given array + * @return a new array which is the split of the given array using the given divider and triming each subarray to remove + * whitespaces equals to ' ' + */ +public static final char[][] splitAndTrimOn(char divider, char[] array) { + int length = array == null ? 0 : array.length; + if (length == 0) + return NO_CHAR_CHAR; + + int wordCount = 1; + for (int i = 0; i < length; i++) + if (array[i] == divider) + wordCount++; + char[][] split = new char[wordCount][]; + int last = 0, currentWord = 0; + for (int i = 0; i < length; i++) { + if (array[i] == divider) { + int start = last, end = i - 1; + while (start < i && array[start] == ' ') + start++; + while (end > start && array[end] == ' ') + end--; + split[currentWord] = new char[end - start + 1]; + System.arraycopy( + array, + start, + split[currentWord++], + 0, + end - start + 1); + last = i + 1; + } + } + int start = last, end = length - 1; + while (start < length && array[start] == ' ') + start++; + while (end > start && array[end] == ' ') + end--; + split[currentWord] = new char[end - start + 1]; + System.arraycopy( + array, + start, + split[currentWord++], + 0, + end - start + 1); + return split; +} + +/** + * Return a new array which is the split of the given array using the given divider. + *
+ *
+ * For example: + *
    + *
  1. + *    divider = 'b'
    + *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + *    result => { { 'a' }, {  }, { 'a' }, { 'a' } }
    + * 
    + *
  2. + *
  3. + *    divider = 'c'
    + *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + *    result => { { 'a', 'b', 'b', 'a', 'b', 'a' } }
    + * 
    + *
  4. + *
  5. + *    divider = 'c'
    + *    array = { ' ', ' ', 'a' , 'b', 'b', 'a', 'b', 'a', ' ' }
    + *    result => { { ' ', 'a', 'b', 'b', 'a', 'b', 'a', ' ' } }
    + * 
    + *
  6. + *
+ * + * @param divider the given divider + * @param array the given array + * @return a new array which is the split of the given array using the given divider + */ +public static final char[][] splitOn(char divider, char[] array) { + int length = array == null ? 0 : array.length; + if (length == 0) + return NO_CHAR_CHAR; + + int wordCount = 1; + for (int i = 0; i < length; i++) + if (array[i] == divider) + wordCount++; + char[][] split = new char[wordCount][]; + int last = 0, currentWord = 0; + for (int i = 0; i < length; i++) { + if (array[i] == divider) { + split[currentWord] = new char[i - last]; + System.arraycopy( + array, + last, + split[currentWord++], + 0, + i - last); + last = i + 1; + } + } + split[currentWord] = new char[length - last]; + System.arraycopy(array, last, split[currentWord], 0, length - last); + return split; +} + +/** + * Return a new array which is the split of the given array using the given divider. The given end + * is exclusive and the given start is inclusive. + *
+ *
+ * For example: + *
    + *
  1. + *    divider = 'b'
    + *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
    + *    start = 2
    + *    end = 5
    + *    result => { {  }, { 'a' }, {  } }
    + * 
    + *
  2. + *
+ * + * @param divider the given divider + * @param array the given array + * @param start the given starting index + * @param end the given ending index + * @return a new array which is the split of the given array using the given divider + * @throws ArrayIndexOutOfBoundsException if start is lower than 0 or end is greater than the array length + */ +public static final char[][] splitOn( + char divider, + char[] array, + int start, + int end) { + int length = array == null ? 0 : array.length; + if (length == 0 || start > end) + return NO_CHAR_CHAR; + + int wordCount = 1; + for (int i = start; i < end; i++) + if (array[i] == divider) + wordCount++; + char[][] split = new char[wordCount][]; + int last = start, currentWord = 0; + for (int i = start; i < end; i++) { + if (array[i] == divider) { + split[currentWord] = new char[i - last]; + System.arraycopy( + array, + last, + split[currentWord++], + 0, + i - last); + last = i + 1; + } + } + split[currentWord] = new char[end - last]; + System.arraycopy(array, last, split[currentWord], 0, end - last); + return split; +} + +/** + * Answers a new array which is a copy of the given array starting at the given start and + * ending at the given end. The given start is inclusive and the given end is exclusive. + * Answers null if start is greater than end, if start is lower than 0 or if end is greater + * than the length of the given array. If end equals -1, it is converted to the array length. + *
+ *
+ * For example: + *
    + *
  1. + *    array = { { 'a' } , { 'b' } }
    + *    start = 0
    + *    end = 1
    + *    result => { { 'a' } }
    + * 
    + *
  2. + *
  3. + *    array = { { 'a' } , { 'b' } }
    + *    start = 0
    + *    end = -1
    + *    result => { { 'a' }, { 'b' } }
    + * 
    + *
  4. + *
+ * + * @param array the given array + * @param start the given starting index + * @param end the given ending index + * @return a new array which is a copy of the given array starting at the given start and + * ending at the given end + * @throws NullPointerException if the given array is null + */ +public static final char[][] subarray(char[][] array, int start, int end) { + if (end == -1) + end = array.length; + if (start > end) + return null; + if (start < 0) + return null; + if (end > array.length) + return null; + + char[][] result = new char[end - start][]; + System.arraycopy(array, start, result, 0, end - start); + return result; +} + +/** + * Answers a new array which is a copy of the given array starting at the given start and + * ending at the given end. The given start is inclusive and the given end is exclusive. + * Answers null if start is greater than end, if start is lower than 0 or if end is greater + * than the length of the given array. If end equals -1, it is converted to the array length. + *
+ *
+ * For example: + *
    + *
  1. + *    array = { 'a' , 'b' }
    + *    start = 0
    + *    end = 1
    + *    result => { 'a' }
    + * 
    + *
  2. + *
  3. + *    array = { 'a', 'b' }
    + *    start = 0
    + *    end = -1
    + *    result => { 'a' , 'b' }
    + * 
    + *
  4. + *
+ * + * @param array the given array + * @param start the given starting index + * @param end the given ending index + * @return a new array which is a copy of the given array starting at the given start and + * ending at the given end + * @throws NullPointerException if the given array is null + */ +public static final char[] subarray(char[] array, int start, int end) { + if (end == -1) + end = array.length; + if (start > end) + return null; + if (start < 0) + return null; + if (end > array.length) + return null; + + char[] result = new char[end - start]; + System.arraycopy(array, start, result, 0, end - start); + return result; +} + +/** + * Answers the result of a char[] conversion to lowercase. Answers null if the given chars array is null. + *
+ * NOTE: If no conversion was necessary, then answers back the argument one. + *
+ *
+ * For example: + *
    + *
  1. + *    chars = { 'a' , 'b' }
    + *    result => { 'a' , 'b' }
    + * 
    + *
  2. + *
  3. + *    array = { 'A', 'b' }
    + *    result => { 'a' , 'b' }
    + * 
    + *
  4. + *
+ * + * @param chars the chars to convert + * @return the result of a char[] conversion to lowercase + */ +final static public char[] toLowerCase(char[] chars) { + if (chars == null) + return null; + int length = chars.length; + char[] lowerChars = null; + for (int i = 0; i < length; i++) { + char c = chars[i]; + char lc = ScannerHelper.toLowerCase(c); + if ((c != lc) || (lowerChars != null)) { + if (lowerChars == null) { + System.arraycopy( + chars, + 0, + lowerChars = new char[length], + 0, + i); + } + lowerChars[i] = lc; + } + } + return lowerChars == null ? chars : lowerChars; +} + +/** + * Answers a new array removing leading and trailing spaces (' '). Answers the given array if there is no + * space characters to remove. + *
+ *
+ * For example: + *
    + *
  1. + *    chars = { ' ', 'a' , 'b', ' ',  ' ' }
    + *    result => { 'a' , 'b' }
    + * 
    + *
  2. + *
  3. + *    array = { 'A', 'b' }
    + *    result => { 'A' , 'b' }
    + * 
    + *
  4. + *
+ * + * @param chars the given array + * @return a new array removing leading and trailing spaces (' ') + */ +final static public char[] trim(char[] chars) { + + if (chars == null) + return null; + + int start = 0, length = chars.length, end = length - 1; + while (start < length && chars[start] == ' ') { + start++; + } + while (end > start && chars[end] == ' ') { + end--; + } + if (start != 0 || end != length - 1) { + return subarray(chars, start, end + 1); + } + return chars; +} + +/** + * Answers a string which is the concatenation of the given array using the '.' as a separator. + *
+ *
+ * For example: + *
    + *
  1. + *    array = { { 'a' } , { 'b' } }
    + *    result => "a.b"
    + * 
    + *
  2. + *
  3. + *    array = { { ' ',  'a' } , { 'b' } }
    + *    result => " a.b"
    + * 
    + *
  4. + *
+ * + * @param array the given array + * @return a string which is the concatenation of the given array using the '.' as a separator + */ +final static public String toString(char[][] array) { + char[] result = concatWith(array, '.'); + return new String(result); +} + +/** + * Answers an array of strings from the given array of char array. + * + * @param array the given array + * @return an array of strings + */ +final static public String[] toStrings(char[][] array) { + if (array == null) return NO_STRINGS; + int length = array.length; + if (length == 0) return NO_STRINGS; + String[] result = new String[length]; + for (int i = 0; i < length; i++) + result[i] = new String(array[i]); + return result; +} +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/IProblem.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/IProblem.java new file mode 100644 index 0000000..9f82ccf --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/IProblem.java @@ -0,0 +1,719 @@ +/******************************************************************************* + * Copyright (c) 2000, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * IBM Corporation - added the following constants + * NonStaticAccessToStaticField + * NonStaticAccessToStaticMethod + * Task + * ExpressionShouldBeAVariable + * AssignmentHasNoEffect + * IBM Corporation - added the following constants + * TooManyArrayDimensions + * TooManyBytesForStringConstant + * TooManyMethods + * TooManyFields + * NonBlankFinalLocalAssignment + * ObjectCannotHaveSuperTypes + * MissingSemiColon + * InvalidParenthesizedExpression + * EnclosingInstanceInConstructorCall + * BytecodeExceeds64KLimitForConstructor + * IncompatibleReturnTypeForNonInheritedInterfaceMethod + * UnusedPrivateMethod + * UnusedPrivateConstructor + * UnusedPrivateType + * UnusedPrivateField + * IncompatibleExceptionInThrowsClauseForNonInheritedInterfaceMethod + * InvalidExplicitConstructorCall + * IBM Corporation - added the following constants + * PossibleAccidentalBooleanAssignment + * SuperfluousSemicolon + * IndirectAccessToStaticField + * IndirectAccessToStaticMethod + * IndirectAccessToStaticType + * BooleanMethodThrowingException + * UnnecessaryCast + * UnnecessaryArgumentCast + * UnnecessaryInstanceof + * FinallyMustCompleteNormally + * UnusedMethodDeclaredThrownException + * UnusedConstructorDeclaredThrownException + * InvalidCatchBlockSequence + * UnqualifiedFieldAccess + * IBM Corporation - added the following constants + * Javadoc + * JavadocUnexpectedTag + * JavadocMissingParamTag + * JavadocMissingParamName + * JavadocDuplicateParamName + * JavadocInvalidParamName + * JavadocMissingReturnTag + * JavadocDuplicateReturnTag + * JavadocMissingThrowsTag + * JavadocMissingThrowsClassName + * JavadocInvalidThrowsClass + * JavadocDuplicateThrowsClassName + * JavadocInvalidThrowsClassName + * JavadocMissingSeeReference + * JavadocInvalidSeeReference + * JavadocInvalidSeeHref + * JavadocInvalidSeeArgs + * JavadocMissing + * JavadocInvalidTag + * JavadocMessagePrefix + * EmptyControlFlowStatement + * IBM Corporation - added the following constants + * IllegalUsageOfQualifiedTypeReference + * InvalidDigit + * IBM Corporation - added the following constants + * ParameterAssignment + * FallthroughCase + * IBM Corporation - added the following constants + * UnusedLabel + * UnnecessaryNLSTag + * LocalVariableMayBeNull + * EnumConstantsCannotBeSurroundedByParenthesis + * JavadocMissingIdentifier + * JavadocNonStaticTypeFromStaticInvocation + * RawTypeReference + * NoAdditionalBoundAfterTypeVariable + * UnsafeGenericArrayForVarargs + * IllegalAccessFromTypeVariable + * InvalidEncoding + * CannotReadSource + * ExternalProblemNotFixable + * ExternalProblemFixable + * IBM Corporation - added the following constants + * OverridingMethodWithoutSuperInvocation + * MethodMustOverrideOrImplement + * TypeHidingTypeParameterFromType + * TypeHidingTypeParameterFromMethod + * TypeHidingType + * IBM Corporation - added the following constants + * NullLocalVariableReference + * PotentialNullLocalVariableReference + * RedundantNullCheckOnNullLocalVariable + * NullLocalVariableComparisonYieldsFalse + * RedundantLocalVariableNullAssignment + * NullLocalVariableInstanceofYieldsFalse + * RedundantNullCheckOnNonNullLocalVariable + * NonNullLocalVariableComparisonYieldsFalse + *******************************************************************************/ +package org.eclipse.wst.jsdt.core.compiler; + +import org.eclipse.wst.jsdt.internal.compiler.lookup.ProblemReasons; + +/** + * Description of a JavaScript problem, as detected by the validator + * A problem provides access to: + *
    + *
  • its location (originating source file name, source position, line number),
  • + *
  • its message description and a predicate to check its severity (warning or error).
  • + *
  • its ID : a number identifying the very nature of this problem. All possible IDs are listed + * as constants on this interface.
  • + *
+ * + * Note: the validator produces IProblems internally, which are turned into markers by the JavaScriptBuilder + * so as to persist problem descriptions. This explains why there is no API allowing to reach IProblem detected + * when compiling. However, the JavaScript problem markers carry equivalent information to IProblem, in particular + * their ID (attribute "id") is set to one of the IDs defined on this interface. + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IProblem { + +/** + * Answer back the original arguments recorded into the problem. + * @return the original arguments recorded into the problem + */ +String[] getArguments(); + +/** + * Returns the problem id + * + * @return the problem id + */ +int getID(); + +/** + * Answer a localized, human-readable message string which describes the problem. + * + * @return a localized, human-readable message string which describes the problem + */ +String getMessage(); + +/** + * Answer the file name in which the problem was found. + * + * @return the file name in which the problem was found + */ +char[] getOriginatingFileName(); + +/** + * Answer the end position of the problem (inclusive), or -1 if unknown. + * + * @return the end position of the problem (inclusive), or -1 if unknown + */ +int getSourceEnd(); + +/** + * Answer the line number in source where the problem begins. + * + * @return the line number in source where the problem begins + */ +int getSourceLineNumber(); + +/** + * Answer the start position of the problem (inclusive), or -1 if unknown. + * + * @return the start position of the problem (inclusive), or -1 if unknown + */ +int getSourceStart(); + +/** + * Checks the severity to see if the Error bit is set. + * + * @return true if the Error bit is set for the severity, false otherwise + */ +boolean isError(); + +/** + * Checks the severity to see if the Error bit is not set. + * + * @return true if the Error bit is not set for the severity, false otherwise + */ +boolean isWarning(); + +/** + * Set the end position of the problem (inclusive), or -1 if unknown. + * Used for shifting problem positions. + * + * @param sourceEnd the given end position + */ +void setSourceEnd(int sourceEnd); + +/** + * Set the line number in source where the problem begins. + * + * @param lineNumber the given line number + */ +void setSourceLineNumber(int lineNumber); + +/** + * Set the start position of the problem (inclusive), or -1 if unknown. + * Used for shifting problem positions. + * + * @param sourceStart the given start position + */ +void setSourceStart(int sourceStart); + + + /** + * Problem Categories + * The high bits of a problem ID contains information about the category of a problem. + * For example, (problemID & TypeRelated) != 0, indicates that this problem is type related. + * + * A problem category can help to implement custom problem filters. Indeed, when numerous problems + * are listed, focusing on import related problems first might be relevant. + * + * When a problem is tagged as Internal, it means that no change other than a local source code change + * can fix the corresponding problem. A type related problem could be addressed by changing the type + * involved in it. + */ + int TypeRelated = 0x01000000; + int FieldRelated = 0x02000000; + int MethodRelated = 0x04000000; + int ConstructorRelated = 0x08000000; + int ImportRelated = 0x10000000; + int Internal = 0x20000000; + int Syntax = 0x40000000; + int Javadoc = 0x80000000; + + /** + * Mask to use in order to filter out the category portion of the problem ID. + */ + int IgnoreCategoriesMask = 0xFFFFFF; + + /** + * Below are listed all available problem IDs. Note that this list could be augmented in the future, + * as new features are added to the JavaScript core implementation. + */ + + /** + * ID reserved for referencing an internal error inside the JavaScriptCore implementation which + * may be surfaced as a problem associated with the javaScript unit which caused it to occur. + */ + int Unclassified = 0; + + /** + * General type related problems + */ + int UndefinedType = TypeRelated + 2; + int NotVisibleType = TypeRelated + 3; + int AmbiguousType = TypeRelated + 4; + int UsingDeprecatedType = TypeRelated + 5; + int InternalTypeNameProvided = TypeRelated + 6; + int UnusedPrivateType = Internal + TypeRelated + 7; + + int IncompatibleTypesInEqualityOperator = TypeRelated + 15; + int IncompatibleTypesInConditionalOperator = TypeRelated + 16; + int TypeMismatch = TypeRelated + 17; + int IndirectAccessToStaticType = Internal + TypeRelated + 18; + + /** + * Inner types related problems + */ + int MissingEnclosingInstanceForConstructorCall = TypeRelated + 20; + int MissingEnclosingInstance = TypeRelated + 21; + int IncorrectEnclosingInstanceReference = TypeRelated + 22; + int IllegalEnclosingInstanceSpecification = TypeRelated + 23; + int CannotDefineStaticInitializerInLocalType = Internal + 24; + int OuterLocalMustBeFinal = Internal + 25; + int IllegalPrimitiveOrArrayTypeForEnclosingInstance = TypeRelated + 27; + int EnclosingInstanceInConstructorCall = Internal + 28; + int TypeHidingType = TypeRelated + 33; + + + // variables + int UndefinedName = Internal + FieldRelated + 50; + int UninitializedLocalVariable = Internal + 51; + int VariableTypeCannotBeVoid = Internal + 52; + int CannotAllocateVoidArray = Internal + 54; + // local variables + int RedefinedLocal = Internal + 55; + int RedefinedArgument = Internal + 56; + // final local variables + int DuplicateFinalLocalInitialization = Internal + 57; + int NonBlankFinalLocalAssignment = Internal + 58; + int ParameterAssignment = Internal + 59; + int FinalOuterLocalAssignment = Internal + 60; + int LocalVariableIsNeverUsed = Internal + 61; + int ArgumentIsNeverUsed = Internal + 62; + int BytecodeExceeds64KLimit = Internal + 63; + int BytecodeExceeds64KLimitForClinit = Internal + 64; + int TooManyArgumentSlots = Internal + 65; + int TooManyLocalVariableSlots = Internal + 66; + int TooManyArrayDimensions = Internal + 68; + int BytecodeExceeds64KLimitForConstructor = Internal + 69; + + // fields + int UndefinedField = FieldRelated + 70; + int NotVisibleField = FieldRelated + 71; + int AmbiguousField = FieldRelated + 72; + int UsingDeprecatedField = FieldRelated + 73; + int NonStaticFieldFromStaticInvocation = FieldRelated + 74; + int ReferenceToForwardField = FieldRelated + Internal + 75; + int NonStaticAccessToStaticField = Internal + FieldRelated + 76; + int UnusedPrivateField = Internal + FieldRelated + 77; + int IndirectAccessToStaticField = Internal + FieldRelated + 78; + int UnqualifiedFieldAccess = Internal + FieldRelated + 79; + + // blank final fields + int FinalFieldAssignment = FieldRelated + 80; + int UninitializedBlankFinalField = FieldRelated + 81; + int DuplicateBlankFinalFieldInitialization = FieldRelated + 82; + + // variable hiding + int LocalVariableHidingLocalVariable = Internal + 90; + int LocalVariableHidingField = Internal + FieldRelated + 91; + int FieldHidingLocalVariable = Internal + FieldRelated + 92; + int FieldHidingField = Internal + FieldRelated + 93; + int ArgumentHidingLocalVariable = Internal + 94; + int ArgumentHidingField = Internal + 95; + /* START -------------------------------- Bug 197884 Loosly defined var (for statement) and optional semi-colon --------------------- */ + int LooseVarDecl = Internal + 97; + /* END -------------------------------- Bug 197884 Loosly defined var (for statement) and optional semi-colon --------------------- */ + int UninitializedGlobalVariable = Internal + 98; + + // methods + int UndefinedMethod = MethodRelated + 100; + int NotVisibleMethod = MethodRelated + 101; + int AmbiguousMethod = MethodRelated + 102; + int UsingDeprecatedMethod = MethodRelated + 103; + int DirectInvocationOfAbstractMethod = MethodRelated + 104; + int VoidMethodReturnsValue = MethodRelated + 105; + int MethodReturnsVoid = MethodRelated + 106; + int MethodRequiresBody = Internal + MethodRelated + 107; + int ShouldReturnValue = Internal + MethodRelated + 108; + int UndefinedFunction = MethodRelated + 109; + int MethodButWithConstructorName = MethodRelated + 110; + int MissingReturnType = TypeRelated + 111; + int BodyForNativeMethod = Internal + MethodRelated + 112; + int BodyForAbstractMethod = Internal + MethodRelated + 113; + int NoMessageSendOnBaseType = MethodRelated + 114; + int ParameterMismatch = MethodRelated + 115; + int NoMessageSendOnArrayType = MethodRelated + 116; + int NonStaticAccessToStaticMethod = Internal + MethodRelated + 117; + int UnusedPrivateMethod = Internal + MethodRelated + 118; + int IndirectAccessToStaticMethod = Internal + MethodRelated + 119; + int WrongNumberOfArguments = Internal + MethodRelated + 120; + int NotAFunction = Internal + MethodRelated + 121; + + // constructors + int UndefinedConstructor = ConstructorRelated + 130; + int NotVisibleConstructor = ConstructorRelated + 131; + int AmbiguousConstructor = ConstructorRelated + 132; + int UsingDeprecatedConstructor = ConstructorRelated + 133; + int UnusedPrivateConstructor = Internal + MethodRelated + 134; + // explicit constructor calls + int InstanceFieldDuringConstructorInvocation = ConstructorRelated + 135; + int InstanceMethodDuringConstructorInvocation = ConstructorRelated + 136; + int RecursiveConstructorInvocation = ConstructorRelated + 137; + int ThisSuperDuringConstructorInvocation = ConstructorRelated + 138; + int InvalidExplicitConstructorCall = ConstructorRelated + Syntax + 139; + // implicit constructor calls + int UndefinedConstructorInDefaultConstructor = ConstructorRelated + 140; + int NotVisibleConstructorInDefaultConstructor = ConstructorRelated + 141; + int AmbiguousConstructorInDefaultConstructor = ConstructorRelated + 142; + int UndefinedConstructorInImplicitConstructorCall = ConstructorRelated + 143; + int NotVisibleConstructorInImplicitConstructorCall = ConstructorRelated + 144; + int AmbiguousConstructorInImplicitConstructorCall = ConstructorRelated + 145; + int UnhandledExceptionInDefaultConstructor = TypeRelated + 146; + int UnhandledExceptionInImplicitConstructorCall = TypeRelated + 147; + + // expressions + int ArrayReferenceRequired = Internal + 150; + // constant expressions + int StringConstantIsExceedingUtf8Limit = Internal + 152; + int NumericValueOutOfRange = Internal + 154; + // allocations + int InvalidClassInstantiation = TypeRelated + 157; + int CannotDefineDimensionExpressionsWithInit = Internal + 158; + int MustDefineEitherDimensionExpressionsOrInitializer = Internal + 159; + // operators + int InvalidOperator = Internal + 160; + // statements + int CodeCannotBeReached = Internal + 161; + int CannotReturnOutsideFunction = Internal + 162; + int InitializerMustCompleteNormally = Internal + 163; + // assert + int InvalidVoidExpression = Internal + 164; + // try + int MaskedCatch = TypeRelated + 165; + int DuplicateDefaultCase = Internal + 166; + int UnreachableCatch = TypeRelated + MethodRelated + 167; + int UnhandledException = TypeRelated + 168; + // switch + int IncorrectSwitchType = TypeRelated + 169; + int DuplicateCase = FieldRelated + 170; + + // labelled + int DuplicateLabel = Internal + 171; + int InvalidBreak = Internal + 172; + int InvalidContinue = Internal + 173; + int UndefinedLabel = Internal + 174; + //synchronized + int InvalidTypeToSynchronized = Internal + 175; + int InvalidNullToSynchronized = Internal + 176; + // throw + int CannotThrowNull = Internal + 177; + // assignment + int AssignmentHasNoEffect = Internal + 178; + int PossibleAccidentalBooleanAssignment = Internal + 179; + int SuperfluousSemicolon = Internal + 180; + int UnnecessaryInstanceof = Internal + TypeRelated + 183; + int FinallyMustCompleteNormally = Internal + 184; + int UnusedMethodDeclaredThrownException = Internal + 185; + int UnusedConstructorDeclaredThrownException = Internal + 186; + int EmptyControlFlowStatement = Internal + TypeRelated + 188; + int UnnecessaryElse = Internal + 189; + + // inner emulation + int NeedToEmulateFieldReadAccess = FieldRelated + 190; + int NeedToEmulateFieldWriteAccess = FieldRelated + 191; + int NeedToEmulateMethodAccess = MethodRelated + 192; + int NeedToEmulateConstructorAccess = MethodRelated + 193; + + int FallthroughCase = Internal + 194; + + //inherited name hides enclosing name (sort of ambiguous) + int InheritedMethodHidesEnclosingName = MethodRelated + 195; + int InheritedFieldHidesEnclosingName = FieldRelated + 196; + int InheritedTypeHidesEnclosingName = TypeRelated + 197; + + int IllegalUsageOfQualifiedTypeReference = Internal + Syntax + 198; + + // miscellaneous + int UnusedLabel = Internal + 199; + int ThisInStaticContext = Internal + 200; + int StaticMethodRequested = Internal + MethodRelated + 201; + int IllegalDimension = Internal + 202; + int ParsingError = Syntax + Internal + 204; + int ParsingErrorNoSuggestion = Syntax + Internal + 205; + int InvalidUnaryExpression = Syntax + Internal + 206; + + // syntax errors + int ArrayConstantsOnlyInArrayInitializers = Syntax + Internal + 208; + int ParsingErrorOnKeyword = Syntax + Internal + 209; + int ParsingErrorOnKeywordNoSuggestion = Syntax + Internal + 210; + + int UnmatchedBracket = Syntax + Internal + 220; + int NoFieldOnBaseType = FieldRelated + 221; + int InvalidExpressionAsStatement = Syntax + Internal + 222; + int ExpressionShouldBeAVariable = Syntax + Internal + 223; + int MissingSemiColon = Syntax + Internal + 224; + int InvalidParenthesizedExpression = Syntax + Internal + 225; + + int ParsingErrorInsertTokenBefore = Syntax + Internal + 230; + int ParsingErrorInsertTokenAfter = Syntax + Internal + 231; + int ParsingErrorDeleteToken = Syntax + Internal + 232; + int ParsingErrorDeleteTokens = Syntax + Internal + 233; + int ParsingErrorMergeTokens = Syntax + Internal + 234; + int ParsingErrorInvalidToken = Syntax + Internal + 235; + int ParsingErrorMisplacedConstruct = Syntax + Internal + 236; + int ParsingErrorReplaceTokens = Syntax + Internal + 237; + int ParsingErrorNoSuggestionForTokens = Syntax + Internal + 238; + int ParsingErrorUnexpectedEOF = Syntax + Internal + 239; + int ParsingErrorInsertToComplete = Syntax + Internal + 240; + int ParsingErrorInsertToCompleteScope = Syntax + Internal + 241; + int ParsingErrorInsertToCompletePhrase = Syntax + Internal + 242; + /* START -------------------------------- Bug 197884 Loosly defined var (for statement) and optional semi-colon --------------------- */ + int OptionalSemiColon = Syntax + Internal + 243; + /* END -------------------------------- Bug 197884 Loosly defined var (for statement) and optional semi-colon --------------------- */ + + + // scanner errors + int EndOfSource = Syntax + Internal + 250; + int InvalidHexa = Syntax + Internal + 251; + int InvalidOctal = Syntax + Internal + 252; + int InvalidCharacterConstant = Syntax + Internal + 253; + int InvalidEscape = Syntax + Internal + 254; + int InvalidInput = Syntax + Internal + 255; + int InvalidUnicodeEscape = Syntax + Internal + 256; + int InvalidFloat = Syntax + Internal + 257; + int NullSourceString = Syntax + Internal + 258; + int UnterminatedString = Syntax + Internal + 259; + int UnterminatedComment = Syntax + Internal + 260; + int NonExternalizedStringLiteral = Internal + 261; + int InvalidDigit = Syntax + Internal + 262; + int InvalidLowSurrogate = Syntax + Internal + 263; + int InvalidHighSurrogate = Syntax + Internal + 264; + int UnnecessaryNLSTag = Internal + 265; + + // type related problems + int DiscouragedReference = TypeRelated + 280; + + int DuplicateModifierForType = TypeRelated + 301; + int IllegalModifierForClass = TypeRelated + 302; + int IllegalModifierForMemberClass = TypeRelated + 304; + int IllegalModifierForLocalClass = TypeRelated + 306; + int ForbiddenReference = TypeRelated + 307; + int IllegalModifierCombinationFinalAbstractForClass = TypeRelated + 308; + int IllegalVisibilityModifierCombinationForMemberType = TypeRelated + 310; + int IllegalStaticModifierForMemberType = TypeRelated + 311; + int SuperclassMustBeAClass = TypeRelated + 312; + int ClassExtendFinalClass = TypeRelated + 313; + int HierarchyCircularitySelfReference = TypeRelated + 316; + int HierarchyCircularity = TypeRelated + 317; + int HidingEnclosingType = TypeRelated + 318; + int DuplicateNestedType = TypeRelated + 319; + int CannotThrowType = TypeRelated + 320; + int PackageCollidesWithType = TypeRelated + 321; + int TypeCollidesWithPackage = TypeRelated + 322; + int DuplicateTypes = TypeRelated + 323; + int IsClassPathCorrect = TypeRelated + 324; + int MustSpecifyPackage = Internal + 326; + int HierarchyHasProblems = TypeRelated + 327; + int PackageIsNotExpectedPackage = Internal + 328; + int ObjectCannotHaveSuperTypes = Internal + 329; + int ObjectMustBeClass = Internal + 330; + + // field related problems + int DuplicateField = FieldRelated + 340; + int DuplicateModifierForField = FieldRelated + 341; + int IllegalModifierForField = FieldRelated + 342; + int IllegalVisibilityModifierCombinationForField = FieldRelated + 344; + int IllegalModifierCombinationFinalVolatileForField = FieldRelated + 345; + int UnexpectedStaticModifierForField = FieldRelated + 346; + + // method related problems + int DuplicateMethod = MethodRelated + 355; + int DuplicateModifierForMethod = MethodRelated + 357; + int IllegalModifierForMethod = MethodRelated + 358; + int IllegalVisibilityModifierCombinationForMethod = MethodRelated + 360; + int UnexpectedStaticModifierForMethod = MethodRelated + 361; + int IllegalAbstractModifierCombinationForMethod = MethodRelated + 362; + int AbstractMethodInAbstractClass = MethodRelated + 363; + int ArgumentTypeCannotBeVoid = MethodRelated + 364; + int NativeMethodsCannotBeStrictfp = MethodRelated + 367; + int DuplicateModifierForArgument = MethodRelated + 368; + + // import related problems + int ConflictingImport = ImportRelated + 385; + int DuplicateImport = ImportRelated + 386; + int CannotImportPackage = ImportRelated + 387; + + int ImportNotFound = ImportRelated + 389 + ProblemReasons.NotFound; // ImportRelated + 390 + + // local variable related problems + int DuplicateModifierForVariable = MethodRelated + 395; + + // method verifier problems + int AbstractMethodMustBeImplemented = MethodRelated + 400; + int IncompatibleExceptionInThrowsClause = MethodRelated + 402; + int IncompatibleExceptionInInheritedMethodThrowsClause = MethodRelated + 403; + int IncompatibleReturnType = MethodRelated + 404; + int InheritedMethodReducesVisibility = MethodRelated + 405; + int CannotOverrideAStaticMethodWithAnInstanceMethod = MethodRelated + 406; + int CannotHideAnInstanceMethodWithAStaticMethod = MethodRelated + 407; + int StaticInheritedMethodConflicts = MethodRelated + 408; + int MethodReducesVisibility = MethodRelated + 409; + int OverridingNonVisibleMethod = MethodRelated + 410; + int AbstractMethodCannotBeOverridden = MethodRelated + 411; + int OverridingDeprecatedMethod = MethodRelated + 412; + int IllegalVararg = MethodRelated + 415; + int OverridingMethodWithoutSuperInvocation = MethodRelated + 416; + + // code snippet support + int CodeSnippetMissingClass = Internal + 420; + int CodeSnippetMissingMethod = Internal + 421; + + //constant pool + int TooManyConstantsInConstantPool = Internal + 430; + int TooManyBytesForStringConstant = Internal + 431; + + // static constraints + int TooManyFields = Internal + 432; + int TooManyMethods = Internal + 433; + + // 1.4 features + // assertion warning + int UseAssertAsAnIdentifier = Internal + 440; + + // 1.5 features + int UseEnumAsAnIdentifier = Internal + 441; + + // detected task + int Task = Internal + 450; + + // local variables related problems, cont'd + int NullLocalVariableReference = Internal + 451; + int PotentialNullLocalVariableReference = Internal + 452; + int RedundantNullCheckOnNullLocalVariable = Internal + 453; + int NullLocalVariableComparisonYieldsFalse = Internal + 454; + int RedundantLocalVariableNullAssignment = Internal + 455; + int NullLocalVariableInstanceofYieldsFalse = Internal + 456; + int RedundantNullCheckOnNonNullLocalVariable = Internal + 457; + int NonNullLocalVariableComparisonYieldsFalse = Internal + 458; + + + // block + int UndocumentedEmptyBlock = Internal + 460; + + /* + * Javadoc comments + */ + /** + * Problem signaled on an hidden reference due to a too low visibility level. + */ + int JavadocHiddenReference = Javadoc + Internal + 465; + /** + * Problem signaled on an invalid qualification for member type reference. + */ + int JavadocInvalidMemberTypeQualification = Javadoc + Internal + 466; + int JavadocMissingIdentifier = Javadoc + Internal + 467; + int JavadocNonStaticTypeFromStaticInvocation = Javadoc + Internal + 468; + int JavadocUnexpectedTag = Javadoc + Internal + 470; + int JavadocMissingParamTag = Javadoc + Internal + 471; + int JavadocMissingParamName = Javadoc + Internal + 472; + int JavadocDuplicateParamName = Javadoc + Internal + 473; + int JavadocInvalidParamName = Javadoc + Internal + 474; + int JavadocMissingReturnTag = Javadoc + Internal + 475; + int JavadocDuplicateReturnTag = Javadoc + Internal + 476; + int JavadocMissingThrowsTag = Javadoc + Internal + 477; + int JavadocMissingThrowsClassName = Javadoc + Internal + 478; + int JavadocInvalidThrowsClass = Javadoc + Internal + 479; + int JavadocDuplicateThrowsClassName = Javadoc + Internal + 480; + int JavadocInvalidThrowsClassName = Javadoc + Internal + 481; + int JavadocMissingSeeReference = Javadoc + Internal + 482; + int JavadocInvalidSeeReference = Javadoc + Internal + 483; + int JavadocInvalidSeeHref = Javadoc + Internal + 484; + int JavadocInvalidSeeArgs = Javadoc + Internal + 485; + int JavadocMissing = Javadoc + Internal + 486; + int JavadocInvalidTag = Javadoc + Internal + 487; + /* + * ID for field errors in Javadoc + */ + int JavadocUndefinedField = Javadoc + Internal + 488; + int JavadocNotVisibleField = Javadoc + Internal + 489; + int JavadocAmbiguousField = Javadoc + Internal + 490; + int JavadocUsingDeprecatedField = Javadoc + Internal + 491; + /* + * IDs for constructor errors in Javadoc + */ + int JavadocUndefinedConstructor = Javadoc + Internal + 492; + int JavadocNotVisibleConstructor = Javadoc + Internal + 493; + int JavadocAmbiguousConstructor = Javadoc + Internal + 494; + int JavadocUsingDeprecatedConstructor = Javadoc + Internal + 495; + /* + * IDs for method errors in Javadoc + */ + int JavadocUndefinedMethod = Javadoc + Internal + 496; + int JavadocNotVisibleMethod = Javadoc + Internal + 497; + int JavadocAmbiguousMethod = Javadoc + Internal + 498; + int JavadocUsingDeprecatedMethod = Javadoc + Internal + 499; + int JavadocNoMessageSendOnBaseType = Javadoc + Internal + 500; + int JavadocParameterMismatch = Javadoc + Internal + 501; + int JavadocNoMessageSendOnArrayType = Javadoc + Internal + 502; + /* + * IDs for type errors in Javadoc + */ + int JavadocUndefinedType = Javadoc + Internal + 503; + int JavadocNotVisibleType = Javadoc + Internal + 504; + int JavadocAmbiguousType = Javadoc + Internal + 505; + int JavadocUsingDeprecatedType = Javadoc + Internal + 506; + int JavadocInternalTypeNameProvided = Javadoc + Internal + 507; + int JavadocInheritedMethodHidesEnclosingName = Javadoc + Internal + 508; + int JavadocInheritedFieldHidesEnclosingName = Javadoc + Internal + 509; + int JavadocInheritedNameHidesEnclosingTypeName = Javadoc + Internal + 510; + int JavadocUnterminatedInlineTag = Javadoc + Internal + 512; + int JavadocMalformedSeeReference = Javadoc + Internal + 513; + int JavadocMessagePrefix = Internal + 514; + int JavadocMissingHashCharacter = Javadoc + Internal + 515; + int JavadocEmptyReturnTag = Javadoc + Internal + 516; + int JavadocUnexpectedText = Javadoc + Internal + 518; + int JavadocInvalidParamTagName = Javadoc + Internal + 519; + + /** + * Foreach + */ + int IncompatibleTypesInForeach = TypeRelated + 580; + int InvalidTypeForCollection = Internal + 581; + + /** + * 1.5 Syntax errors (when source level < 1.5) + */ + int InvalidUsageOfForeachStatements = Syntax + Internal + 592; + + /** + * Corrupted binaries + */ + int CorruptedSignature = Internal + 700; + /** + * Corrupted source + */ + int InvalidEncoding = Internal + 701; + int CannotReadSource = Internal + 702; + + /** + * External problems -- These are problems defined by other plugins + */ + + int ExternalProblemNotFixable = 900; + + // indicates an externally defined problem that has a quick-assist processor + // associated with it + int ExternalProblemFixable = 901; + + int InvalidValueForSetter = 902; + int InvalidValueForGetter = 903; +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/IScanner.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/IScanner.java new file mode 100644 index 0000000..f53f242 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/IScanner.java @@ -0,0 +1,154 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.compiler; + + + /** + * Definition of a JavaScript scanner, as returned by the ToolFactory. + * The scanner is responsible for tokenizing a given source, providing information about + * the nature of the token read, its positions and source equivalent. + *

+ * When the scanner has finished tokenizing, it answers an EOF token ( + * ITerminalSymbols#TokenNameEOF. + *

+ * When encountering lexical errors, an InvalidInputException is thrown. + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * @see org.eclipse.wst.jsdt.core.ToolFactory + * @see ITerminalSymbols + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface IScanner { + + /** + * Answers the current identifier source, after unicode escape sequences have + * been translated into unicode characters. + * For example, if original source was \\u0061bc then it will answer abc. + * + * @return the current identifier source, after unicode escape sequences have + * been translated into unicode characters + */ + char[] getCurrentTokenSource(); + + /** + * Answers the current identifier source, before unicode escape sequences have + * been translated into unicode characters. + * For example, if original source was \\u0061bc then it will answer \\u0061bc. + * + * @return the current identifier source, before unicode escape sequences have + * been translated into unicode characters + * @since 2.1 + */ + char[] getRawTokenSource(); + + /** + * Answers the starting position of the current token inside the original source. + * This position is zero-based and inclusive. It corresponds to the position of the first character + * which is part of this token. If this character was a unicode escape sequence, it points at the first + * character of this sequence. + * + * @return the starting position of the current token inside the original source + */ + int getCurrentTokenStartPosition(); + + /** + * Answers the ending position of the current token inside the original source. + * This position is zero-based and inclusive. It corresponds to the position of the last character + * which is part of this token. If this character was a unicode escape sequence, it points at the last + * character of this sequence. + * + * @return the ending position of the current token inside the original source + */ + int getCurrentTokenEndPosition(); + + /** + * Answers the starting position of a given line number. This line has to have been encountered + * already in the tokenization process (in other words, it cannot be used to compute positions of lines beyond + * current token). Once the entire source has been processed, it can be used without any limit. + * Line starting positions are zero-based, and start immediately after the previous line separator (if any). + * + * @param lineNumber the given line number + * @return the starting position of a given line number + */ + int getLineStart(int lineNumber); + + /** + * Answers the ending position of a given line number. This line has to have been encountered + * already in the tokenization process (in other words, it cannot be used to compute positions of lines beyond + * current token). Once the entire source has been processed, it can be used without any limit. + * Line ending positions are zero-based, and correspond to the last character of the line separator + * (in case multi-character line separators). + * + * @param lineNumber the given line number + * @return the ending position of a given line number + **/ + int getLineEnd(int lineNumber); + + /** + * Answers an array of the ending positions of the lines encountered so far. Line ending positions + * are zero-based, and correspond to the last character of the line separator (in case multi-character + * line separators). + * + * @return an array of the ending positions of the lines encountered so far + */ + int[] getLineEnds(); + + /** + * Answers a 1-based line number using the lines which have been encountered so far. If the position + * is located beyond the current scanned line, then the last line number will be answered. + * + * @param charPosition the given character position + * @return a 1-based line number using the lines which have been encountered so far + */ + int getLineNumber(int charPosition); + + /** + * Read the next token in the source, and answers its ID as specified by ITerminalSymbols. + * Note that the actual token ID values are subject to change if new keywords were added to the language + * (for instance, 'assert' is a keyword in 1.4). + * + * @throws InvalidInputException in case a lexical error was detected while reading the current token + * @return the next token + */ + int getNextToken() throws InvalidInputException; + + /** + * Answers the original source being processed (not a copy of it). + * + * @return the original source being processed + */ + char[] getSource(); + + /** + * Reposition the scanner on some portion of the original source. The given endPosition is the last valid position. + * Beyond this position, the scanner will answer EOF tokens (ITerminalSymbols.TokenNameEOF). + * + * @param startPosition the given start position + * @param endPosition the given end position + */ + void resetTo(int startPosition, int endPosition); + + /** + * Set the scanner source to process. By default, the scanner will consider starting at the beginning of the + * source until it reaches its end. + * If the given source is null, this clears the source. + * + * @param source the given source + */ + void setSource(char[] source); +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/ITerminalSymbols.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/ITerminalSymbols.java new file mode 100644 index 0000000..364a7b4 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/ITerminalSymbols.java @@ -0,0 +1,166 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.compiler; + +/** + * Maps each terminal symbol in the javaScript-grammar into a unique integer. + * This integer is used to represent the terminal when computing a parsing action. + *

+ * This interface is not intended to be implemented by clients. + *

+ * + * @see IScanner + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface ITerminalSymbols { + + int TokenNameWHITESPACE = 1000; + int TokenNameCOMMENT_LINE = 1001; + int TokenNameCOMMENT_BLOCK = 1002; + int TokenNameCOMMENT_JAVADOC = 1003; + + int TokenNameIdentifier = 5; + int TokenNameabstract = 98; + + int TokenNameassert = 118; + int TokenNameboolean = 18; + int TokenNamebreak = 119; + int TokenNamebyte = 19; + int TokenNamecase = 211; + int TokenNamecatch = 225; + int TokenNamechar = 20; + int TokenNameclass = 165; + int TokenNamecontinue = 120; + int TokenNamedefault = 212; + int TokenNamedo = 121; + int TokenNamedouble = 21; + int TokenNameelse = 213; + int TokenNameextends = 243; + int TokenNamefalse = 37; + int TokenNamefinal = 99; + int TokenNamefinally = 226; + int TokenNamefloat = 22; + int TokenNamefor = 122; + int TokenNameif = 123; + int TokenNameimplements = 268; + int TokenNameimport = 191; + int TokenNameinstanceof = 65; + int TokenNameint = 23; + int TokenNameinterface = 180; + int TokenNamelong = 24; + int TokenNamenative = 100; + int TokenNamenew = 32; + int TokenNamenull = 38; + int TokenNamepackage = 214; + int TokenNameprivate = 101; + int TokenNameprotected = 102; + int TokenNamepublic = 103; + int TokenNamereturn = 124; + int TokenNameshort = 25; + int TokenNamestatic = 94; + int TokenNamestrictfp = 104; + int TokenNamesuper = 33; + int TokenNameswitch = 125; + int TokenNamesynchronized = 85; + int TokenNamethis = 34; + int TokenNamethrow = 126; + int TokenNamethrows = 227; + int TokenNametransient = 105; + int TokenNametrue = 39; + int TokenNametry = 127; + int TokenNamevoid = 26; + int TokenNamevolatile = 106; + int TokenNamewhile = 117; + int TokenNameIntegerLiteral = 40; + int TokenNameLongLiteral = 41; + int TokenNameFloatingPointLiteral = 42; + int TokenNameDoubleLiteral = 43; + int TokenNameCharacterLiteral = 44; + int TokenNameStringLiteral = 45; + int TokenNameRegExLiteral = 46; + int TokenNamePLUS_PLUS = 1; + int TokenNameMINUS_MINUS = 2; + int TokenNameEQUAL_EQUAL = 35; + int TokenNameLESS_EQUAL = 66; + int TokenNameGREATER_EQUAL = 67; + int TokenNameNOT_EQUAL = 36; + int TokenNameLEFT_SHIFT = 14; + int TokenNameRIGHT_SHIFT = 11; + int TokenNameUNSIGNED_RIGHT_SHIFT = 12; + int TokenNamePLUS_EQUAL = 168; + int TokenNameMINUS_EQUAL = 169; + int TokenNameMULTIPLY_EQUAL = 170; + int TokenNameDIVIDE_EQUAL = 171; + int TokenNameAND_EQUAL = 172; + int TokenNameOR_EQUAL = 173; + int TokenNameXOR_EQUAL = 174; + int TokenNameREMAINDER_EQUAL = 175; + int TokenNameLEFT_SHIFT_EQUAL = 176; + int TokenNameRIGHT_SHIFT_EQUAL = 177; + int TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL = 178; + int TokenNameOR_OR = 80; + int TokenNameAND_AND = 79; + int TokenNamePLUS = 3; + int TokenNameMINUS = 4; + int TokenNameNOT = 71; + int TokenNameREMAINDER = 9; + int TokenNameXOR = 63; + int TokenNameAND = 62; + int TokenNameMULTIPLY = 8; + int TokenNameOR = 70; + int TokenNameTWIDDLE = 72; + int TokenNameDIVIDE = 10; + int TokenNameGREATER = 68; + int TokenNameLESS = 69; + int TokenNameLPAREN = 7; + int TokenNameRPAREN = 86; + int TokenNameLBRACE = 110; + int TokenNameRBRACE = 95; + int TokenNameLBRACKET = 15; + int TokenNameRBRACKET = 166; + int TokenNameSEMICOLON = 64; + int TokenNameQUESTION = 81; + int TokenNameCOLON = 154; + int TokenNameCOMMA = 90; + int TokenNameDOT = 6; + int TokenNameEQUAL = 167; + int TokenNameEOF = 158; + int TokenNameERROR = 309; + + int TokenNameenum = 400; + + int TokenNameAT = 401; + + int TokenNameELLIPSIS = 402; + + int TokenNameconst = 403; + + int TokenNamegoto = 404; + + int TokenNameNOT_EQUAL_EQUAL=450; + int TokenNameEQUAL_EQUAL_EQUAL=451; + int TokenNamedelete=452; + int TokenNamedebugger=453; + int TokenNameexport=454; + int TokenNamefunction=455; + int TokenNamein=456; + int TokenNameinfinity=457; + int TokenNametypeof=458; + int TokenNameundefined=459; + int TokenNamevar=460; + int TokenNamewith=461; + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/InvalidInputException.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/InvalidInputException.java new file mode 100644 index 0000000..bac98f2 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/InvalidInputException.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.compiler; + +/** + * Exception thrown by a scanner when encountering lexical errors. + *

+ * This class is not intended to be instantiated or subclassed by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public class InvalidInputException extends Exception { + + private static final long serialVersionUID = 2909732853499731592L; // backward compatible + +/** + * Creates a new exception with no detail message. + */ +public InvalidInputException() { + super(); +} + +/** + * Creates a new exception with the given detail message. + * @param message the detail message + */ +public InvalidInputException(String message) { + super(message); +} +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/ReconcileContext.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/ReconcileContext.java new file mode 100644 index 0000000..fe4ef07 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/ReconcileContext.java @@ -0,0 +1,198 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * mkaufman@bea.com - initial API and implementation + * IBM - renamed from PreReconcileCompilationResult to ReconcileContext + * IBM - rewrote spec + * + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.compiler; + +import java.util.HashMap; + +import org.eclipse.wst.jsdt.core.IJavaScriptUnit; +import org.eclipse.wst.jsdt.core.IJavaScriptElementDelta; +import org.eclipse.wst.jsdt.core.IJavaScriptModelMarker; +import org.eclipse.wst.jsdt.core.JavaScriptModelException; +import org.eclipse.wst.jsdt.core.dom.AST; +import org.eclipse.wst.jsdt.core.dom.ASTParser; +import org.eclipse.wst.jsdt.internal.core.CompilationUnit; +import org.eclipse.wst.jsdt.internal.core.JavaProject; +import org.eclipse.wst.jsdt.internal.core.ReconcileWorkingCopyOperation; + +/** + * The context of a reconcile event that is notified to interested validation + * participants while a reconcile operation is running. + *

+ * A reconcile participant can get the AST for the reconcile-operation using + * {@link #getAST3()}. If the participant modifies in any way the AST + * (either by modifying the source of the working copy, or modifying another entity + * that would result in different bindings for the AST), it is expected to reset the + * AST in the context using {@link #resetAST()}. + *

+ * A reconcile participant can also create and return problems using + * {@link #putProblems(String, CategorizedProblem[])}. These problems are then reported + * to the problem requestor of the reconcile operation. + *

+ * This class is not intended to be instanciated or subclassed by clients. + *

+ * + * @see ValidationParticipant#reconcile(ReconcileContext) + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public class ReconcileContext { + + private ReconcileWorkingCopyOperation operation; + private CompilationUnit workingCopy; + +/** + * Creates a reconcile context for the given reconcile operation. + *

+ * This constructor is not intended to be called by clients. + *

+ * + * @param operation the reconcile operation + */ +public ReconcileContext(ReconcileWorkingCopyOperation operation, CompilationUnit workingCopy) { + this.operation = operation; + this.workingCopy = workingCopy; +} + +/** + * Returns a resolved AST with {@link AST#JLS3 JLS3} level. + * It is created from the current state of the working copy. + * Creates one if none exists yet. + * Returns null if the current state of the working copy + * doesn't allow the AST to be created (e.g. if the working copy's content + * cannot be parsed). + *

+ * If the AST level requested during reconciling is not {@link AST#JLS3} + * or if binding resolutions was not requested, then a different AST is created. + * Note that this AST does not become the current AST and it is only valid for + * the requestor. + *

+ * + * @return the AST created from the current state of the working copy, + * or null if none could be created + * @exception JavaScriptModelException if the contents of the working copy + * cannot be accessed. Reasons include: + *
    + *
  • The working copy does not exist (ELEMENT_DOES_NOT_EXIST)
  • + *
+ */ +public org.eclipse.wst.jsdt.core.dom.JavaScriptUnit getAST3() throws JavaScriptModelException { + if (this.operation.astLevel != AST.JLS3 || !this.operation.resolveBindings) { + // create AST (optionally resolving bindings) + ASTParser parser = ASTParser.newParser(AST.JLS3); + parser.setCompilerOptions(workingCopy.getJavaScriptProject().getOptions(true)); + if (JavaProject.hasJavaNature(workingCopy.getJavaScriptProject().getProject())) + parser.setResolveBindings(true); + parser.setStatementsRecovery((this.operation.reconcileFlags & IJavaScriptUnit.ENABLE_STATEMENTS_RECOVERY) != 0); + parser.setBindingsRecovery((this.operation.reconcileFlags & IJavaScriptUnit.ENABLE_BINDINGS_RECOVERY) != 0); + parser.setSource(workingCopy); + return (org.eclipse.wst.jsdt.core.dom.JavaScriptUnit) parser.createAST(this.operation.progressMonitor); + } + return this.operation.makeConsistent(this.workingCopy); +} + +/** + * Returns the AST level requested by the reconcile operation. + * It is either {@link IJavaScriptUnit#NO_AST}, or one of the JLS constants defined on {@link AST}. + * + * @return the AST level requested by the reconcile operation + */ +public int getASTLevel() { + return this.operation.astLevel; +} + +/** + * Returns whether the reconcile operation is resolving bindings. + * + * @return whether the reconcile operation is resolving bindings + */ +public boolean isResolvingBindings() { + return this.operation.resolveBindings; +} + +/** + * Returns the delta describing the change to the working copy being reconciled. + * Returns null if there is no change. + * Note that the delta's AST is not yet positioned at this stage. Use {@link #getAST3()} + * to get the current AST. + * + * @return the delta describing the change, or null if none + */ +public IJavaScriptElementDelta getDelta() { + return this.operation.deltaBuilder.delta; +} + +/** + * Returns the problems to be reported to the problem requester of the reconcile operation + * for the given marker type. + * Returns null if no problems need to be reported for this marker type. + * + * @param markerType the given marker type + * @return problems to be reported to the problem requester + */ +public CategorizedProblem[] getProblems(String markerType) { + if (this.operation.problems == null) return null; + return (CategorizedProblem[]) this.operation.problems.get(markerType); +} + +/** + * Returns the working copy this context refers to. + * + * @return the working copy this context refers to + */ +public IJavaScriptUnit getWorkingCopy() { + return this.workingCopy; +} + +/** + * Resets the AST carried by this context. + * A validation participant that modifies the environment that would result in different + * bindings for the AST is expected to reset the AST on this context, so that other + * participants don't get a stale AST. + *

+ * Note that resetting the AST will not restart the reconcile process. Only further + * participants will see the new AST. Thus participants running before the one that + * resets the AST will have a stale view of the AST and its problems. Use + * the validation participant extension point to order the participants. + *

+ */ +public void resetAST() { + this.operation.ast = null; + putProblems(IJavaScriptModelMarker.JAVASCRIPT_MODEL_PROBLEM_MARKER, null); + putProblems(IJavaScriptModelMarker.TASK_MARKER, null); +} + +/** + * Sets the problems to be reported to the problem requester of the reconcile operation + * for the given marker type. + * null indicates that no problems need to be reported. + *

+ * Using this functionality, a participant that resolves problems for a given marker type + * can hide those problems since they don't exist any longer. + *

+ * + * @param markerType the marker type of the given problems + * @param problems the problems to be reported to the problem requester of the reconcile operation, + * or null if none + */ +public void putProblems(String markerType, CategorizedProblem[] problems) { + if (this.operation.problems == null) + this.operation.problems = new HashMap(); + this.operation.problems.put(markerType, problems); +} + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/ValidationParticipant.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/ValidationParticipant.java new file mode 100644 index 0000000..9360a70 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/ValidationParticipant.java @@ -0,0 +1,109 @@ +/******************************************************************************* + * Copyright (c) 2005, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * mkaufman@bea.com - initial API as IvalidationParticipant + * IBM - changed from interface IvalidationParticipant to abstract class validationParticipant + * IBM - rewrote spec + * + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.compiler; + +import org.eclipse.wst.jsdt.core.IJavaScriptProject; + +/** + * A validation participant is notified of events occuring during the validation process. + * The notified events are the result of a build action, a clean action, a reconcile operation + * (for a working copy), etc. + *

+ * Clients wishing to participate in the validation process must subclass this class, and implement + * {@link #isActive(IJavaScriptProject)}, {@link #aboutToBuild(IJavaScriptProject)}, + * {@link #reconcile(ReconcileContext)}, etc. +*

+ * This class is intended to be subclassed by clients. + *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public abstract class ValidationParticipant { + +public static int READY_FOR_BUILD = 1; +public static int NEEDS_FULL_BUILD = 2; + +/** + * Notifies this participant that a validation is about to start and provides it the opportunity to + * create missing source folders for generated source files. Additional source folders + * should be marked as optional so the project can be built when the folders do not exist. + * Only sent to participants interested in the project. + *

+ * Default is to return READY_FOR_BUILD. + *

+ * @param project the project about to build + * @return READY_FOR_BUILD or NEEDS_FULL_BUILD + */ +public int aboutToBuild(IJavaScriptProject project) { + return READY_FOR_BUILD; +} + +/** + * Notifies this participant that a validation operation is about to start and provides it the opportunity to + * generate source files based on the source files about to be validated. + * When isBatchBuild is true, then files contains all source files in the project. + * Only sent to participants interested in the current build project. + * + * @param files is an array of BuildContext + * @param isBatch identifies when the build is a batch build + */ +public void buildStarting(BuildContext[] files, boolean isBatch) { + // do nothing by default +} + +/** + * Notifies this participant that a clean is about to start and provides it the opportunity to + * delete generated source files. + * Only sent to participants interested in the project. + * @param project the project about to be cleaned + */ +public void cleanStarting(IJavaScriptProject project) { + // do nothing by default +} + +/** + * Returns whether this participant is active for a given project. + *

+ * Default is to return false. + *

+ * For efficiency, participants that are not interested in the + * given project should return false for that project. + *

+ * @param project the project to participate in + * @return whether this participant is active for a given project + */ +public boolean isActive(IJavaScriptProject project) { + return false; +} + +/** + * Notifies this participant that a reconcile operation is happening. The participant can act on this reconcile + * operation by using the given context. Other participant can then see the result of this participation + * on this context. + *

+ * Note that a participant should not modify the buffer of the working copy that is being reconciled. + *

+ * Default is to do nothing. + *

+ * @param context the reconcile context to act on + */ +public void reconcile(ReconcileContext context) { + // do nothing by default +} + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/libraries/LibraryLocation.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/libraries/LibraryLocation.java new file mode 100644 index 0000000..0c8ad26 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/libraries/LibraryLocation.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright (c) 2005, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core.compiler.libraries; + +import org.eclipse.core.runtime.IPath; +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public interface LibraryLocation { + + /** + * @param name + * @return path to the given library name + */ + public String getLibraryPath(String name); + + /** + * @return a list of files in the library + */ + public char[][] getLibraryFileNames(); + + /** + * @return relative path within the plugin library files are stored + */ + public IPath getLibraryPathInPlugin(); + + /** + * @return working location to store library files. + */ + public IPath getWorkingLibPath(); + + /** + * @param name + * @return path to the given library name + */ + public String getLibraryPath(char[] name); +} \ No newline at end of file diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/libraries/SystemLibraryLocation.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/libraries/SystemLibraryLocation.java new file mode 100644 index 0000000..9d87517 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/libraries/SystemLibraryLocation.java @@ -0,0 +1,212 @@ +/******************************************************************************* + * Copyright (c) 2005, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core.compiler.libraries; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URL; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.List; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.eclipse.wst.jsdt.core.JavaScriptCore; +import org.eclipse.wst.jsdt.internal.core.util.Util; +/** + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public class SystemLibraryLocation implements LibraryLocation { + + public static final char[] SYSTEM_LIBARAY_NAME= {'s','y','s','t','e','m','.','j','s'}; + public static final char[] LIBRARY_RUNTIME_DIRECTORY={'l','i','b','r','a','r','i','e','s'}; + public static final char[] LIBRARY_PLUGIN_DIRECTORY={'l','i','b','r','a','r','i','e','s'}; + private static final boolean AUTO_UPDATE_LIBS=true; + + private static SystemLibraryLocation fInstance; + + public static LibraryLocation getInstance() { + if(fInstance==null) + fInstance = new SystemLibraryLocation(); + return fInstance; + } + + public IPath getLibraryPathInPlugin() { + return new Path("libraries"); //$NON-NLS-1$ + } + + public char[][] getLibraryFileNames() { + return new char[][] {SYSTEM_LIBARAY_NAME}; + } + + protected String getPluginId() { + return JavaScriptCore.PLUGIN_ID; + } + + public char[][] getAllFilesInPluginDirectory(String directory){ + Enumeration entries = (Platform.getBundle(getPluginId()).getEntryPaths(directory)); + List allEntries = new ArrayList(); + while (entries.hasMoreElements()) { + Path value = new Path((String) entries.nextElement()); + char[] filename = value.lastSegment().toCharArray(); + if (Util.isJavaLikeFileName(filename)) { //$NON-NLS-1$ + allEntries.add(filename); + } + } + char[][] fileNames = new char[allEntries.size()][]; + + for (int i = 0; i < allEntries.size(); i++) { + fileNames[i] = (char[]) allEntries.get(i); + } + + return fileNames; + } + + public SystemLibraryLocation() { + super(); + + IPath libraryRuntimePath = Platform.getStateLocation(Platform.getBundle(JavaScriptCore.PLUGIN_ID)).append(new String(LIBRARY_RUNTIME_DIRECTORY)); + try { + if (!libraryRuntimePath.toFile().exists()) { + libraryRuntimePath.toFile().mkdir(); + } + } + catch (SecurityException e) { + Platform.getLog(Platform.getBundle(JavaScriptCore.PLUGIN_ID)).log(new Status(IStatus.ERROR, JavaScriptCore.PLUGIN_ID, "Problem creating folder " + libraryRuntimePath, e));//$NON-NLS-1$ + } + + char[][] libFiles = getLibraryFileNames(); + + for (int i = 0; i < libFiles.length; i++) { + IPath workingLibLocation = libraryRuntimePath.addTrailingSeparator().append(new String(libFiles[i])); + File library = workingLibLocation.toFile(); + + if (!library.exists()) { + InputStream is = null; + try { + is = FileLocator.openStream(Platform.getBundle(getPluginId()), getLibraryPathInPlugin().append(new String(libFiles[i])), false); + } + catch (IOException e) { + Platform.getLog(Platform.getBundle(getPluginId())).log(new Status(IStatus.ERROR, getPluginId(), "Could not read " + getPluginId() + ":" + getLibraryPathInPlugin().append(new String(libFiles[i])), e));//$NON-NLS-1$ //$NON-NLS-2$ + } + if (is != null) { + try { + copyFile(is, library); + } + catch (IOException e) { + Platform.getLog(Platform.getBundle(getPluginId())).log(new Status(IStatus.ERROR, getPluginId(), "Problem writing to " + workingLibLocation, e));//$NON-NLS-1$ + } + } + } + else if (AUTO_UPDATE_LIBS) { + long lastModold = library.lastModified(); + URL path = null; + URL entry = null; + try { + entry = Platform.getBundle(getPluginId()).getEntry(getLibraryPathInPlugin().append(new String(libFiles[i])).toString()); + path = FileLocator.toFileURL(entry); + } + catch (IOException e) { + // URL conversion error + Platform.getLog(Platform.getBundle(JavaScriptCore.PLUGIN_ID)).log(new Status(IStatus.ERROR, getPluginId(), "Problem getting file path from " + entry, e));//$NON-NLS-1$ + } + catch (IllegalStateException e) { + // bundle uninstalled, not really bad? + } + + if (path != null) { + File inPlugin = new File(path.getFile()); + long lastModNew = inPlugin.lastModified(); + if (lastModNew > lastModold) { + InputStream is = null; + try { + is = FileLocator.openStream(Platform.getBundle(getPluginId()), getLibraryPathInPlugin().append(new String(libFiles[i])), false); + } + catch (IOException e) { + Platform.getLog(Platform.getBundle(getPluginId())).log(new Status(IStatus.ERROR, getPluginId(), "Could not read " + getPluginId() + ":" + getLibraryPathInPlugin().append(new String(libFiles[i])), e));//$NON-NLS-1$ //$NON-NLS-2$ + } + + if (is != null) { + // Updating old library file + library.delete(); + + try { + copyFile(is, library); + } + catch (IOException e) { + Platform.getLog(Platform.getBundle(getPluginId())).log(new Status(IStatus.ERROR, getPluginId(), "Problem writing to " + library, e));//$NON-NLS-1$ + } + } + } + } + } + } + } + + + public IPath getWorkingLibPath() { + return new Path(getLibraryPath("")); //$NON-NLS-1$ + } + + /* (non-Javadoc) + * @see org.eclipse.wst.jsdt.core.compiler.libraries.LibraryLocation#getLibraryPath(java.lang.String) + */ + public String getLibraryPath(String name){ + return JavaScriptCore.getPlugin().getStateLocation().append( new String(LIBRARY_RUNTIME_DIRECTORY) ).addTrailingSeparator().append(name).toString(); + } + + public String getLibraryPath(char[] name){ + return getLibraryPath(new String(name)); + + } + protected static void copyFile(InputStream src, File dst) throws IOException { + InputStream in = null; + OutputStream out = null; + try { + in = new BufferedInputStream(src); + out = new BufferedOutputStream(new FileOutputStream(dst)); + byte[] buffer = new byte[4096]; + int len; + while ((len = in.read(buffer)) != -1) { + out.write(buffer, 0, len); + } + } + finally { + if (in != null) + try { + in.close(); + } + catch (IOException e) { + // problem closing, no recovery or diagnosis possible + } + if (out != null) + try { + out.close(); + } + catch (IOException e) { + // problem closing, no recovery or diagnosis possible + } + } + } +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AST.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AST.java new file mode 100644 index 0000000..4c8c9e6 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AST.java @@ -0,0 +1,2372 @@ +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.dom; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringTokenizer; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.text.IDocument; +import org.eclipse.text.edits.TextEdit; +import org.eclipse.wst.jsdt.core.IJavaScriptUnit; +import org.eclipse.wst.jsdt.core.JavaScriptCore; +import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants; +import org.eclipse.wst.jsdt.internal.compiler.parser.Scanner; + +/** + * Umbrella owner and abstract syntax tree node factory. + * An AST instance serves as the common owner of any number of + * AST nodes, and as the factory for creating new AST nodes owned by that + * instance. + *

+ * Abstract syntax trees may be hand constructed by clients, using the + * newTYPE factory methods to create new nodes, and the + * various setCHILD methods + * (see {@link org.eclipse.wst.jsdt.core.dom.ASTNode ASTNode} and its subclasses) + * to connect them together. + *

+ *

+ * Each AST node belongs to a unique AST instance, called the owning AST. + * The children of an AST node always have the same owner as their parent node. + * If a node from one AST is to be added to a different AST, the subtree must + * be cloned first to ensures that the added nodes have the correct owning AST. + *

+ *

+ * There can be any number of AST nodes owned by a single AST instance that are + * unparented. Each of these nodes is the root of a separate little tree of nodes. + * The method ASTNode.getRoot() navigates from any node to the root + * of the tree that it is contained in. Ordinarily, an AST instance has one main + * tree (rooted at a JavaScriptUnit), with newly-created nodes appearing + * as additional roots until they are parented somewhere under the main tree. + * One can navigate from any node to its AST instance, but not conversely. + *

+ *

+ * The class {@link ASTParser} parses a string + * containing a JavaScript source code and returns an abstract syntax tree + * for it. The resulting nodes carry source ranges relating the node back to + * the original source characters. + *

+ *

+ * JavaScript units created by ASTParser from a + * source document can be serialized after arbitrary modifications + * with minimal loss of original formatting. Here is an example: + *

+ * Document doc = new Document("var abc;\nfunction X() {}\n");
+ * ASTParser parser = ASTParser.newParser(AST.JLS3);
+ * parser.setSource(doc.get().toCharArray());
+ * JavaScriptUnit cu = (JavaScriptUnit) parser.createAST(null);
+ * cu.recordModifications();
+ * AST ast = cu.getAST();
+ * FunctionDeclaration id = ast.newFunctionDeclaration();
+ * id.setName(ast.newName("X2");
+ * cu.statements().add(id); // add declaration at end
+ * TextEdit edits = cu.rewrite(document, null);
+ * UndoEdit undo = edits.apply(document);
+ * 
+ * See also {@link org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite} for + * an alternative way to describe and serialize changes to a + * read-only AST. + *

+ *

+ * Clients may create instances of this class using {@link #newAST(int)}, + * but this class is not intended to be subclassed. + *

+ * + * @see ASTParser + * @see ASTNode + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public final class AST { + /** + * Constant for indicating the AST API that handles standard Javascript. + * This API is capable of handling all constructs + * in the JavaScript language as described in the ECMA-262 + * Specification. + * + * @deprecated Clients should use the {@link #JLS3} AST API instead. + */ + public static final int JLS2 = 2; + + /** + * Internal synonym for {@link #JLS2}. Use to alleviate + * deprecation warnings. + */ + /*package*/ static final int JLS2_INTERNAL = JLS2; + + /** + * Constant for indicating the AST API that handles ECMAScript 4. + * This API is capable of handling all constructs in the + * JavaScript language as described in the ECMAScript 4 + * Specification. + * ECMAScript 4 is a superset of all earlier versions of the + * JavaScript language. + * + */ + public static final int JLS3 = 3; + + /** + * The binding resolver for this AST. Initially a binding resolver that + * does not resolve names at all. + */ + private BindingResolver resolver = new BindingResolver(); + + /** + * The event handler for this AST. + * Initially an event handler that does not nothing. + */ + private NodeEventHandler eventHandler = new NodeEventHandler(); + + /** + * Level of AST API supported by this AST. + */ + int apiLevel; + + /** + * Internal modification count; initially 0; increases monotonically + * by one or more as the AST is successively modified. + */ + private long modificationCount = 0; + + /** + * Internal original modification count; value is equals to + * modificationCount at the end of the parse (ASTParser + * ). If this ast is not created with a parser then value is 0. + */ + private long originalModificationCount = 0; + + /** + * When disableEvents > 0, events are not reported and + * the modification count stays fixed. + *

+ * This mechanism is used in lazy initialization of a node + * to prevent events from being reported for the modification + * of the node as well as for the creation of the missing child. + *

+ */ + private int disableEvents = 0; + + /** + * Internal object unique to the AST instance. Readers must synchronize on + * this object when the modifying instance fields. + */ + private final Object internalASTLock = new Object(); + + /** + * JavaScript Scanner used to validate preconditions for the creation of specific nodes + * like CharacterLiteral, NumberLiteral, StringLiteral or SimpleName. + */ + Scanner scanner; + + /** + * Internal ast rewriter used to record ast modification when record mode is enabled. + */ + InternalASTRewrite rewriter; + + /** + * Default value of flag when a new node is created. + */ + private int defaultNodeFlag = 0; + + /** + * Creates a new JavaScript abstract syntax tree + * (AST) following the specified set of API rules. + * + * @param level the API level; one of the LEVEL constants + */ + private AST(int level) { + if ((level != AST.JLS2) + && (level != AST.JLS3)) { + throw new IllegalArgumentException(); + } + this.apiLevel = level; + // initialize a scanner + this.scanner = new Scanner( + true /*comment*/, + true /*whitespace*/, + false /*nls*/, + ClassFileConstants.JDK1_3 /*sourceLevel*/, + ClassFileConstants.JDK1_5 /*complianceLevel*/, + null/*taskTag*/, + null/*taskPriorities*/, + true/*taskCaseSensitive*/); + } + + /** + * Creates a new, empty abstract syntax tree using default options. + * + * @see JavaScriptCore#getDefaultOptions() + * @deprecated Clients should port their code to use the new JLS3 AST API and call + * {@link #newAST(int) AST.newAST(AST.JLS3)} instead of using this constructor. + */ + public AST() { + this(JavaScriptCore.getDefaultOptions()); + } + + /** + * Internal method. + *

+ * This method converts the given internal compiler AST for the given source string + * into a javaScript unit. This method is not intended to be called by clients. + *

+ * + * @param level the API level; one of the LEVEL constants + * @param compilationUnitDeclaration an internal AST node for a javaScript unit declaration + * @param source the string of the JavaScript javaScript unit + * @param options validator options + * @param workingCopy the working copy that the AST is created from + * @param monitor the progress monitor used to report progress and request cancelation, + * or null if none + * @param isResolved whether the given javaScript unit declaration is resolved + * @return the javaScript unit node + */ + public static JavaScriptUnit convertCompilationUnit( + int level, + org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration compilationUnitDeclaration, + char[] source, + Map options, + boolean isResolved, + org.eclipse.wst.jsdt.internal.core.CompilationUnit workingCopy, + int reconcileFlags, + IProgressMonitor monitor) { + + ASTConverter converter = new ASTConverter(options, isResolved, monitor); + AST ast = AST.newAST(level); + int savedDefaultNodeFlag = ast.getDefaultNodeFlag(); + ast.setDefaultNodeFlag(ASTNode.ORIGINAL); + BindingResolver resolver = null; + if (isResolved) { + resolver = new DefaultBindingResolver(compilationUnitDeclaration.scope, workingCopy.owner, new DefaultBindingResolver.BindingTables(), false); + ast.setFlag(AST.RESOLVED_BINDINGS); + } else { + resolver = new BindingResolver(); + } + ast.setFlag(reconcileFlags); + ast.setBindingResolver(resolver); + converter.setAST(ast); + + JavaScriptUnit unit = converter.convert(compilationUnitDeclaration, source); + unit.setLineEndTable(compilationUnitDeclaration.compilationResult.getLineSeparatorPositions()); + unit.setTypeRoot(workingCopy); + ast.setDefaultNodeFlag(savedDefaultNodeFlag); + return unit; + } + + /** + * Creates a new, empty abstract syntax tree using the given options. + * + * @param options the table of options (key type: String; + * value type: String) + * @see JavaScriptCore#getDefaultOptions() + * @deprecated Clients should port their code to use the new JLS3 AST API and call + * {@link #newAST(int) AST.newAST(AST.JLS3)} instead of using this constructor. + */ + public AST(Map options) { + this(JLS2); + Object sourceLevelOption = options.get(JavaScriptCore.COMPILER_SOURCE); + long sourceLevel = ClassFileConstants.JDK1_3; + if (JavaScriptCore.VERSION_1_4.equals(sourceLevelOption)) { + sourceLevel = ClassFileConstants.JDK1_4; + } else if (JavaScriptCore.VERSION_1_5.equals(sourceLevelOption)) { + sourceLevel = ClassFileConstants.JDK1_5; + } + Object complianceLevelOption = options.get(JavaScriptCore.COMPILER_COMPLIANCE); + long complianceLevel = ClassFileConstants.JDK1_3; + if (JavaScriptCore.VERSION_1_4.equals(complianceLevelOption)) { + complianceLevel = ClassFileConstants.JDK1_4; + } else if (JavaScriptCore.VERSION_1_5.equals(complianceLevelOption)) { + complianceLevel = ClassFileConstants.JDK1_5; + } + // override scanner if 1.4 or 1.5 asked for + this.scanner = new Scanner( + true /*comment*/, + true /*whitespace*/, + false /*nls*/, + sourceLevel /*sourceLevel*/, + complianceLevel /*complianceLevel*/, + null/*taskTag*/, + null/*taskPriorities*/, + true/*taskCaseSensitive*/); + } + + /** + * Creates a new JavaScript abstract syntax tree + * (AST) following the specified set of API rules. + * + * @param level the API level; one of the LEVEL constants + * @return new AST instance following the specified set of API rules. + * @exception IllegalArgumentException if: + *
    + *
  • the API level is not one of the LEVEL constants
  • + *
+ */ + public static AST newAST(int level) { + if ((level != AST.JLS2) + && (level != AST.JLS3)) { + throw new IllegalArgumentException(); + } + return new AST(level); + } + + /** + * Returns the modification count for this AST. The modification count + * is a non-negative value that increases (by 1 or perhaps by more) as + * this AST or its nodes are changed. The initial value is unspecified. + *

+ * The following things count as modifying an AST: + *

    + *
  • creating a new node owned by this AST,
  • + *
  • adding a child to a node owned by this AST,
  • + *
  • removing a child from a node owned by this AST,
  • + *
  • setting a non-node attribute of a node owned by this AST.
  • + *
+ *

+ * Operations which do not entail creating or modifying existing nodes + * do not increase the modification count. + *

+ * N.B. This method may be called several times in the course + * of a single client operation. The only promise is that the modification + * count increases monotonically as the AST or its nodes change; there is + * no promise that a modifying operation increases the count by exactly 1. + *

+ * + * @return the current value (non-negative) of the modification counter of + * this AST + */ + public long modificationCount() { + return this.modificationCount; + } + + /** + * Return the API level supported by this AST. + * + * @return level the API level; one of the JLS*LEVEL + * declared on AST; assume this set is open-ended + */ + public int apiLevel() { + return this.apiLevel; + } + + /** + * Indicates that this AST is about to be modified. + *

+ * The following things count as modifying an AST: + *

    + *
  • creating a new node owned by this AST
  • + *
  • adding a child to a node owned by this AST
  • + *
  • removing a child from a node owned by this AST
  • + *
  • setting a non-node attribute of a node owned by this AST
  • . + *
+ *

+ *

+ * N.B. This method may be called several times in the course + * of a single client operation. + *

+ */ + void modifying() { + // when this method is called during lazy init, events are disabled + // and the modification count will not be increased + if (this.disableEvents > 0) { + return; + } + // increase the modification count + this.modificationCount++; + } + + /** + * Disable events. + * This method is thread-safe for AST readers. + * + * @see #reenableEvents() + */ + final void disableEvents() { + synchronized (this.internalASTLock) { + // guard against concurrent access by another reader + this.disableEvents++; + } + // while disableEvents > 0 no events will be reported, and mod count will stay fixed + } + + /** + * Reenable events. + * This method is thread-safe for AST readers. + * + * @see #disableEvents() + */ + final void reenableEvents() { + synchronized (this.internalASTLock) { + // guard against concurrent access by another reader + this.disableEvents--; + } + } + + /** + * Reports that the given node is about to lose a child. + * + * @param node the node about to be modified + * @param child the node about to be removed + * @param property the child or child list property descriptor + */ + void preRemoveChildEvent(ASTNode node, ASTNode child, StructuralPropertyDescriptor property) { + // IMPORTANT: this method is called by readers during lazy init + synchronized (this.internalASTLock) { + // guard against concurrent access by a reader doing lazy init + if (this.disableEvents > 0) { + // doing lazy init OR already processing an event + // System.out.println("[BOUNCE DEL]"); + return; + } else { + disableEvents(); + } + } + try { + this.eventHandler.preRemoveChildEvent(node, child, property); + // N.B. even if event handler blows up, the AST is not + // corrupted since node has not been changed yet + } finally { + reenableEvents(); + } + } + + /** + * Reports that the given node just lost a child. + * + * @param node the node that was modified + * @param child the child node that was removed + * @param property the child or child list property descriptor + */ + void postRemoveChildEvent(ASTNode node, ASTNode child, StructuralPropertyDescriptor property) { + // IMPORTANT: this method is called by readers during lazy init + synchronized (this.internalASTLock) { + // guard against concurrent access by a reader doing lazy init + if (this.disableEvents > 0) { + // doing lazy init OR already processing an event + // System.out.println("[BOUNCE DEL]"); + return; + } else { + disableEvents(); + } + } + try { + this.eventHandler.postRemoveChildEvent(node, child, property); + // N.B. even if event handler blows up, the AST is not + // corrupted since node has not been changed yet + } finally { + reenableEvents(); + } + } + + /** + * Reports that the given node is about have a child replaced. + * + * @param node the node about to be modified + * @param child the child node about to be removed + * @param newChild the replacement child + * @param property the child or child list property descriptor + */ + void preReplaceChildEvent(ASTNode node, ASTNode child, ASTNode newChild, StructuralPropertyDescriptor property) { + // IMPORTANT: this method is called by readers during lazy init + synchronized (this.internalASTLock) { + // guard against concurrent access by a reader doing lazy init + if (this.disableEvents > 0) { + // doing lazy init OR already processing an event + // System.out.println("[BOUNCE REP]"); + return; + } else { + disableEvents(); + } + } + try { + this.eventHandler.preReplaceChildEvent(node, child, newChild, property); + // N.B. even if event handler blows up, the AST is not + // corrupted since node has not been changed yet + } finally { + reenableEvents(); + } + } + + /** + * Reports that the given node has just had a child replaced. + * + * @param node the node modified + * @param child the child removed + * @param newChild the replacement child + * @param property the child or child list property descriptor + */ + void postReplaceChildEvent(ASTNode node, ASTNode child, ASTNode newChild, StructuralPropertyDescriptor property) { + // IMPORTANT: this method is called by readers during lazy init + synchronized (this.internalASTLock) { + // guard against concurrent access by a reader doing lazy init + if (this.disableEvents > 0) { + // doing lazy init OR already processing an event + // System.out.println("[BOUNCE REP]"); + return; + } else { + disableEvents(); + } + } + try { + this.eventHandler.postReplaceChildEvent(node, child, newChild, property); + // N.B. even if event handler blows up, the AST is not + // corrupted since node has not been changed yet + } finally { + reenableEvents(); + } + } + + /** + * Reports that the given node is about to gain a child. + * + * @param node the node that to be modified + * @param child the node that to be added as a child + * @param property the child or child list property descriptor + */ + void preAddChildEvent(ASTNode node, ASTNode child, StructuralPropertyDescriptor property) { + // IMPORTANT: this method is called by readers during lazy init + synchronized (this.internalASTLock) { + // guard against concurrent access by a reader doing lazy init + if (this.disableEvents > 0) { + // doing lazy init OR already processing an event + // System.out.println("[BOUNCE ADD]"); + return; + } else { + disableEvents(); + } + } + try { + this.eventHandler.preAddChildEvent(node, child, property); + // N.B. even if event handler blows up, the AST is not + // corrupted since node has already been changed + } finally { + reenableEvents(); + } + } + + /** + * Reports that the given node has just gained a child. + * + * @param node the node that was modified + * @param child the node that was added as a child + * @param property the child or child list property descriptor + */ + void postAddChildEvent(ASTNode node, ASTNode child, StructuralPropertyDescriptor property) { + // IMPORTANT: this method is called by readers during lazy init + synchronized (this.internalASTLock) { + // guard against concurrent access by a reader doing lazy init + if (this.disableEvents > 0) { + // doing lazy init OR already processing an event + // System.out.println("[BOUNCE ADD]"); + return; + } else { + disableEvents(); + } + } + try { + this.eventHandler.postAddChildEvent(node, child, property); + // N.B. even if event handler blows up, the AST is not + // corrupted since node has already been changed + } finally { + reenableEvents(); + } + } + + /** + * Reports that the given node is about to change the value of a + * non-child property. + * + * @param node the node to be modified + * @param property the property descriptor + */ + void preValueChangeEvent(ASTNode node, SimplePropertyDescriptor property) { + // IMPORTANT: this method is called by readers during lazy init + synchronized (this.internalASTLock) { + // guard against concurrent access by a reader doing lazy init + if (this.disableEvents > 0) { + // doing lazy init OR already processing an event + // System.out.println("[BOUNCE CHANGE]"); + return; + } else { + disableEvents(); + } + } + try { + this.eventHandler.preValueChangeEvent(node, property); + // N.B. even if event handler blows up, the AST is not + // corrupted since node has already been changed + } finally { + reenableEvents(); + } + } + + /** + * Reports that the given node has just changed the value of a + * non-child property. + * + * @param node the node that was modified + * @param property the property descriptor + */ + void postValueChangeEvent(ASTNode node, SimplePropertyDescriptor property) { + // IMPORTANT: this method is called by readers during lazy init + synchronized (this.internalASTLock) { + // guard against concurrent access by a reader doing lazy init + if (this.disableEvents > 0) { + // doing lazy init OR already processing an event + // System.out.println("[BOUNCE CHANGE]"); + return; + } else { + disableEvents(); + } + } + try { + this.eventHandler.postValueChangeEvent(node, property); + // N.B. even if event handler blows up, the AST is not + // corrupted since node has already been changed + } finally { + reenableEvents(); + } + } + + /** + * Reports that the given node is about to be cloned. + * + * @param node the node to be cloned + */ + void preCloneNodeEvent(ASTNode node) { + synchronized (this.internalASTLock) { + // guard against concurrent access by a reader doing lazy init + if (this.disableEvents > 0) { + // doing lazy init OR already processing an event + // System.out.println("[BOUNCE CLONE]"); + return; + } else { + disableEvents(); + } + } + try { + this.eventHandler.preCloneNodeEvent(node); + // N.B. even if event handler blows up, the AST is not + // corrupted since node has already been changed + } finally { + reenableEvents(); + } + } + + /** + * Reports that the given node has just been cloned. + * + * @param node the node that was cloned + * @param clone the clone of node + */ + void postCloneNodeEvent(ASTNode node, ASTNode clone) { + synchronized (this.internalASTLock) { + // guard against concurrent access by a reader doing lazy init + if (this.disableEvents > 0) { + // doing lazy init OR already processing an event + // System.out.println("[BOUNCE CLONE]"); + return; + } else { + disableEvents(); + } + } + try { + this.eventHandler.postCloneNodeEvent(node, clone); + // N.B. even if event handler blows up, the AST is not + // corrupted since node has already been changed + } finally { + reenableEvents(); + } + } + + /** + * Returns the binding resolver for this AST. + * + * @return the binding resolver for this AST + */ + BindingResolver getBindingResolver() { + return this.resolver; + } + + /** + * Returns the event handler for this AST. + * + * @return the event handler for this AST + */ + NodeEventHandler getEventHandler() { + return this.eventHandler; + } + + /** + * Sets the event handler for this AST. + * + * @param eventHandler the event handler for this AST + */ + void setEventHandler(NodeEventHandler eventHandler) { + if (this.eventHandler == null) { + throw new IllegalArgumentException(); + } + this.eventHandler = eventHandler; + } + + /** + * Returns default node flags of new nodes of this AST. + * + * @return the default node flags of new nodes of this AST + */ + int getDefaultNodeFlag() { + return this.defaultNodeFlag; + } + + /** + * Sets default node flags of new nodes of this AST. + * + * @param flag node flags of new nodes of this AST + */ + void setDefaultNodeFlag(int flag) { + this.defaultNodeFlag = flag; + } + + /** + * Set originalModificationCount to the current modification count + * + */ + void setOriginalModificationCount(long count) { + this.originalModificationCount = count; + } + + /** + * Returns the type binding for a "well known" type. + *

+ * Note that bindings are generally unavailable unless requested when the + * AST is being built. + *

+ * + * @param name the name of a well known type + * @return the corresponding type binding, or null if the + * named type is not considered well known or if no binding can be found + * for it + */ + public ITypeBinding resolveWellKnownType(String name) { + if (name == null) { + return null; + } + return getBindingResolver().resolveWellKnownType(name); + } + + /** + * Sets the binding resolver for this AST. + * + * @param resolver the new binding resolver for this AST + */ + void setBindingResolver(BindingResolver resolver) { + if (resolver == null) { + throw new IllegalArgumentException(); + } + this.resolver = resolver; + } + + /** + * Checks that this AST operation is not used when + * building level JLS2 ASTs. + + * @exception UnsupportedOperationException + */ + void unsupportedIn2() { + if (this.apiLevel == AST.JLS2) { + throw new UnsupportedOperationException("Operation not supported in JLS2 AST"); //$NON-NLS-1$ + } + } + + /** + * Checks that this AST operation is only used when + * building level JLS2 ASTs. + + * @exception UnsupportedOperationException + */ + void supportedOnlyIn2() { + if (this.apiLevel != AST.JLS2) { + throw new UnsupportedOperationException("Operation not supported in JLS2 AST"); //$NON-NLS-1$ + } + } + + /** + * new Class[] {AST.class} + */ + private static final Class[] AST_CLASS = new Class[] {AST.class}; + + /** + * new Object[] {this} + */ + private final Object[] THIS_AST= new Object[] {this}; + + /* + * Must not collide with a value for IJavaScriptUnit constants + */ + static final int RESOLVED_BINDINGS = 0x80000000; + + /** + * Tag bit value. This represents internal state of the tree. + */ + private int bits; + + /** + * Creates an unparented node of the given node class + * (non-abstract subclass of {@link ASTNode}). + * + * @param nodeClass AST node class + * @return a new unparented node owned by this AST + * @exception IllegalArgumentException if nodeClass is + * null or is not a concrete node type class + */ + public ASTNode createInstance(Class nodeClass) { + if (nodeClass == null) { + throw new IllegalArgumentException(); + } + try { + // invoke constructor with signature Foo(AST) + Constructor c = nodeClass.getDeclaredConstructor(AST_CLASS); + Object result = c.newInstance(this.THIS_AST); + return (ASTNode) result; + } catch (NoSuchMethodException e) { + // all AST node classes have a Foo(AST) constructor + // therefore nodeClass is not legit + throw new IllegalArgumentException(); + } catch (InstantiationException e) { + // all concrete AST node classes can be instantiated + // therefore nodeClass is not legit + throw new IllegalArgumentException(); + } catch (IllegalAccessException e) { + // all AST node classes have an accessible Foo(AST) constructor + // therefore nodeClass is not legit + throw new IllegalArgumentException(); + } catch (InvocationTargetException e) { + // concrete AST node classes do not die in the constructor + // therefore nodeClass is not legit + throw new IllegalArgumentException(); + } + } + + /** + * Creates an unparented node of the given node type. + * This convenience method is equivalent to: + *
+	 * createInstance(ASTNode.nodeClassForType(nodeType))
+	 * 
+ * + * @param nodeType AST node type, one of the node type + * constants declared on {@link ASTNode} + * @return a new unparented node owned by this AST + * @exception IllegalArgumentException if nodeType is + * not a legal AST node type + */ + public ASTNode createInstance(int nodeType) { + // nodeClassForType throws IllegalArgumentException if nodeType is bogus + Class nodeClass = ASTNode.nodeClassForType(nodeType); + return createInstance(nodeClass); + } + + //=============================== NAMES =========================== + /** + * Creates and returns a new unparented simple name node for the given + * identifier. The identifier should be a legal JavaScript identifier, but not + * a keyword, boolean literal ("true", "false") or null literal ("null"). + * + * @param identifier the identifier + * @return a new unparented simple name node + * @exception IllegalArgumentException if the identifier is invalid + */ + public SimpleName newSimpleName(String identifier) { + if (identifier == null) { + throw new IllegalArgumentException(); + } + SimpleName result = new SimpleName(this); + result.setIdentifier(identifier); + return result; + } + + /** + * Creates and returns a new unparented qualified name node for the given + * qualifier and simple name child node. + * + * @param qualifier the qualifier name node + * @param name the simple name being qualified + * @return a new unparented qualified name node + * @exception IllegalArgumentException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
+ */ + public QualifiedName newQualifiedName( + Name qualifier, + SimpleName name) { + QualifiedName result = new QualifiedName(this); + result.setQualifier(qualifier); + result.setName(name); + return result; + + } + + /** + * Creates and returns a new unparented name node for the given name + * segments. Returns a simple name if there is only one name segment, and + * a qualified name if there are multiple name segments. Each of the name + * segments should be legal JavaScript identifiers (this constraint may or may + * not be enforced), and there must be at least one name segment. + * + * @param identifiers a list of 1 or more name segments, each of which + * is a legal JavaScript identifier + * @return a new unparented name node + * @exception IllegalArgumentException if: + *
    + *
  • the identifier is invalid
  • + *
  • the list of identifiers is empty
  • + *
+ */ + public Name newName(String[] identifiers) { + // update internalSetName(String[] if changed + int count = identifiers.length; + if (count == 0) { + throw new IllegalArgumentException(); + } + Name result = newSimpleName(identifiers[0]); + for (int i = 1; i < count; i++) { + SimpleName name = newSimpleName(identifiers[i]); + result = newQualifiedName(result, name); + } + return result; + } + + /* (omit jsdoc for this method) + * This method is a copy of setName(String[]) that doesn't do any validation. + */ + Name internalNewName(String[] identifiers) { + int count = identifiers.length; + if (count == 0) { + throw new IllegalArgumentException(); + } + final SimpleName simpleName = new SimpleName(this); + simpleName.internalSetIdentifier(identifiers[0]); + Name result = simpleName; + for (int i = 1; i < count; i++) { + SimpleName name = new SimpleName(this); + name.internalSetIdentifier(identifiers[i]); + result = newQualifiedName(result, name); + } + return result; + } + + /** + * Creates and returns a new unparented name node for the given name. + * The name string must consist of 1 or more name segments separated + * by single dots '.'. Returns a {@link QualifiedName} if the name has + * dots, and a {@link SimpleName} otherwise. Each of the name + * segments should be legal JavaScript identifiers (this constraint may or may + * not be enforced), and there must be at least one name segment. + * The string must not contains white space, '<', '>', + * '[', ']', or other any other characters that are not + * part of the JavaScript identifiers or separating '.'s. + * + * @param qualifiedName string consisting of 1 or more name segments, + * each of which is a legal JavaScript identifier, separated by single dots '.' + * @return a new unparented name node + * @exception IllegalArgumentException if: + *
    + *
  • the string is empty
  • + *
  • the string begins or ends in a '.'
  • + *
  • the string has adjacent '.'s
  • + *
  • the segments between the '.'s are not valid JavaScript identifiers
  • + *
+ */ + public Name newName(String qualifiedName) { + StringTokenizer t = new StringTokenizer(qualifiedName, ".", true); //$NON-NLS-1$ + Name result = null; + // balance is # of name tokens - # of period tokens seen so far + // initially 0; finally 1; should never drop < 0 or > 1 + int balance = 0; + while(t.hasMoreTokens()) { + String s = t.nextToken(); + if (s.indexOf('.') >= 0) { + // this is a delimiter + if (s.length() > 1) { + // too many dots in a row + throw new IllegalArgumentException(); + } + balance--; + if (balance < 0) { + throw new IllegalArgumentException(); + } + } else { + // this is an identifier segment + balance++; + SimpleName name = newSimpleName(s); + if (result == null) { + result = name; + } else { + result = newQualifiedName(result, name); + } + } + } + if (balance != 1) { + throw new IllegalArgumentException(); + } + return result; + } + + //=============================== TYPES =========================== + /** + * Creates and returns a new unparented simple type node with the given + * type name. + *

+ * This method can be used to convert a name (Name) into a + * type (Type) by wrapping it. + *

+ * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param typeName the name of the class or interface + * @return a new unparented simple type node + * @exception IllegalArgumentException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
+ */ + public SimpleType newSimpleType(Name typeName) { + SimpleType result = new SimpleType(this); + result.setName(typeName); + return result; + } + + /** + * Creates and returns a new unparented array type node with the given + * component type, which may be another array type. + * + * @param componentType the component type (possibly another array type) + * @return a new unparented array type node + * @exception IllegalArgumentException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
  • a cycle in would be created
  • + *
+ */ + public ArrayType newArrayType(Type componentType) { + ArrayType result = new ArrayType(this); + result.setComponentType(componentType); + return result; + } + + /** + * Creates and returns a new unparented array type node with the given + * element type and number of dimensions. + *

+ * Note that if the element type passed in is an array type, the + * element type of the result will not be the same as what was passed in. + *

+ * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param elementType the element type (never an array type) + * @param dimensions the number of dimensions, a positive number + * @return a new unparented array type node + * @exception IllegalArgumentException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
  • a cycle in would be created
  • + *
  • the element type is null
  • + *
  • the element type is an array type
  • + *
  • the number of dimensions is lower than 1
  • + *
  • the number of dimensions is greater than 1000
  • + *
+ */ + public ArrayType newArrayType(Type elementType, int dimensions) { + if (elementType == null || elementType.isArrayType()) { + throw new IllegalArgumentException(); + } + if (dimensions < 1 || dimensions > 1000) { + // we would blow our stacks anyway with a 1000-D array + throw new IllegalArgumentException(); + } + ArrayType result = new ArrayType(this); + result.setComponentType(elementType); + for (int i = 2; i <= dimensions; i++) { + result = newArrayType(result); + } + return result; + + } + + /** + * Creates and returns a new unparented primitive type node with the given + * type code. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param typeCode one of the primitive type code constants declared in + * PrimitiveType + * @return a new unparented primitive type node + * @exception IllegalArgumentException if the primitive type code is invalid + */ + public PrimitiveType newPrimitiveType(PrimitiveType.Code typeCode) { + PrimitiveType result = new PrimitiveType(this); + result.setPrimitiveTypeCode(typeCode); + return result; + } + + /** + * Creates and returns a new inferred type node with the given + * type name. + * + * @param typeName the name of the inferred type + * @return a new unparented inferred type node + * @exception IllegalArgumentException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
+ */ + public InferredType newInferredType(String typeName) { + InferredType result = new InferredType(this); + result.setSourceRange(-1, 0); + if (typeName!=null) + result.type=typeName; + return result; + } + + /** + * Creates and returns a new unparented qualified type node with + * the given qualifier type and name. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param qualifier the qualifier type node + * @param name the simple name being qualified + * @return a new unparented qualified type node + * @exception IllegalArgumentException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
+ * @exception UnsupportedOperationException if this operation is used in + * a JLS2 AST + */ + public QualifiedType newQualifiedType(Type qualifier, SimpleName name) { + QualifiedType result = new QualifiedType(this); + result.setQualifier(qualifier); + result.setName(name); + return result; + } + + //=============================== DECLARATIONS =========================== + /** + * Creates an unparented javaScript unit node owned by this AST. + * The javaScript unit initially has no package declaration, no + * import declarations, and no type declarations. + * + * @return the new unparented javaScript unit node + */ + public JavaScriptUnit newJavaScriptUnit() { + return new JavaScriptUnit(this); + } + + /** + * Creates an unparented package declaration node owned by this AST. + * The package declaration initially declares a package with an + * unspecified name. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @return the new unparented package declaration node + */ + public PackageDeclaration newPackageDeclaration() { + PackageDeclaration result = new PackageDeclaration(this); + return result; + } + + /** + * Creates an unparented import declaration node owned by this AST. + * The import declaration initially contains a single-type import + * of a type with an unspecified name. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @return the new unparented import declaration node + */ + public ImportDeclaration newImportDeclaration() { + ImportDeclaration result = new ImportDeclaration(this); + return result; + } + + /** + * Creates an unparented class declaration node owned by this AST. + * The name of the class is an unspecified, but legal, name; + * no modifiers; no doc comment; no superclass or superinterfaces; + * and an empty class body. + *

+ * To create an interface, use this method and then call + * TypeDeclaration.setInterface(true). + *

+ *

+ * To create an enum declaration, use this method and then call + * TypeDeclaration.setEnumeration(true). + *

+ * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @return a new unparented type declaration node + */ + public TypeDeclaration newTypeDeclaration() { + TypeDeclaration result = new TypeDeclaration(this); + return result; + } + + /** + * Creates an unparented method declaration node owned by this AST. + * By default, the declaration is for a method of an unspecified, but + * legal, name; no modifiers; no doc comment; no parameters; return + * type void; no extra array dimensions; no thrown exceptions; and no + * body (as opposed to an empty body). + *

+ * To create a constructor, use this method and then call + * FunctionDeclaration.setConstructor(true) and + * FunctionDeclaration.setName(className). + *

+ * + * @return a new unparented method declaration node + */ + public FunctionDeclaration newFunctionDeclaration() { + FunctionDeclaration result = new FunctionDeclaration(this); + result.setConstructor(false); + return result; + } + + /** + * Creates an unparented single variable declaration node owned by this AST. + * By default, the declaration is for a variable with an unspecified, but + * legal, name and type; no modifiers; no array dimensions after the + * variable; no initializer; not variable arity. + * + * @return a new unparented single variable declaration node + */ + public SingleVariableDeclaration newSingleVariableDeclaration() { + SingleVariableDeclaration result = new SingleVariableDeclaration(this); + return result; + } + + /** + * Creates an unparented variable declaration fragment node owned by this + * AST. By default, the fragment is for a variable with an unspecified, but + * legal, name; no extra array dimensions; and no initializer. + * + * @return a new unparented variable declaration fragment node + */ + public VariableDeclarationFragment newVariableDeclarationFragment() { + VariableDeclarationFragment result = new VariableDeclarationFragment(this); + return result; + } + + /* + * Creates an unparented initializer node owned by this AST, with an + * empty block. By default, the initializer has no modifiers and + * an empty block. + * + * @return a new unparented initializer node + */ + public Initializer newInitializer() { + Initializer result = new Initializer(this); + return result; + } + + /** + * Creates and returns a new unparented modifier node for the given + * modifier. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param keyword one of the modifier keyword constants + * @return a new unparented modifier node + * @exception IllegalArgumentException if the primitive type code is invalid + * @exception UnsupportedOperationException if this operation is used in + * a JLS2 AST + */ + public Modifier newModifier(Modifier.ModifierKeyword keyword) { + Modifier result = new Modifier(this); + result.setKeyword(keyword); + return result; + } + + /** + * Creates and returns a list of new unparented modifier nodes + * for the given modifier flags. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param flags bitwise or of modifier flags declared on {@link Modifier} + * @return a possibly empty list of new unparented modifier nodes + * (element type Modifier) + * @exception UnsupportedOperationException if this operation is used in + * a JLS2 AST + */ + public List newModifiers(int flags) { + if (this.apiLevel == AST.JLS2) { + unsupportedIn2(); + } + List result = new ArrayList(3); // 3 modifiers is more than average + if (Modifier.isPublic(flags)) { + result.add(newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD)); + } + if (Modifier.isProtected(flags)) { + result.add(newModifier(Modifier.ModifierKeyword.PROTECTED_KEYWORD)); + } + if (Modifier.isPrivate(flags)) { + result.add(newModifier(Modifier.ModifierKeyword.PRIVATE_KEYWORD)); + } + if (Modifier.isAbstract(flags)) { + result.add(newModifier(Modifier.ModifierKeyword.ABSTRACT_KEYWORD)); + } + if (Modifier.isStatic(flags)) { + result.add(newModifier(Modifier.ModifierKeyword.STATIC_KEYWORD)); + } + if (Modifier.isFinal(flags)) { + result.add(newModifier(Modifier.ModifierKeyword.FINAL_KEYWORD)); + } + if (Modifier.isSynchronized(flags)) { + result.add(newModifier(Modifier.ModifierKeyword.SYNCHRONIZED_KEYWORD)); + } + if (Modifier.isNative(flags)) { + result.add(newModifier(Modifier.ModifierKeyword.NATIVE_KEYWORD)); + } + if (Modifier.isStrictfp(flags)) { + result.add(newModifier(Modifier.ModifierKeyword.STRICTFP_KEYWORD)); + } + if (Modifier.isTransient(flags)) { + result.add(newModifier(Modifier.ModifierKeyword.TRANSIENT_KEYWORD)); + } + if (Modifier.isVolatile(flags)) { + result.add(newModifier(Modifier.ModifierKeyword.VOLATILE_KEYWORD)); + } + return result; + } + + //=============================== COMMENTS =========================== + + /** + * Creates and returns a new block comment placeholder node. + *

+ * Note that this node type is used to recording the source + * range where a comment was found in the source string. + * These comment nodes are normally found (only) in + * {@linkplain JavaScriptUnit#getCommentList() + * the comment table} for parsed javaScript units. + *

+ * + * @return a new unparented block comment node + */ + public BlockComment newBlockComment() { + BlockComment result = new BlockComment(this); + return result; + } + + /** + * Creates and returns a new line comment placeholder node. + *

+ * Note that this node type is used to recording the source + * range where a comment was found in the source string. + * These comment nodes are normally found (only) in + * {@linkplain JavaScriptUnit#getCommentList() + * the comment table} for parsed javaScript units. + *

+ * + * @return a new unparented line comment node + */ + public LineComment newLineComment() { + LineComment result = new LineComment(this); + return result; + } + + public ListExpression newListExpression() { + ListExpression result = new ListExpression(this); + return result; + } + + /** + * Creates and returns a new doc comment node. + * Initially the new node has an empty list of tag elements + * (and, for backwards compatability, an unspecified, but legal, + * doc comment string) + * + * @return a new unparented doc comment node + */ + public JSdoc newJSdoc() { + JSdoc result = new JSdoc(this); + return result; + } + + /** + * Creates and returns a new tag element node. + * Initially the new node has no tag name and an empty list of fragments. + *

+ * Note that this node type is used only inside doc comments + * ({@link JSdoc}). + *

+ * + * @return a new unparented tag element node + */ + public TagElement newTagElement() { + TagElement result = new TagElement(this); + return result; + } + + /** + * Creates and returns a new text element node. + * Initially the new node has an empty text string. + *

+ * Note that this node type is used only inside doc comments + * ({@link JSdoc Javadoc}). + *

+ * + * @return a new unparented text element node + */ + public TextElement newTextElement() { + TextElement result = new TextElement(this); + return result; + } + + /** + * Creates and returns a new member reference node. + * Initially the new node has no qualifier name and + * an unspecified, but legal, member name. + *

+ * Note that this node type is used only inside doc comments + * ({@link JSdoc}). + *

+ * + * @return a new unparented member reference node + */ + public MemberRef newMemberRef() { + MemberRef result = new MemberRef(this); + return result; + } + + /** + * Creates and returns a new method reference node. + * Initially the new node has no qualifier name, + * an unspecified, but legal, method name, and an + * empty parameter list. + *

+ * Note that this node type is used only inside doc comments + * ({@link JSdoc Javadoc}). + *

+ * + * @return a new unparented method reference node + */ + public FunctionRef newFunctionRef() { + FunctionRef result = new FunctionRef(this); + return result; + } + + /** + * Creates and returns a new method reference node. + * Initially the new node has an unspecified, but legal, + * type, not variable arity, and no parameter name. + *

+ * Note that this node type is used only inside doc comments + * ({@link JSdoc}). + *

+ * + * @return a new unparented method reference parameter node + */ + public FunctionRefParameter newFunctionRefParameter() { + FunctionRefParameter result = new FunctionRefParameter(this); + return result; + } + + //=============================== STATEMENTS =========================== + /** + * Creates a new unparented local variable declaration statement node + * owned by this AST, for the given variable declaration fragment. + * By default, there are no modifiers and the base type is unspecified + * (but legal). + *

+ * This method can be used to convert a variable declaration fragment + * (VariableDeclarationFragment) into a statement + * (Statement) by wrapping it. Additional variable + * declaration fragments can be added afterwards. + *

+ * + * @param fragment the variable declaration fragment + * @return a new unparented variable declaration statement node + * @exception IllegalArgumentException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
  • a cycle in would be created
  • + *
  • the variable declaration fragment is null
  • + *
+ */ + public VariableDeclarationStatement + newVariableDeclarationStatement(VariableDeclarationFragment fragment) { + if (fragment == null) { + throw new IllegalArgumentException(); + } + VariableDeclarationStatement result = + new VariableDeclarationStatement(this); + result.fragments().add(fragment); + return result; + } + + /** + * Creates a new unparented local type declaration statement node + * owned by this AST, for the given type declaration. + *

+ * This method can be used to convert a type declaration + * (TypeDeclaration) into a statement + * (Statement) by wrapping it. + *

+ * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param decl the type declaration + * @return a new unparented local type declaration statement node + * @exception IllegalArgumentException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
  • a cycle in would be created
  • + *
+ */ + public TypeDeclarationStatement + newTypeDeclarationStatement(TypeDeclaration decl) { + TypeDeclarationStatement result = new TypeDeclarationStatement(this); + result.setDeclaration(decl); + return result; + } + + /** + * Creates a new unparented local type declaration statement node + * owned by this AST, for the given type declaration. + *

+ * This method can be used to convert any kind of type declaration + * (AbstractTypeDeclaration) into a statement + * (Statement) by wrapping it. + *

+ * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param decl the type declaration + * @return a new unparented local type declaration statement node + * @exception IllegalArgumentException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
  • a cycle in would be created
  • + *
+ */ + public TypeDeclarationStatement + newTypeDeclarationStatement(AbstractTypeDeclaration decl) { + TypeDeclarationStatement result = new TypeDeclarationStatement(this); + if (this.apiLevel == AST.JLS2) { + result.internalSetTypeDeclaration((TypeDeclaration) decl); + } + if (this.apiLevel >= AST.JLS3) { + result.setDeclaration(decl); + } + return result; + } + + /** + * Creates an unparented block node owned by this AST, for an empty list + * of statements. + * + * @return a new unparented, empty block node + */ + public Block newBlock() { + return new Block(this); + } + + /** + * Creates an unparented continue statement node owned by this AST. + * The continue statement has no label. + * + * @return a new unparented continue statement node + */ + public ContinueStatement newContinueStatement() { + return new ContinueStatement(this); + } + + /** + * Creates an unparented break statement node owned by this AST. + * The break statement has no label. + * + * @return a new unparented break statement node + */ + public BreakStatement newBreakStatement() { + return new BreakStatement(this); + } + + /** + * Creates a new unparented expression statement node owned by this AST, + * for the given expression. + *

+ * This method can be used to convert an expression + * (Expression) into a statement (Type) + * by wrapping it. Note, however, that the result is only legal for + * limited expression types, including method invocations, assignments, + * and increment/decrement operations. + *

+ * + * @param expression the expression + * @return a new unparented statement node + * @exception IllegalArgumentException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
  • a cycle in would be created
  • + *
+ */ + public ExpressionStatement newExpressionStatement(Expression expression) { + ExpressionStatement result = new ExpressionStatement(this); + result.setExpression(expression); + return result; + } + + /** + * Creates a new unparented if statement node owned by this AST. + * By default, the expression is unspecified (but legal), + * the then statement is an empty block, and there is no else statement. + * + * @return a new unparented if statement node + */ + public IfStatement newIfStatement() { + return new IfStatement(this); + } + + /** + * Creates a new unparented while statement node owned by this AST. + * By default, the expression is unspecified (but legal), and + * the body statement is an empty block. + * + * @return a new unparented while statement node + */ + public WhileStatement newWhileStatement() { + return new WhileStatement(this); + } + + /** + * Creates a new unparented with statement node owned by this AST. + * By default, the expression is unspecified (but legal), and + * the body statement is an empty block. + * + * @return a new unparented with statement node + */ + public WithStatement newWithStatement() { + return new WithStatement(this); + } + + /** + * Creates a new unparented do statement node owned by this AST. + * By default, the expression is unspecified (but legal), and + * the body statement is an empty block. + * + * @return a new unparented do statement node + */ + public DoStatement newDoStatement() { + return new DoStatement(this); + } + + /** + * Creates a new unparented try statement node owned by this AST. + * By default, the try statement has an empty block, no catch + * clauses, and no finally block. + * + * @return a new unparented try statement node + */ + public TryStatement newTryStatement() { + return new TryStatement(this); + } + + /** + * Creates a new unparented catch clause node owned by this AST. + * By default, the catch clause declares an unspecified, but legal, + * exception declaration and has an empty block. + * + * @return a new unparented catch clause node + */ + public CatchClause newCatchClause() { + return new CatchClause(this); + } + + /** + * Creates a new unparented return statement node owned by this AST. + * By default, the return statement has no expression. + * + * @return a new unparented return statement node + */ + public ReturnStatement newReturnStatement() { + return new ReturnStatement(this); + } + + /** + * Creates a new unparented throw statement node owned by this AST. + * By default, the expression is unspecified, but legal. + * + * @return a new unparented throw statement node + */ + public ThrowStatement newThrowStatement() { + return new ThrowStatement(this); + } + + /** + * Creates a new unparented empty statement node owned by this AST. + * + * @return a new unparented empty statement node + */ + public EmptyStatement newEmptyStatement() { + return new EmptyStatement(this); + } + + /** + * Creates a new unparented labeled statement node owned by this AST. + * By default, the label and statement are both unspecified, but legal. + * + * @return a new unparented labeled statement node + */ + public LabeledStatement newLabeledStatement() { + return new LabeledStatement(this); + } + + /** + * Creates a new unparented switch statement node owned by this AST. + * By default, the expression is unspecified, but legal, and there are + * no statements or switch cases. + * + * @return a new unparented labeled statement node + */ + public SwitchStatement newSwitchStatement() { + return new SwitchStatement(this); + } + + /** + * Creates a new unparented switch case statement node owned by + * this AST. By default, the expression is unspecified, but legal. + * + * @return a new unparented switch case node + */ + public SwitchCase newSwitchCase() { + return new SwitchCase(this); + } + + + /** + * Creates a new unparented for statement node owned by this AST. + * By default, there are no initializers, no condition expression, + * no updaters, and the body is an empty block. + * + * @return a new unparented for statement node + */ + public ForStatement newForStatement() { + return new ForStatement(this); + } + + /** + * Creates a new unparented for..in statement node owned by this AST. + * By default, there are no initializers, no condition expression, + * no updaters, and the body is an empty block. + * + * @return a new unparented for..in statement node + */ + public ForInStatement newForInStatement() { + return new ForInStatement(this); + } + + /* + * Creates a new unparented enhanced for statement node owned by this AST. + * By default, the paramter and expression are unspecified + * but legal subtrees, and the body is an empty block. + * + * @return a new unparented throw statement node + * @exception UnsupportedOperationException if this operation is used in + * a JLS2 AST + */ + public EnhancedForStatement newEnhancedForStatement() { + return new EnhancedForStatement(this); + } + + //=============================== EXPRESSIONS =========================== + /** + * Creates and returns a new unparented string literal node for + * the empty string literal. + * + * @return a new unparented string literal node + */ + public StringLiteral newStringLiteral() { + return new StringLiteral(this); + } + + + /** + * Creates and returns a new unparented character literal node. + * Initially the node has an unspecified character literal. + * + * @return a new unparented character literal node + */ + public CharacterLiteral newCharacterLiteral() { + return new CharacterLiteral(this); + } + + + + /** + * Creates and returns a new Regular Expression literal node. + * Initially the node has an unspecified character literal. + * + * @return a new unparented regular expression literal node + */ public RegularExpressionLiteral newRegularExpressionLiteral() { + return new RegularExpressionLiteral(this); + } +/** + * Creates and returns a new unparented number literal node. + * + * @param literal the token for the numeric literal as it would + * appear in JavaScript source code + * @return a new unparented number literal node + * @exception IllegalArgumentException if the literal is null + */ + public NumberLiteral newNumberLiteral(String literal) { + if (literal == null) { + throw new IllegalArgumentException(); + } + NumberLiteral result = new NumberLiteral(this); + result.setToken(literal); + return result; + } + + /** + * Creates and returns a new unparented number literal node. + * Initially the number literal token is "0". + * + * @return a new unparented number literal node + */ + public NumberLiteral newNumberLiteral() { + NumberLiteral result = new NumberLiteral(this); + return result; + } + + /** + * Creates and returns a new unparented null literal node. + * + * @return a new unparented null literal node + */ + public NullLiteral newNullLiteral() { + return new NullLiteral(this); + } + + + /** + * Creates and returns a new unparented 'undefined' literal node. + * + * @return a new unparented 'undefined' literal node + */ + public UndefinedLiteral newUndefinedLiteral() { + return new UndefinedLiteral(this); + } + + /** + * Creates and returns a new unparented boolean literal node. + *

+ * For example, the assignment expression foo = true + * is generated by the following snippet: + * + *

+	 * Assignment e= ast.newAssignment();
+	 * e.setLeftHandSide(ast.newSimpleName("foo"));
+	 * e.setRightHandSide(ast.newBooleanLiteral(true));
+	 * 
+ * + *

+ * + * @param value the boolean value + * @return a new unparented boolean literal node + */ + public BooleanLiteral newBooleanLiteral(boolean value) { + BooleanLiteral result = new BooleanLiteral(this); + result.setBooleanValue(value); + return result; + } + + /** + * Creates and returns a new unparented assignment expression node + * owned by this AST. By default, the assignment operator is "=" and + * the left and right hand side expressions are unspecified, but + * legal, names. + * + * @return a new unparented assignment expression node + */ + public Assignment newAssignment() { + Assignment result = new Assignment(this); + return result; + } + + /** + * Creates an unparented method invocation expression node owned by this + * AST. By default, the name of the method is unspecified (but legal) + * there is no receiver expression, no type arguments, and the list of + * arguments is empty. + * + * @return a new unparented method invocation expression node + */ + public FunctionInvocation newFunctionInvocation() { + FunctionInvocation result = new FunctionInvocation(this); + return result; + } + + /** + * Creates an unparented "super" method invocation expression node owned by + * this AST. By default, the name of the method is unspecified (but legal) + * there is no qualifier, no type arguments, and the list of arguments is empty. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @return a new unparented "super" method invocation + * expression node + */ + public SuperMethodInvocation newSuperMethodInvocation() { + SuperMethodInvocation result = new SuperMethodInvocation(this); + return result; + } + + /** + * Creates an unparented alternate constructor ("this(...);") invocation + * statement node owned by this AST. By default, the lists of arguments + * and type arguments are both empty. + *

+ * Note that this type of node is a Statement, whereas a regular + * method invocation is an Expression. The only valid use of these + * statements are as the first statement of a constructor body. + *

+ * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @return a new unparented alternate constructor invocation statement node + */ + public ConstructorInvocation newConstructorInvocation() { + ConstructorInvocation result = new ConstructorInvocation(this); + return result; + } + + /** + * Creates an unparented alternate super constructor ("super(...);") + * invocation statement node owned by this AST. By default, there is no + * qualifier, no type arguments, and the list of arguments is empty. + *

+ * Note that this type of node is a Statement, whereas a regular + * super method invocation is an Expression. The only valid use of these + * statements are as the first statement of a constructor body. + *

+ * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @return a new unparented super constructor invocation statement node + */ + public SuperConstructorInvocation newSuperConstructorInvocation() { + SuperConstructorInvocation result = + new SuperConstructorInvocation(this); + return result; + } + + /** + * Creates a new unparented local variable declaration expression node + * owned by this AST, for the given variable declaration fragment. By + * default, there are no modifiers and the base type is unspecified + * (but legal). + *

+ * This method can be used to convert a variable declaration fragment + * (VariableDeclarationFragment) into an expression + * (Expression) by wrapping it. Additional variable + * declaration fragments can be added afterwards. + *

+ * + * @param fragment the first variable declaration fragment + * @return a new unparented variable declaration expression node + * @exception IllegalArgumentException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
  • a cycle in would be created
  • + *
  • the given fragment is null
  • + *
  • a cycle in would be created
  • + *
+ */ + public VariableDeclarationExpression + newVariableDeclarationExpression(VariableDeclarationFragment fragment) { + if (fragment == null) { + throw new IllegalArgumentException(); + } + VariableDeclarationExpression result = + new VariableDeclarationExpression(this); + result.fragments().add(fragment); + return result; + } + + /** + * Creates a new unparented field declaration node owned by this AST, + * for the given variable declaration fragment. By default, there are no + * modifiers, no doc comment, and the base type is unspecified + * (but legal). + *

+ * This method can be used to wrap a variable declaration fragment + * (VariableDeclarationFragment) into a field declaration + * suitable for inclusion in the body of a type declaration + * (FieldDeclaration implements BodyDeclaration). + * Additional variable declaration fragments can be added afterwards. + *

+ * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param fragment the variable declaration fragment + * @return a new unparented field declaration node + * @exception IllegalArgumentException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
  • a cycle in would be created
  • + *
  • the given fragment is null
  • + *
+ */ + public FieldDeclaration newFieldDeclaration(VariableDeclarationFragment fragment) { + if (fragment == null) { + throw new IllegalArgumentException(); + } + FieldDeclaration result = new FieldDeclaration(this); + result.fragments().add(fragment); + return result; + } + + /** + * Creates and returns a new unparented "this" expression node + * owned by this AST. By default, there is no qualifier. + * + * @return a new unparented "this" expression node + */ + public ThisExpression newThisExpression() { + ThisExpression result = new ThisExpression(this); + return result; + } + + /** + * Creates and returns a new unparented field access expression node + * owned by this AST. By default, the expression and field are both + * unspecified, but legal, names. + * + * @return a new unparented field access expression node + */ + public FieldAccess newFieldAccess() { + FieldAccess result = new FieldAccess(this); + return result; + } + + /** + * Creates and returns a new unparented super field access expression node + * owned by this AST. By default, the expression and field are both + * unspecified, but legal, names. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @return a new unparented super field access expression node + */ + public SuperFieldAccess newSuperFieldAccess() { + SuperFieldAccess result = new SuperFieldAccess(this); + return result; + } + + /** + * Creates and returns a new unparented type literal expression node + * owned by this AST. By default, the type is unspecified (but legal). + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @return a new unparented type literal node + */ + public TypeLiteral newTypeLiteral() { + TypeLiteral result = new TypeLiteral(this); + return result; + } + + /** + * Creates and returns a new unparented function expression node + * owned by this AST. + * + * @return a new unparented function expression node + */ + public FunctionExpression newFunctionExpression() { + FunctionExpression result = new FunctionExpression(this); + return result; + } + + /** + * Creates and returns a new unparented object literal expression node + * owned by this AST. + * + * @return a new unparented object literal expression node + */ + public ObjectLiteral newObjectLiteral() { + ObjectLiteral result = new ObjectLiteral(this); + return result; + } + + /** + * Creates and returns a new unparented object literal field expression node + * owned by this AST. + * + * @return a new unparented object literal field expression node + */ + public ObjectLiteralField newObjectLiteralField() { + ObjectLiteralField result = new ObjectLiteralField(this); + return result; + } + + /** + * Creates and returns a new unparented parenthesized expression node + * owned by this AST. By default, the expression is unspecified (but legal). + * + * @return a new unparented parenthesized expression node + */ + public ParenthesizedExpression newParenthesizedExpression() { + ParenthesizedExpression result = new ParenthesizedExpression(this); + return result; + } + + /** + * Creates and returns a new unparented infix expression node + * owned by this AST. By default, the operator and left and right + * operand are unspecified (but legal), and there are no extended + * operands. + * + * @return a new unparented infix expression node + */ + public InfixExpression newInfixExpression() { + InfixExpression result = new InfixExpression(this); + return result; + } + + /** + * Creates and returns a new unparented instanceof expression node + * owned by this AST. By default, the operator and left and right + * operand are unspecified (but legal). + * + * @return a new unparented instanceof expression node + */ + public InstanceofExpression newInstanceofExpression() { + InstanceofExpression result = new InstanceofExpression(this); + return result; + } + + /** + * Creates and returns a new unparented postfix expression node + * owned by this AST. By default, the operator and operand are + * unspecified (but legal). + * + * @return a new unparented postfix expression node + */ + public PostfixExpression newPostfixExpression() { + PostfixExpression result = new PostfixExpression(this); + return result; + } + + /** + * Creates and returns a new unparented prefix expression node + * owned by this AST. By default, the operator and operand are + * unspecified (but legal). + * + * @return a new unparented prefix expression node + */ + public PrefixExpression newPrefixExpression() { + PrefixExpression result = new PrefixExpression(this); + return result; + } + + /** + * Creates and returns a new unparented array access expression node + * owned by this AST. By default, the array and index expression are + * both unspecified (but legal). + * + * @return a new unparented array access expression node + */ + public ArrayAccess newArrayAccess() { + ArrayAccess result = new ArrayAccess(this); + return result; + } + + /** + * Creates and returns a new unparented array creation expression node + * owned by this AST. By default, the array type is an unspecified + * 1-dimensional array, the list of dimensions is empty, and there is no + * array initializer. + * + * @return a new unparented array creation expression node + */ + public ArrayCreation newArrayCreation() { + ArrayCreation result = new ArrayCreation(this); + return result; + } + + /** + * Creates and returns a new unparented class instance creation + * ("new") expression node owned by this AST. By default, + * there is no qualifying expression, no type parameters, + * an unspecified (but legal) type name, an empty list of + * arguments, and does not declare an anonymous class declaration. + * + * @return a new unparented class instance creation expression node + */ + public ClassInstanceCreation newClassInstanceCreation() { + ClassInstanceCreation result = new ClassInstanceCreation(this); + return result; + } + + /** + * Creates and returns a new unparented anonymous class declaration + * node owned by this AST. By default, the body declaration list is empty. + * + * @return a new unparented anonymous class declaration node + */ + public AnonymousClassDeclaration newAnonymousClassDeclaration() { + AnonymousClassDeclaration result = new AnonymousClassDeclaration(this); + return result; + } + + /** + * Creates and returns a new unparented array initializer node + * owned by this AST. By default, the initializer has no expressions. + * + * @return a new unparented array initializer node + */ + public ArrayInitializer newArrayInitializer() { + ArrayInitializer result = new ArrayInitializer(this); + return result; + } + + /** + * Creates and returns a new unparented conditional expression node + * owned by this AST. By default, the condition and both expressions + * are unspecified (but legal). + * + * @return a new unparented array conditional expression node + */ + public ConditionalExpression newConditionalExpression() { + ConditionalExpression result = new ConditionalExpression(this); + return result; + } + + /** + * Enables the recording of changes to the given compilation + * unit and its descendents. The javaScript unit must have + * been created by ASTParser and still be in + * its original state. Once recording is on, + * arbitrary changes to the subtree rooted at the compilation + * unit are recorded internally. Once the modification has + * been completed, call rewrite to get an object + * representing the corresponding edits to the original + * source code string. + * + * @exception IllegalArgumentException if this javaScript unit is + * marked as unmodifiable, or if this javaScript unit has already + * been tampered with, or if recording has already been enabled, + * or if root is not owned by this AST + * @see JavaScriptUnit#recordModifications() + */ + void recordModifications(JavaScriptUnit root) { + if(this.modificationCount != this.originalModificationCount) { + throw new IllegalArgumentException("AST is already modified"); //$NON-NLS-1$ + } else if(this.rewriter != null) { + throw new IllegalArgumentException("AST modifications are already recorded"); //$NON-NLS-1$ + } else if((root.getFlags() & ASTNode.PROTECT) != 0) { + throw new IllegalArgumentException("Root node is unmodifiable"); //$NON-NLS-1$ + } else if(root.getAST() != this) { + throw new IllegalArgumentException("Root node is not owned by this ast"); //$NON-NLS-1$ + } + + this.rewriter = new InternalASTRewrite(root); + this.setEventHandler(this.rewriter); + } + + /** + * Converts all modifications recorded into an object + * representing the corresponding text edits to the + * given document containing the original source + * code for the javaScript unit that gave rise to + * this AST. + * + * @param document original document containing source code + * for the javaScript unit + * @param options the table of formatter options + * (key type: String; value type: String); + * or null to use the standard global options + * {@link JavaScriptCore#getOptions() JavaScriptCore.getOptions()}. + * @return text edit object describing the changes to the + * document corresponding to the recorded AST modifications + * @exception IllegalArgumentException if the document passed is + * null or does not correspond to this AST + * @exception IllegalStateException if recordModifications + * was not called to enable recording + * @see JavaScriptUnit#rewrite(IDocument, Map) + */ + TextEdit rewrite(IDocument document, Map options) { + if (document == null) { + throw new IllegalArgumentException(); + } + if (this.rewriter == null) { + throw new IllegalStateException("Modifications record is not enabled"); //$NON-NLS-1$ + } + return this.rewriter.rewriteAST(document, options); + } + /** + * Returns true if the ast tree was created with bindings, false otherwise + * + * @return true if the ast tree was created with bindings, false otherwise + */ + public boolean hasResolvedBindings() { + return (this.bits & RESOLVED_BINDINGS) != 0; + } + + /** + * Returns true if the ast tree was created with statements recovery, false otherwise + * + * @return true if the ast tree was created with statements recovery, false otherwise + */ + public boolean hasStatementsRecovery() { + return (this.bits & IJavaScriptUnit.ENABLE_STATEMENTS_RECOVERY) != 0; + } + + /** + * Returns true if the ast tree was created with bindings recovery, false otherwise + * + * @return true if the ast tree was created with bindings recovery, false otherwise + */ + public boolean hasBindingsRecovery() { + return (this.bits & IJavaScriptUnit.ENABLE_BINDINGS_RECOVERY) != 0; + } + + void setFlag(int newValue) { + this.bits |= newValue; + } + +} + diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTConverter.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTConverter.java new file mode 100644 index 0000000..17ead42 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTConverter.java @@ -0,0 +1,4501 @@ +/******************************************************************************* + * Copyright (c) 2000, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * bug 227489 - Etienne Pfister + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.dom; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.wst.jsdt.core.JavaScriptCore; +import org.eclipse.wst.jsdt.core.compiler.CategorizedProblem; +import org.eclipse.wst.jsdt.core.compiler.IProblem; +import org.eclipse.wst.jsdt.core.compiler.InvalidInputException; +import org.eclipse.wst.jsdt.core.dom.Modifier.ModifierKeyword; +import org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration; +import org.eclipse.wst.jsdt.internal.compiler.ast.Argument; +import org.eclipse.wst.jsdt.internal.compiler.ast.ConstructorDeclaration; +import org.eclipse.wst.jsdt.internal.compiler.ast.ForeachStatement; +import org.eclipse.wst.jsdt.internal.compiler.ast.JavadocArgumentExpression; +import org.eclipse.wst.jsdt.internal.compiler.ast.JavadocFieldReference; +import org.eclipse.wst.jsdt.internal.compiler.ast.JavadocMessageSend; +import org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration; +import org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend; +import org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds; +import org.eclipse.wst.jsdt.internal.compiler.ast.ProgramElement; +import org.eclipse.wst.jsdt.internal.compiler.ast.StringLiteralConcatenation; +import org.eclipse.wst.jsdt.internal.compiler.ast.TypeReference; +import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants; +import org.eclipse.wst.jsdt.internal.compiler.lookup.BlockScope; +import org.eclipse.wst.jsdt.internal.compiler.lookup.ExtraCompilerModifiers; +import org.eclipse.wst.jsdt.internal.compiler.parser.RecoveryScanner; +import org.eclipse.wst.jsdt.internal.compiler.parser.Scanner; +import org.eclipse.wst.jsdt.internal.compiler.parser.TerminalTokens; + +/** + * Internal class for converting internal compiler ASTs into public ASTs. + */ +class ASTConverter { + + protected AST ast; + protected Comment[] commentsTable; + char[] compilationUnitSource; + int compilationUnitSourceLength; + protected DocCommentParser docParser; + // comments + protected boolean insideComments; + protected IProgressMonitor monitor; + protected Set pendingNameScopeResolution; + protected Set pendingThisExpressionScopeResolution; + protected boolean resolveBindings; + Scanner scanner; + private DefaultCommentMapper commentMapper; + + public ASTConverter(Map options, boolean resolveBindings, IProgressMonitor monitor) { + this.resolveBindings = resolveBindings; + Object sourceModeSetting = options.get(JavaScriptCore.COMPILER_SOURCE); + long sourceLevel = ClassFileConstants.JDK1_3; + if (JavaScriptCore.VERSION_1_4.equals(sourceModeSetting)) { + sourceLevel = ClassFileConstants.JDK1_4; + } else if (JavaScriptCore.VERSION_1_5.equals(sourceModeSetting)) { + sourceLevel = ClassFileConstants.JDK1_5; + } + + this.scanner = new Scanner( + true /*comment*/, + false /*whitespace*/, + false /*nls*/, + sourceLevel /*sourceLevel*/, + null /*taskTags*/, + null/*taskPriorities*/, + true/*taskCaseSensitive*/); + this.monitor = monitor; + this.insideComments = JavaScriptCore.ENABLED.equals(options.get(JavaScriptCore.COMPILER_DOC_COMMENT_SUPPORT)); + } + + protected void adjustSourcePositionsForParent(org.eclipse.wst.jsdt.internal.compiler.ast.Expression expression) { + int start = expression.sourceStart; + int end = expression.sourceEnd; + int leftParentCount = 1; + int rightParentCount = 0; + this.scanner.resetTo(start, end); + try { + int token = this.scanner.getNextToken(); + expression.sourceStart = this.scanner.currentPosition; + boolean stop = false; + while (!stop && ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF)) { + switch(token) { + case TerminalTokens.TokenNameLPAREN: + leftParentCount++; + break; + case TerminalTokens.TokenNameRPAREN: + rightParentCount++; + if (rightParentCount == leftParentCount) { + // we found the matching parenthesis + stop = true; + } + } + } + expression.sourceEnd = this.scanner.startPosition - 1; + } catch(InvalidInputException e) { + // ignore + } + } + + protected void addStatementsToBlock(org.eclipse.wst.jsdt.internal.compiler.ast.Statement[] statements, Block block) { + int statementsLength = statements.length; + for (int i = 0; i < statementsLength; i++) { + if (statements[i] instanceof org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration) { + checkAndAddMultipleLocalDeclaration(statements, i, block.statements()); + } + else if (statements[i] instanceof org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration) { // fix for inner function handling, Etienne Pfister + org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration method = (org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration) statements[i]; + block.statements().add(convert(method)); + } + else { + Statement statement = convert(statements[i]); + if (statement != null) { + block.statements().add(statement); + } + } + } + } + + protected void buildBodyDeclarations(org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration typeDeclaration, AbstractTypeDeclaration typeDecl) { + // add body declaration in the lexical order + org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration[] members = typeDeclaration.memberTypes; + org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration[] fields = typeDeclaration.fields; + org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration[] methods = typeDeclaration.methods; + + int fieldsLength = fields == null? 0 : fields.length; + int methodsLength = methods == null? 0 : methods.length; + int membersLength = members == null ? 0 : members.length; + int fieldsIndex = 0; + int methodsIndex = 0; + int membersIndex = 0; + + while ((fieldsIndex < fieldsLength) + || (membersIndex < membersLength) + || (methodsIndex < methodsLength)) { + org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration nextFieldDeclaration = null; + org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration nextMethodDeclaration = null; + org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration nextMemberDeclaration = null; + + int position = Integer.MAX_VALUE; + int nextDeclarationType = -1; + if (fieldsIndex < fieldsLength) { + nextFieldDeclaration = fields[fieldsIndex]; + if (nextFieldDeclaration.declarationSourceStart < position) { + position = nextFieldDeclaration.declarationSourceStart; + nextDeclarationType = 0; // FIELD + } + } + if (methodsIndex < methodsLength) { + nextMethodDeclaration = methods[methodsIndex]; + if (nextMethodDeclaration.declarationSourceStart < position) { + position = nextMethodDeclaration.declarationSourceStart; + nextDeclarationType = 1; // METHOD + } + } + if (membersIndex < membersLength) { + nextMemberDeclaration = members[membersIndex]; + if (nextMemberDeclaration.declarationSourceStart < position) { + position = nextMemberDeclaration.declarationSourceStart; + nextDeclarationType = 2; // MEMBER + } + } + switch (nextDeclarationType) { + case 0 : + checkAndAddMultipleFieldDeclaration(fields, fieldsIndex, typeDecl.bodyDeclarations()); + fieldsIndex++; + break; + case 1 : + methodsIndex++; + if (!nextMethodDeclaration.isDefaultConstructor() && !nextMethodDeclaration.isClinit()) { + typeDecl.bodyDeclarations().add(convert(nextMethodDeclaration)); + } + break; + case 2 : + membersIndex++; + ASTNode node = convert(nextMemberDeclaration); + if (node == null) { + typeDecl.setFlags(typeDecl.getFlags() | ASTNode.MALFORMED); + } else { + typeDecl.bodyDeclarations().add(node); + } + } + } + // Convert javadoc + convert(typeDeclaration.javadoc, typeDecl); + } + + + protected void buildBodyDeclarations(org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration expression, AnonymousClassDeclaration anonymousClassDeclaration) { + // add body declaration in the lexical order + org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration[] members = expression.memberTypes; + org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration[] fields = expression.fields; + org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration[] methods = expression.methods; + + int fieldsLength = fields == null? 0 : fields.length; + int methodsLength = methods == null? 0 : methods.length; + int membersLength = members == null ? 0 : members.length; + int fieldsIndex = 0; + int methodsIndex = 0; + int membersIndex = 0; + + while ((fieldsIndex < fieldsLength) + || (membersIndex < membersLength) + || (methodsIndex < methodsLength)) { + org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration nextFieldDeclaration = null; + org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration nextMethodDeclaration = null; + org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration nextMemberDeclaration = null; + + int position = Integer.MAX_VALUE; + int nextDeclarationType = -1; + if (fieldsIndex < fieldsLength) { + nextFieldDeclaration = fields[fieldsIndex]; + if (nextFieldDeclaration.declarationSourceStart < position) { + position = nextFieldDeclaration.declarationSourceStart; + nextDeclarationType = 0; // FIELD + } + } + if (methodsIndex < methodsLength) { + nextMethodDeclaration = methods[methodsIndex]; + if (nextMethodDeclaration.declarationSourceStart < position) { + position = nextMethodDeclaration.declarationSourceStart; + nextDeclarationType = 1; // METHOD + } + } + if (membersIndex < membersLength) { + nextMemberDeclaration = members[membersIndex]; + if (nextMemberDeclaration.declarationSourceStart < position) { + position = nextMemberDeclaration.declarationSourceStart; + nextDeclarationType = 2; // MEMBER + } + } + switch (nextDeclarationType) { + case 0 : + checkAndAddMultipleFieldDeclaration(fields, fieldsIndex, anonymousClassDeclaration.bodyDeclarations()); + fieldsIndex++; + break; + case 1 : + methodsIndex++; + if (!nextMethodDeclaration.isDefaultConstructor() && !nextMethodDeclaration.isClinit()) { + anonymousClassDeclaration.bodyDeclarations().add(convert(nextMethodDeclaration)); + } + break; + case 2 : + membersIndex++; + ASTNode node = convert(nextMemberDeclaration); + if (node == null) { + anonymousClassDeclaration.setFlags(anonymousClassDeclaration.getFlags() | ASTNode.MALFORMED); + } else { + anonymousClassDeclaration.bodyDeclarations().add(node); + } + } + } + } + + /** + * @param compilationUnit + * @param comments + */ + void buildCommentsTable(JavaScriptUnit compilationUnit, int[][] comments) { + // Build comment table + this.commentsTable = new Comment[comments.length]; + int nbr = 0; + for (int i = 0; i < comments.length; i++) { + Comment comment = createComment(comments[i]); + if (comment != null) { + comment.setAlternateRoot(compilationUnit); + this.commentsTable[nbr++] = comment; + } + } + // Resize table if necessary + if (nbr 0 && fields[index - 1].declarationSourceStart == fields[index].declarationSourceStart) { + // we have a multiple field declaration + // We retrieve the existing fieldDeclaration to add the new VariableDeclarationFragment + FieldDeclaration fieldDeclaration = (FieldDeclaration) bodyDeclarations.get(bodyDeclarations.size() - 1); + fieldDeclaration.fragments().add(convertToVariableDeclarationFragment(fields[index])); + } else { + // we can create a new FieldDeclaration + bodyDeclarations.add(convertToFieldDeclaration(fields[index])); + } + } + + protected void checkAndAddMultipleLocalDeclaration(org.eclipse.wst.jsdt.internal.compiler.ast.ProgramElement[] stmts, int index, List blockStatements) { +// if (index > 0 +// && stmts[index - 1] instanceof org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration) { +// org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration local1 = (org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration) stmts[index - 1]; +// org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration local2 = (org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration) stmts[index]; +// if (local1.declarationSourceStart == local2.declarationSourceStart) { +// // we have a multiple local declarations +// // We retrieve the existing VariableDeclarationStatement to add the new VariableDeclarationFragment +// VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) blockStatements.get(blockStatements.size() - 1); +// variableDeclarationStatement.fragments().add(convertToVariableDeclarationFragment((org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration)stmts[index])); +// } else { +// // we can create a new FieldDeclaration +// blockStatements.add(convertToVariableDeclarationStatement((org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration)stmts[index])); +// } +// } else { +// // we can create a new FieldDeclaration +// blockStatements.add(convertToVariableDeclarationStatement((org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration)stmts[index])); +// } + VariableDeclarationStatement variableDeclarationStatement = convertToVariableDeclarationStatement((org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration)stmts[index]); + blockStatements.add(variableDeclarationStatement); + } + + protected void checkCanceled() { + if (this.monitor != null && this.monitor.isCanceled()) + throw new OperationCanceledException(); + } + + protected void completeRecord(ArrayType arrayType, org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode astNode) { + ArrayType array = arrayType; + int dimensions = array.getDimensions(); + for (int i = 0; i < dimensions; i++) { + Type componentType = array.getComponentType(); + this.recordNodes(componentType, astNode); + if (componentType.isArrayType()) { + array = (ArrayType) componentType; + } + } + } + + + public ASTNode convert(org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration methodDeclaration) { + checkCanceled(); + FunctionDeclaration methodDecl = new FunctionDeclaration(this.ast); + setModifiers(methodDecl, methodDeclaration); + boolean isConstructor = methodDeclaration.isConstructor(); + methodDecl.setConstructor(isConstructor); + int start = methodDeclaration.sourceStart; + int end; + SimpleName methodName =null; + if (methodDeclaration.selector!=null) + { + methodName = new SimpleName(this.ast); + methodName.internalSetIdentifier(new String(methodDeclaration.selector)); + end = retrieveIdentifierEndPosition(start, methodDeclaration.sourceEnd); + + methodName.setSourceRange(start, end - start + 1); + methodDecl.setName(methodName); + } + else + end= methodDeclaration.sourceStart; + org.eclipse.wst.jsdt.internal.compiler.ast.Argument[] parameters = methodDeclaration.arguments; + if (parameters != null) { + int parametersLength = parameters.length; + for (int i = 0; i < parametersLength; i++) { + methodDecl.parameters().add(convert(parameters[i])); + } + } + org.eclipse.wst.jsdt.internal.compiler.ast.ExplicitConstructorCall explicitConstructorCall = null; + /* need this check because a constructor could have been made a constructor after the + * method declaration was created, and thus it is not a ConstructorDeclaration + */ + if (isConstructor && methodDeclaration instanceof ConstructorDeclaration) { + ConstructorDeclaration constructorDeclaration = (ConstructorDeclaration) methodDeclaration; + explicitConstructorCall = constructorDeclaration.constructorCall; + switch(this.ast.apiLevel) { + case AST.JLS2_INTERNAL : + // set the return type to VOID + PrimitiveType returnType = new PrimitiveType(this.ast); + returnType.setPrimitiveTypeCode(PrimitiveType.VOID); + returnType.setSourceRange(methodDeclaration.sourceStart, 0); + methodDecl.internalSetReturnType(returnType); + break; + case AST.JLS3 : + methodDecl.setReturnType2(null); + } + } else if (methodDeclaration instanceof org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration) { + org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration method = (org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration) methodDeclaration; + org.eclipse.wst.jsdt.internal.compiler.ast.TypeReference typeReference = method.returnType; + if (typeReference != null) { + Type returnType = convertType(typeReference,method.inferredType); + // get the positions of the right parenthesis + int rightParenthesisPosition = retrieveEndOfRightParenthesisPosition(end, method.bodyEnd); + int extraDimensions = retrieveExtraDimension(rightParenthesisPosition, method.bodyEnd); + methodDecl.setExtraDimensions(extraDimensions); + setTypeForMethodDeclaration(methodDecl, returnType, extraDimensions); + } else { + switch(this.ast.apiLevel) { + case AST.JLS2_INTERNAL : + methodDecl.setFlags(methodDecl.getFlags() | ASTNode.MALFORMED); + break; + case AST.JLS3 : + methodDecl.setReturnType2(null); + } + } + } + int declarationSourceStart = methodDeclaration.declarationSourceStart; + int declarationSourceEnd = methodDeclaration.bodyEnd; + methodDecl.setSourceRange(declarationSourceStart, declarationSourceEnd - declarationSourceStart + 1); + int closingPosition = retrieveRightBraceOrSemiColonPosition(methodDeclaration.bodyEnd + 1, methodDeclaration.declarationSourceEnd); + if (closingPosition != -1) { + int startPosition = methodDecl.getStartPosition(); + methodDecl.setSourceRange(startPosition, closingPosition - startPosition + 1); + + org.eclipse.wst.jsdt.internal.compiler.ast.Statement[] statements = methodDeclaration.statements; + + start = retrieveStartBlockPosition(methodDeclaration.sourceStart, declarationSourceEnd); + end = retrieveEndBlockPosition(methodDeclaration.sourceStart, methodDeclaration.declarationSourceEnd); + Block block = null; + if (start != -1 && end != -1) { + /* + * start or end can be equal to -1 if we have an interface's method. + */ + block = new Block(this.ast); + block.setSourceRange(start, end - start + 1); + methodDecl.setBody(block); + } + if (block != null && (statements != null || explicitConstructorCall != null)) { + if (explicitConstructorCall != null && explicitConstructorCall.accessMode != org.eclipse.wst.jsdt.internal.compiler.ast.ExplicitConstructorCall.ImplicitSuper) { + block.statements().add(convert(explicitConstructorCall)); + } + if (statements != null) { + addStatementsToBlock(statements, block); + } + } + if (block != null && (Modifier.isAbstract(methodDecl.getModifiers()) || Modifier.isNative(methodDecl.getModifiers()))) { + methodDecl.setFlags(methodDecl.getFlags() | ASTNode.MALFORMED); + } + } else { + // syntax error in this method declaration + if (!methodDeclaration.isAbstract()) { + start = retrieveStartBlockPosition(methodDeclaration.sourceStart, declarationSourceEnd); + end = methodDeclaration.bodyEnd; + // try to get the best end position + CategorizedProblem[] problems = methodDeclaration.compilationResult().problems; + if (problems != null) { + for (int i = 0, max = methodDeclaration.compilationResult().problemCount; i < max; i++) { + CategorizedProblem currentProblem = problems[i]; + if (currentProblem.getSourceStart() == start && currentProblem.getID() == IProblem.ParsingErrorInsertToComplete) { + end = currentProblem.getSourceEnd(); + break; + } + } + } + int startPosition = methodDecl.getStartPosition(); + methodDecl.setSourceRange(startPosition, end - startPosition + 1); + if (start != -1 && end != -1) { + /* + * start or end can be equal to -1 if we have an interface's method. + */ + Block block = new Block(this.ast); + block.setSourceRange(start, end - start + 1); + methodDecl.setBody(block); + } + } + } + + // The jsdoc comment is now got from list store in javaScript unit declaration + convert(methodDeclaration.javadoc, methodDecl); + if (this.resolveBindings) { + recordNodes(methodDecl, methodDeclaration); + if (methodName!=null) + recordNodes(methodName, methodDeclaration); + methodDecl.resolveBinding(); + } + return methodDecl; + } + + public ClassInstanceCreation convert(org.eclipse.wst.jsdt.internal.compiler.ast.AllocationExpression expression) { + ClassInstanceCreation classInstanceCreation = new ClassInstanceCreation(this.ast); + if (this.resolveBindings) { + recordNodes(classInstanceCreation, expression); + } + if (expression.type!=null) { + switch (this.ast.apiLevel) { + case AST.JLS2_INTERNAL: + classInstanceCreation.internalSetName(convert(expression.type)); + break; + case AST.JLS3: + classInstanceCreation.setType(convertType(expression.type)); + } + } + classInstanceCreation.setMember(convert(expression.member)); + classInstanceCreation.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); + org.eclipse.wst.jsdt.internal.compiler.ast.Expression[] arguments = expression.arguments; + if (arguments != null) { + int length = arguments.length; + for (int i = 0; i < length; i++) { + classInstanceCreation.arguments().add(convert(arguments[i])); + } + } + removeTrailingCommentFromExpressionEndingWithAParen(classInstanceCreation); + return classInstanceCreation; + } + + public Expression convert(org.eclipse.wst.jsdt.internal.compiler.ast.AND_AND_Expression expression) { + InfixExpression infixExpression = new InfixExpression(this.ast); + infixExpression.setOperator(InfixExpression.Operator.CONDITIONAL_AND); + if (this.resolveBindings) { + this.recordNodes(infixExpression, expression); + } + final int expressionOperatorID = (expression.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorMASK) >> org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorSHIFT; + if (expression.left instanceof org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression + && ((expression.left.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.ParenthesizedMASK) == 0)) { + // create an extended string literal equivalent => use the extended operands list + infixExpression.extendedOperands().add(convert(expression.right)); + org.eclipse.wst.jsdt.internal.compiler.ast.Expression leftOperand = expression.left; + org.eclipse.wst.jsdt.internal.compiler.ast.Expression rightOperand = null; + do { + rightOperand = ((org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression) leftOperand).right; + if ((((leftOperand.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorMASK) >> org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorSHIFT) != expressionOperatorID + && ((leftOperand.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.ParenthesizedMASK) == 0)) + || ((rightOperand instanceof org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression + && ((rightOperand.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorMASK) >> org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorSHIFT) != expressionOperatorID) + && ((rightOperand.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.ParenthesizedMASK) == 0))) { + List extendedOperands = infixExpression.extendedOperands(); + InfixExpression temp = new InfixExpression(this.ast); + if (this.resolveBindings) { + this.recordNodes(temp, expression); + } + temp.setOperator(getOperatorFor(expressionOperatorID)); + Expression leftSide = convert(leftOperand); + temp.setLeftOperand(leftSide); + temp.setSourceRange(leftSide.getStartPosition(), leftSide.getLength()); + int size = extendedOperands.size(); + for (int i = 0; i < size - 1; i++) { + Expression expr = temp; + temp = new InfixExpression(this.ast); + + if (this.resolveBindings) { + this.recordNodes(temp, expression); + } + temp.setLeftOperand(expr); + temp.setOperator(getOperatorFor(expressionOperatorID)); + temp.setSourceRange(expr.getStartPosition(), expr.getLength()); + } + infixExpression = temp; + for (int i = 0; i < size; i++) { + Expression extendedOperand = (Expression) extendedOperands.remove(size - 1 - i); + temp.setRightOperand(extendedOperand); + int startPosition = temp.getLeftOperand().getStartPosition(); + temp.setSourceRange(startPosition, extendedOperand.getStartPosition() + extendedOperand.getLength() - startPosition); + if (temp.getLeftOperand().getNodeType() == ASTNode.INFIX_EXPRESSION) { + temp = (InfixExpression) temp.getLeftOperand(); + } + } + int startPosition = infixExpression.getLeftOperand().getStartPosition(); + infixExpression.setSourceRange(startPosition, expression.sourceEnd - startPosition + 1); + if (this.resolveBindings) { + this.recordNodes(infixExpression, expression); + } + return infixExpression; + } + infixExpression.extendedOperands().add(0, convert(rightOperand)); + leftOperand = ((org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression) leftOperand).left; + } while (leftOperand instanceof org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression && ((leftOperand.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.ParenthesizedMASK) == 0)); + Expression leftExpression = convert(leftOperand); + infixExpression.setLeftOperand(leftExpression); + infixExpression.setRightOperand((Expression)infixExpression.extendedOperands().remove(0)); + int startPosition = leftExpression.getStartPosition(); + infixExpression.setSourceRange(startPosition, expression.sourceEnd - startPosition + 1); + return infixExpression; + } + Expression leftExpression = convert(expression.left); + infixExpression.setLeftOperand(leftExpression); + infixExpression.setRightOperand(convert(expression.right)); + infixExpression.setOperator(InfixExpression.Operator.CONDITIONAL_AND); + int startPosition = leftExpression.getStartPosition(); + infixExpression.setSourceRange(startPosition, expression.sourceEnd - startPosition + 1); + return infixExpression; + } + + + + public SingleVariableDeclaration convert(org.eclipse.wst.jsdt.internal.compiler.ast.Argument argument) { + SingleVariableDeclaration variableDecl = new SingleVariableDeclaration(this.ast); + setModifiers(variableDecl, argument); + final SimpleName name = new SimpleName(this.ast); + name.internalSetIdentifier(new String(argument.name)); + int start = argument.sourceStart; + int nameEnd = argument.sourceEnd; + name.setSourceRange(start, nameEnd - start + 1); + variableDecl.setName(name); +// final int typeSourceEnd = argument.type.sourceEnd; + final int extraDimensions = 0; +// final int extraDimensions = retrieveExtraDimension(nameEnd + 1, typeSourceEnd); +// variableDecl.setExtraDimensions(extraDimensions); +// final boolean isVarArgs = argument.isVarArgs(); +// if (isVarArgs && extraDimensions == 0) { +// // remove the ellipsis from the type source end +// argument.type.sourceEnd = retrieveEllipsisStartPosition(argument.type.sourceStart, typeSourceEnd); +// } + Type type = convertType(argument.type,argument.inferredType); +// int typeEnd = type.getStartPosition() + type.getLength() - 1; +// int rightEnd = Math.max(typeEnd, argument.declarationSourceEnd); + int rightEnd = argument.declarationSourceEnd; + /* + * There is extra work to do to set the proper type positions + * See PR http://bugs.eclipse.org/bugs/show_bug.cgi?id=23284 + */ +// if (isVarArgs) { +// setTypeForSingleVariableDeclaration(variableDecl, type, extraDimensions + 1); +// if (extraDimensions != 0) { +// variableDecl.setFlags(variableDecl.getFlags() | ASTNode.MALFORMED); +// } +// } else { + setTypeForSingleVariableDeclaration(variableDecl, type, extraDimensions); +// } + variableDecl.setSourceRange(argument.declarationSourceStart, rightEnd - argument.declarationSourceStart + 1); + +// if (isVarArgs) { +// switch(this.ast.apiLevel) { +// case AST.JLS2_INTERNAL : +// variableDecl.setFlags(variableDecl.getFlags() | ASTNode.MALFORMED); +// break; +// case AST.JLS3 : +// variableDecl.setVarargs(true); +// } +// } + if (this.resolveBindings) { + recordNodes(name, argument); + recordNodes(variableDecl, argument); + variableDecl.resolveBinding(); + } + return variableDecl; + } + + + public ArrayCreation convert(org.eclipse.wst.jsdt.internal.compiler.ast.ArrayAllocationExpression expression) { + ArrayCreation arrayCreation = new ArrayCreation(this.ast); + if (this.resolveBindings) { + recordNodes(arrayCreation, expression); + } + arrayCreation.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); + org.eclipse.wst.jsdt.internal.compiler.ast.Expression[] dimensions = expression.dimensions; + + int dimensionsLength = dimensions.length; + for (int i = 0; i < dimensionsLength; i++) { + if (dimensions[i] != null) { + Expression dimension = convert(dimensions[i]); + if (this.resolveBindings) { + recordNodes(dimension, dimensions[i]); + } + arrayCreation.dimensions().add(dimension); + } + } + Type type = convertType(expression.type); + if (this.resolveBindings) { + recordNodes(type, expression.type); + } + ArrayType arrayType = null; + if (type.isArrayType()) { + arrayType = (ArrayType) type; + } else { + arrayType = this.ast.newArrayType(type, dimensionsLength); + if (this.resolveBindings) { + completeRecord(arrayType, expression); + } + int start = type.getStartPosition(); + int end = type.getStartPosition() + type.getLength(); + int previousSearchStart = end; + ArrayType componentType = (ArrayType) type.getParent(); + for (int i = 0; i < dimensionsLength; i++) { + previousSearchStart = retrieveRightBracketPosition(previousSearchStart + 1, this.compilationUnitSourceLength); + componentType.setSourceRange(start, previousSearchStart - start + 1); + componentType = (ArrayType) componentType.getParent(); + } + } + arrayCreation.setType(arrayType); + if (this.resolveBindings) { + recordNodes(arrayType, expression); + } + if (expression.initializer != null) { + arrayCreation.setInitializer(convert(expression.initializer)); + } + return arrayCreation; + } + + public ArrayInitializer convert(org.eclipse.wst.jsdt.internal.compiler.ast.ArrayInitializer expression) { + ArrayInitializer arrayInitializer = new ArrayInitializer(this.ast); + if (this.resolveBindings) { + recordNodes(arrayInitializer, expression); + } + arrayInitializer.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); + org.eclipse.wst.jsdt.internal.compiler.ast.Expression[] expressions = expression.expressions; + if (expressions != null) { + int length = expressions.length; + for (int i = 0; i < length; i++) { + Expression expr = convert(expressions[i]); + if (this.resolveBindings) { + recordNodes(expr, expressions[i]); + } + arrayInitializer.expressions().add(expr); + } + } + return arrayInitializer; + } + + public ArrayAccess convert(org.eclipse.wst.jsdt.internal.compiler.ast.ArrayReference reference) { + ArrayAccess arrayAccess = new ArrayAccess(this.ast); + if (this.resolveBindings) { + recordNodes(arrayAccess, reference); + } + arrayAccess.setSourceRange(reference.sourceStart, reference.sourceEnd - reference.sourceStart + 1); + arrayAccess.setArray(convert(reference.receiver)); + arrayAccess.setIndex(convert(reference.position)); + return arrayAccess; + } + + public Assignment convert(org.eclipse.wst.jsdt.internal.compiler.ast.Assignment expression) { + Assignment assignment = new Assignment(this.ast); + if (this.resolveBindings) { + recordNodes(assignment, expression); + } + Expression lhs = convert(expression.lhs); + assignment.setLeftHandSide(lhs); + assignment.setOperator(Assignment.Operator.ASSIGN); + assignment.setRightHandSide(convert(expression.expression)); + int start = lhs.getStartPosition(); + assignment.setSourceRange(start, expression.sourceEnd - start + 1); + return assignment; + } + + /* + * Internal use only + * Used to convert class body declarations + */ + public JavaScriptUnit convert(org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode[] nodes, JavaScriptUnit compilationUnit) { +// typeDecl.setInterface(false); + int nodesLength = nodes.length; + for (int i = 0; i < nodesLength; i++) { + org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode node = nodes[i]; + if (node instanceof org.eclipse.wst.jsdt.internal.compiler.ast.Initializer) { + org.eclipse.wst.jsdt.internal.compiler.ast.Initializer oldInitializer = (org.eclipse.wst.jsdt.internal.compiler.ast.Initializer) node; + Initializer initializer = new Initializer(this.ast); + initializer.setBody(convert(oldInitializer.block)); + setModifiers(initializer, oldInitializer); + initializer.setSourceRange(oldInitializer.declarationSourceStart, oldInitializer.sourceEnd - oldInitializer.declarationSourceStart + 1); +// setJavaDocComment(initializer); +// initializer.setJavadoc(convert(oldInitializer.javadoc)); + convert(oldInitializer.javadoc, initializer); + compilationUnit.statements().add(initializer); + } else if (node instanceof org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration) { + org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration fieldDeclaration = (org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration) node; + if (i > 0 + && (nodes[i - 1] instanceof org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration) + && ((org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration)nodes[i - 1]).declarationSourceStart == fieldDeclaration.declarationSourceStart) { + // we have a multiple field declaration + // We retrieve the existing fieldDeclaration to add the new VariableDeclarationFragment + FieldDeclaration currentFieldDeclaration = (FieldDeclaration) compilationUnit.statements().get(compilationUnit.statements().size() - 1); + currentFieldDeclaration.fragments().add(convertToVariableDeclarationFragment(fieldDeclaration)); + } else { + // we can create a new FieldDeclaration + compilationUnit.statements().add(convertToFieldDeclaration(fieldDeclaration)); + } + } else if(node instanceof org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration) { + AbstractMethodDeclaration nextMethodDeclaration = (AbstractMethodDeclaration) node; + if (!nextMethodDeclaration.isDefaultConstructor() && !nextMethodDeclaration.isClinit()) { + compilationUnit.statements().add(convert(nextMethodDeclaration)); + } + } else if (node instanceof org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration) { + org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration localDeclaration = (org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration) node; + if (i > 0 + && (nodes[i - 1] instanceof org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration) + && ((org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration)nodes[i - 1]).declarationSourceStart == localDeclaration.declarationSourceStart) { + // we have a multiple field declaration + // We retrieve the existing fieldDeclaration to add the new VariableDeclarationFragment + FieldDeclaration currentFieldDeclaration = (FieldDeclaration) compilationUnit.statements().get(compilationUnit.statements().size() - 1); + currentFieldDeclaration.fragments().add(convertToVariableDeclarationFragment(localDeclaration)); + } else { + // we can create a new FieldDeclaration + compilationUnit.statements().add(convertToFieldDeclaration(localDeclaration)); + } + } +// else if(node instanceof org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration) { +// org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration nextMemberDeclaration = (org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration) node; +// ASTNode nextMemberDeclarationNode = convert(nextMemberDeclaration); +// if (nextMemberDeclarationNode == null) { +// typeDecl.setFlags(typeDecl.getFlags() | ASTNode.MALFORMED); +// } else { +// typeDecl.bodyDeclarations().add(nextMemberDeclarationNode); +// } +// } + } + return compilationUnit; + } + + public Expression convert(org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression expression) { + InfixExpression infixExpression = new InfixExpression(this.ast); + if (this.resolveBindings) { + this.recordNodes(infixExpression, expression); + } + + int expressionOperatorID = (expression.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorMASK) >> org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorSHIFT; + switch (expressionOperatorID) { + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.EQUAL_EQUAL : + infixExpression.setOperator(InfixExpression.Operator.EQUALS); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.LESS_EQUAL : + infixExpression.setOperator(InfixExpression.Operator.LESS_EQUALS); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.GREATER_EQUAL : + infixExpression.setOperator(InfixExpression.Operator.GREATER_EQUALS); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.NOT_EQUAL : + infixExpression.setOperator(InfixExpression.Operator.NOT_EQUALS); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.LEFT_SHIFT : + infixExpression.setOperator(InfixExpression.Operator.LEFT_SHIFT); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.RIGHT_SHIFT : + infixExpression.setOperator(InfixExpression.Operator.RIGHT_SHIFT_SIGNED); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.UNSIGNED_RIGHT_SHIFT : + infixExpression.setOperator(InfixExpression.Operator.RIGHT_SHIFT_UNSIGNED); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.OR_OR : + infixExpression.setOperator(InfixExpression.Operator.CONDITIONAL_OR); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.AND_AND : + infixExpression.setOperator(InfixExpression.Operator.CONDITIONAL_AND); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.PLUS : + infixExpression.setOperator(InfixExpression.Operator.PLUS); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.MINUS : + infixExpression.setOperator(InfixExpression.Operator.MINUS); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.REMAINDER : + infixExpression.setOperator(InfixExpression.Operator.REMAINDER); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.XOR : + infixExpression.setOperator(InfixExpression.Operator.XOR); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.AND : + infixExpression.setOperator(InfixExpression.Operator.AND); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.MULTIPLY : + infixExpression.setOperator(InfixExpression.Operator.TIMES); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.OR : + infixExpression.setOperator(InfixExpression.Operator.OR); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.DIVIDE : + infixExpression.setOperator(InfixExpression.Operator.DIVIDE); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.GREATER : + infixExpression.setOperator(InfixExpression.Operator.GREATER); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.LESS : + infixExpression.setOperator(InfixExpression.Operator.LESS); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.INSTANCEOF : + infixExpression.setOperator(InfixExpression.Operator.INSTANCEOF); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.IN: + infixExpression.setOperator(InfixExpression.Operator.IN); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.EQUAL_EQUAL_EQUAL : + infixExpression.setOperator(InfixExpression.Operator.EQUAL_EQUAL_EQUAL); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.NOT_EQUAL_EQUAL : + infixExpression.setOperator(InfixExpression.Operator.NOT_EQUAL_EQUAL); + break; + } + + if (expression.left instanceof org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression + && ((expression.left.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.ParenthesizedMASK) == 0)) { + // create an extended string literal equivalent => use the extended operands list + infixExpression.extendedOperands().add(convert(expression.right)); + org.eclipse.wst.jsdt.internal.compiler.ast.Expression leftOperand = expression.left; + org.eclipse.wst.jsdt.internal.compiler.ast.Expression rightOperand = null; + do { + rightOperand = ((org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression) leftOperand).right; + if ((((leftOperand.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorMASK) >> org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorSHIFT) != expressionOperatorID + && ((leftOperand.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.ParenthesizedMASK) == 0)) + || ((rightOperand instanceof org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression + && ((rightOperand.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorMASK) >> org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorSHIFT) != expressionOperatorID) + && ((rightOperand.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.ParenthesizedMASK) == 0))) { + List extendedOperands = infixExpression.extendedOperands(); + InfixExpression temp = new InfixExpression(this.ast); + if (this.resolveBindings) { + this.recordNodes(temp, expression); + } + temp.setOperator(getOperatorFor(expressionOperatorID)); + Expression leftSide = convert(leftOperand); + temp.setLeftOperand(leftSide); + temp.setSourceRange(leftSide.getStartPosition(), leftSide.getLength()); + int size = extendedOperands.size(); + for (int i = 0; i < size - 1; i++) { + Expression expr = temp; + temp = new InfixExpression(this.ast); + + if (this.resolveBindings) { + this.recordNodes(temp, expression); + } + temp.setLeftOperand(expr); + temp.setOperator(getOperatorFor(expressionOperatorID)); + temp.setSourceRange(expr.getStartPosition(), expr.getLength()); + } + infixExpression = temp; + for (int i = 0; i < size; i++) { + Expression extendedOperand = (Expression) extendedOperands.remove(size - 1 - i); + temp.setRightOperand(extendedOperand); + int startPosition = temp.getLeftOperand().getStartPosition(); + temp.setSourceRange(startPosition, extendedOperand.getStartPosition() + extendedOperand.getLength() - startPosition); + if (temp.getLeftOperand().getNodeType() == ASTNode.INFIX_EXPRESSION) { + temp = (InfixExpression) temp.getLeftOperand(); + } + } + int startPosition = infixExpression.getLeftOperand().getStartPosition(); + infixExpression.setSourceRange(startPosition, expression.sourceEnd - startPosition + 1); + if (this.resolveBindings) { + this.recordNodes(infixExpression, expression); + } + return infixExpression; + } + infixExpression.extendedOperands().add(0, convert(rightOperand)); + leftOperand = ((org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression) leftOperand).left; + } while (leftOperand instanceof org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression && ((leftOperand.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.ParenthesizedMASK) == 0)); + Expression leftExpression = convert(leftOperand); + infixExpression.setLeftOperand(leftExpression); + infixExpression.setRightOperand((Expression)infixExpression.extendedOperands().remove(0)); + int startPosition = leftExpression.getStartPosition(); + infixExpression.setSourceRange(startPosition, expression.sourceEnd - startPosition + 1); + return infixExpression; + } else if (expression.left instanceof StringLiteralConcatenation + && ((expression.left.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.ParenthesizedMASK) == 0) + && (OperatorIds.PLUS == expressionOperatorID)) { + StringLiteralConcatenation literal = (StringLiteralConcatenation) expression.left; + final org.eclipse.wst.jsdt.internal.compiler.ast.Expression[] stringLiterals = literal.literals; + infixExpression.setLeftOperand(convert(stringLiterals[0])); + infixExpression.setRightOperand(convert(stringLiterals[1])); + for (int i = 2; i < literal.counter; i++) { + infixExpression.extendedOperands().add(convert(stringLiterals[i])); + } + infixExpression.extendedOperands().add(convert(expression.right)); + int startPosition = literal.sourceStart; + infixExpression.setSourceRange(startPosition, expression.sourceEnd - startPosition + 1); + return infixExpression; + } + Expression leftExpression = convert(expression.left); + infixExpression.setLeftOperand(leftExpression); + infixExpression.setRightOperand(convert(expression.right)); + int startPosition = leftExpression.getStartPosition(); + infixExpression.setSourceRange(startPosition, expression.sourceEnd - startPosition + 1); + return infixExpression; + } + + public Block convert(org.eclipse.wst.jsdt.internal.compiler.ast.Block statement) { + Block block = new Block(this.ast); + if (statement.sourceEnd > 0) { + block.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); + } + org.eclipse.wst.jsdt.internal.compiler.ast.Statement[] statements = statement.statements; + if (statements != null) { + addStatementsToBlock(statements, block); + } + return block; + } + + public BreakStatement convert(org.eclipse.wst.jsdt.internal.compiler.ast.BreakStatement statement) { + BreakStatement breakStatement = new BreakStatement(this.ast); + breakStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); + if (statement.label != null) { + final SimpleName name = new SimpleName(this.ast); + name.internalSetIdentifier(new String(statement.label)); + retrieveIdentifierAndSetPositions(statement.sourceStart, statement.sourceEnd, name); + breakStatement.setLabel(name); + } + return breakStatement; + } + + + public SwitchCase convert(org.eclipse.wst.jsdt.internal.compiler.ast.CaseStatement statement) { + SwitchCase switchCase = new SwitchCase(this.ast); + org.eclipse.wst.jsdt.internal.compiler.ast.Expression constantExpression = statement.constantExpression; + if (constantExpression == null) { + switchCase.setExpression(null); + } else { + switchCase.setExpression(convert(constantExpression)); + } + switchCase.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); + retrieveColonPosition(switchCase); + return switchCase; + } + + public FunctionExpression convert(org.eclipse.wst.jsdt.internal.compiler.ast.FunctionExpression expression) { + FunctionExpression functionExpression = new FunctionExpression(this.ast); + int sourceEnd = expression.sourceEnd; + if (sourceEnd==0) + sourceEnd=expression.methodDeclaration.bodyEnd; + functionExpression.setSourceRange(expression.sourceStart, sourceEnd - expression.sourceStart + 1); + + functionExpression.setMethod((FunctionDeclaration)convert(expression.methodDeclaration)); + if (this.resolveBindings) { + recordNodes(functionExpression, expression); + } + return functionExpression; + } + + public ObjectLiteral convert(org.eclipse.wst.jsdt.internal.compiler.ast.ObjectLiteral objLiteral) { + ObjectLiteral objectLiteral = new ObjectLiteral(this.ast); + objectLiteral.setSourceRange(objLiteral.sourceStart, objLiteral.sourceEnd - objLiteral.sourceStart + 1); + + org.eclipse.wst.jsdt.internal.compiler.ast.ObjectLiteralField[] fields = objLiteral.fields; + if (fields != null) { + int fieldsLength = fields.length; + for (int i = 0; i < fieldsLength; i++) { + + ObjectLiteralField objectLiteralField =convert(fields[i]); + objectLiteral.fields().add(objectLiteralField); + } + } + + if (this.resolveBindings) { + recordNodes(objectLiteral, objLiteral); + } + return objectLiteral; + } + + public ObjectLiteralField convert(org.eclipse.wst.jsdt.internal.compiler.ast.ObjectLiteralField field) { + ObjectLiteralField objectLiteralField = new ObjectLiteralField(this.ast); + objectLiteralField.setSourceRange(field.sourceStart, field.sourceEnd - field.sourceStart + 1); + + objectLiteralField.setFieldName( convert(field.fieldName)); + objectLiteralField.setInitializer( convert(field.initializer)); + if (this.resolveBindings) { + recordNodes(objectLiteralField, field); + } + return objectLiteralField; + } + + public RegularExpressionLiteral convert(org.eclipse.wst.jsdt.internal.compiler.ast.RegExLiteral expression) { + int length = expression.sourceEnd - expression.sourceStart + 1; + int sourceStart = expression.sourceStart; + RegularExpressionLiteral literal = new RegularExpressionLiteral(this.ast); + if (this.resolveBindings) { + this.recordNodes(literal, expression); + } + literal.internalSetRegularExpression(new String(this.compilationUnitSource, sourceStart, length)); + literal.setSourceRange(sourceStart, length); + removeLeadingAndTrailingCommentsFromLiteral(literal); + return literal; + } + + public Expression convert(org.eclipse.wst.jsdt.internal.compiler.ast.ClassLiteralAccess expression) { + TypeLiteral typeLiteral = new TypeLiteral(this.ast); + if (this.resolveBindings) { + this.recordNodes(typeLiteral, expression); + } + typeLiteral.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); + typeLiteral.setType(convertType(expression.type)); + return typeLiteral; + } + + public JavaScriptUnit convert(org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration unit, char[] source) { + if(unit.compilationResult.recoveryScannerData != null) { + RecoveryScanner recoveryScanner = new RecoveryScanner(this.scanner, unit.compilationResult.recoveryScannerData.removeUnused()); + this.scanner = recoveryScanner; + this.docParser.scanner = this.scanner; + } + this.compilationUnitSource = source; + this.compilationUnitSourceLength = source.length; + this.scanner.setSource(source, unit.compilationResult); + JavaScriptUnit compilationUnit = new JavaScriptUnit(this.ast); + + // Parse comments + int[][] comments = unit.comments; + if (comments != null) { + buildCommentsTable(compilationUnit, comments); + } + + // handle the package declaration immediately + // There is no node corresponding to the package declaration + if (this.resolveBindings) { + recordNodes(compilationUnit, unit); + } + if (unit.currentPackage != null) { + PackageDeclaration packageDeclaration = convertPackage(unit); + compilationUnit.setPackage(packageDeclaration); + } + org.eclipse.wst.jsdt.internal.compiler.ast.ImportReference[] imports = unit.imports; + if (imports != null) { + int importLength = imports.length; + for (int i = 0; i < importLength; i++) { + compilationUnit.imports().add(convertImport(imports[i])); + } + } + +// org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration[] types = unit.types; +// if (types != null) { +// int typesLength = types.length; +// for (int i = 0; i < typesLength; i++) { +// org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration declaration = types[i]; +// if (CharOperation.equals(declaration.name, TypeConstants.PACKAGE_INFO_NAME)) { +// continue; +// } +// ASTNode type = convert(declaration); +// if (type == null) { +// compilationUnit.setFlags(compilationUnit.getFlags() | ASTNode.MALFORMED); +// } else { +// compilationUnit.types().add(type); +// } +// } +// } + org.eclipse.wst.jsdt.internal.compiler.ast.ProgramElement[] statements = unit.statements; + if (statements != null) { + int statementsLength = statements.length; + for (int i = 0; i < statementsLength; i++) { +// org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration declaration = types[i]; +// if (CharOperation.equals(declaration.name, TypeConstants.PACKAGE_INFO_NAME)) { +// continue; +// } + ProgramElement programElement=statements[i]; + ASTNode type = null; + if (programElement instanceof LocalDeclaration ) + { + checkAndAddMultipleLocalDeclaration(statements, i, compilationUnit.statements()); + + } + else if (programElement instanceof AbstractMethodDeclaration ) + { + type = convert((AbstractMethodDeclaration)programElement); + } + else if (programElement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.Statement ) + { + type = convert((org.eclipse.wst.jsdt.internal.compiler.ast.Statement )programElement); + } + else + throw new RuntimeException(""); //$NON-NLS-1$ + + + if (type == null) { +// compilationUnit.setFlags(compilationUnit.getFlags() | ASTNode.MALFORMED); + } else { + compilationUnit.statements().add(type); + } + } + } + compilationUnit.setSourceRange(unit.sourceStart, unit.sourceEnd - unit.sourceStart + 1); + + int problemLength = unit.compilationResult.problemCount; + if (problemLength != 0) { + CategorizedProblem[] resizedProblems = null; + final CategorizedProblem[] problems = unit.compilationResult.getProblems(); + final int realProblemLength=problems.length; + if (realProblemLength == problemLength) { + resizedProblems = problems; + } else { + System.arraycopy(problems, 0, (resizedProblems = new CategorizedProblem[realProblemLength]), 0, realProblemLength); + } + ASTSyntaxErrorPropagator syntaxErrorPropagator = new ASTSyntaxErrorPropagator(resizedProblems); + compilationUnit.accept(syntaxErrorPropagator); + ASTRecoveryPropagator recoveryPropagator = + new ASTRecoveryPropagator(resizedProblems, unit.compilationResult.recoveryScannerData); + compilationUnit.accept(recoveryPropagator); + compilationUnit.setProblems(resizedProblems); + } + if (this.resolveBindings) { + lookupForScopes(); + } + compilationUnit.initCommentMapper(this.scanner); + return compilationUnit; + } + + public Assignment convert(org.eclipse.wst.jsdt.internal.compiler.ast.CompoundAssignment expression) { + Assignment assignment = new Assignment(this.ast); + Expression lhs = convert(expression.lhs); + assignment.setLeftHandSide(lhs); + int start = lhs.getStartPosition(); + assignment.setSourceRange(start, expression.sourceEnd - start + 1); + switch (expression.operator) { + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.PLUS : + assignment.setOperator(Assignment.Operator.PLUS_ASSIGN); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.MINUS : + assignment.setOperator(Assignment.Operator.MINUS_ASSIGN); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.MULTIPLY : + assignment.setOperator(Assignment.Operator.TIMES_ASSIGN); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.DIVIDE : + assignment.setOperator(Assignment.Operator.DIVIDE_ASSIGN); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.AND : + assignment.setOperator(Assignment.Operator.BIT_AND_ASSIGN); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.OR : + assignment.setOperator(Assignment.Operator.BIT_OR_ASSIGN); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.XOR : + assignment.setOperator(Assignment.Operator.BIT_XOR_ASSIGN); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.REMAINDER : + assignment.setOperator(Assignment.Operator.REMAINDER_ASSIGN); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.LEFT_SHIFT : + assignment.setOperator(Assignment.Operator.LEFT_SHIFT_ASSIGN); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.RIGHT_SHIFT : + assignment.setOperator(Assignment.Operator.RIGHT_SHIFT_SIGNED_ASSIGN); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.UNSIGNED_RIGHT_SHIFT : + assignment.setOperator(Assignment.Operator.RIGHT_SHIFT_UNSIGNED_ASSIGN); + break; + } + assignment.setRightHandSide(convert(expression.expression)); + if (this.resolveBindings) { + recordNodes(assignment, expression); + } + return assignment; + } + + public ConditionalExpression convert(org.eclipse.wst.jsdt.internal.compiler.ast.ConditionalExpression expression) { + ConditionalExpression conditionalExpression = new ConditionalExpression(this.ast); + if (this.resolveBindings) { + recordNodes(conditionalExpression, expression); + } + conditionalExpression.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); + conditionalExpression.setExpression(convert(expression.condition)); + conditionalExpression.setThenExpression(convert(expression.valueIfTrue)); + conditionalExpression.setElseExpression(convert(expression.valueIfFalse)); + return conditionalExpression; + } + + public ContinueStatement convert(org.eclipse.wst.jsdt.internal.compiler.ast.ContinueStatement statement) { + ContinueStatement continueStatement = new ContinueStatement(this.ast); + continueStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); + if (statement.label != null) { + final SimpleName name = new SimpleName(this.ast); + name.internalSetIdentifier(new String(statement.label)); + retrieveIdentifierAndSetPositions(statement.sourceStart, statement.sourceEnd, name); + continueStatement.setLabel(name); + } + return continueStatement; + } + + public DoStatement convert(org.eclipse.wst.jsdt.internal.compiler.ast.DoStatement statement) { + DoStatement doStatement = new DoStatement(this.ast); + doStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); + doStatement.setExpression(convert(statement.condition)); + final Statement action = convert(statement.action); + if (action == null) return null; + doStatement.setBody(action); + return doStatement; + } + + public NumberLiteral convert(org.eclipse.wst.jsdt.internal.compiler.ast.DoubleLiteral expression) { + int length = expression.sourceEnd - expression.sourceStart + 1; + int sourceStart = expression.sourceStart; + NumberLiteral literal = new NumberLiteral(this.ast); + literal.internalSetToken(new String(this.compilationUnitSource, sourceStart, length)); + if (this.resolveBindings) { + this.recordNodes(literal, expression); + } + literal.setSourceRange(sourceStart, length); + removeLeadingAndTrailingCommentsFromLiteral(literal); + return literal; + } + + public EmptyStatement convert(org.eclipse.wst.jsdt.internal.compiler.ast.EmptyStatement statement) { + EmptyStatement emptyStatement = new EmptyStatement(this.ast); + emptyStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); + return emptyStatement; + } + + + public EmptyExpression convert(org.eclipse.wst.jsdt.internal.compiler.ast.EmptyExpression expression) { + EmptyExpression emptyExpression = new EmptyExpression(this.ast); + emptyExpression.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); + return emptyExpression; + } + + + public Expression convert(org.eclipse.wst.jsdt.internal.compiler.ast.EqualExpression expression) { + InfixExpression infixExpression = new InfixExpression(this.ast); + if (this.resolveBindings) { + recordNodes(infixExpression, expression); + } + Expression leftExpression = convert(expression.left); + infixExpression.setLeftOperand(leftExpression); + infixExpression.setRightOperand(convert(expression.right)); + int startPosition = leftExpression.getStartPosition(); + infixExpression.setSourceRange(startPosition, expression.sourceEnd - startPosition + 1); + switch ((expression.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorMASK) >> org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorSHIFT) { + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.EQUAL_EQUAL : + infixExpression.setOperator(InfixExpression.Operator.EQUALS); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.NOT_EQUAL : + infixExpression.setOperator(InfixExpression.Operator.NOT_EQUALS); + } + return infixExpression; + + } + + public Statement convert(org.eclipse.wst.jsdt.internal.compiler.ast.ExplicitConstructorCall statement) { + Statement newStatement; + int sourceStart = statement.sourceStart; + if (statement.isSuperAccess() || statement.isSuper()) { + SuperConstructorInvocation superConstructorInvocation = new SuperConstructorInvocation(this.ast); + if (statement.qualification != null) { + superConstructorInvocation.setExpression(convert(statement.qualification)); + } + org.eclipse.wst.jsdt.internal.compiler.ast.Expression[] arguments = statement.arguments; + if (arguments != null) { + int length = arguments.length; + for (int i = 0; i < length; i++) { + superConstructorInvocation.arguments().add(convert(arguments[i])); + } + } + if (statement.typeArguments != null) { + if (sourceStart > statement.typeArgumentsSourceStart) { + sourceStart = statement.typeArgumentsSourceStart; + } + switch(this.ast.apiLevel) { + case AST.JLS2_INTERNAL : + superConstructorInvocation.setFlags(superConstructorInvocation.getFlags() | ASTNode.MALFORMED); + break; + case AST.JLS3 : + for (int i = 0, max = statement.typeArguments.length; i < max; i++) { + superConstructorInvocation.typeArguments().add(convertType(statement.typeArguments[i])); + } + break; + } + } + newStatement = superConstructorInvocation; + } else { + ConstructorInvocation constructorInvocation = new ConstructorInvocation(this.ast); + org.eclipse.wst.jsdt.internal.compiler.ast.Expression[] arguments = statement.arguments; + if (arguments != null) { + int length = arguments.length; + for (int i = 0; i < length; i++) { + constructorInvocation.arguments().add(convert(arguments[i])); + } + } + if (statement.typeArguments != null) { + if (sourceStart > statement.typeArgumentsSourceStart) { + sourceStart = statement.typeArgumentsSourceStart; + } + switch(this.ast.apiLevel) { + case AST.JLS2_INTERNAL : + constructorInvocation.setFlags(constructorInvocation.getFlags() | ASTNode.MALFORMED); + break; + case AST.JLS3 : + for (int i = 0, max = statement.typeArguments.length; i < max; i++) { + constructorInvocation.typeArguments().add(convertType(statement.typeArguments[i])); + } + break; + } + } + if (statement.qualification != null) { + // this is an error + constructorInvocation.setFlags(constructorInvocation.getFlags() | ASTNode.MALFORMED); + } + newStatement = constructorInvocation; + } + newStatement.setSourceRange(sourceStart, statement.sourceEnd - sourceStart + 1); + if (this.resolveBindings) { + recordNodes(newStatement, statement); + } + return newStatement; + } + + public Expression convert(org.eclipse.wst.jsdt.internal.compiler.ast.Expression expression) { + if (expression==null) + return null; + if ((expression.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.ParenthesizedMASK) != 0) { + return convertToParenthesizedExpression(expression); + } + // switch between all types of expression + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.ArrayAllocationExpression) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.ArrayAllocationExpression) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.QualifiedAllocationExpression) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.QualifiedAllocationExpression) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.AllocationExpression) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.AllocationExpression) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.ArrayInitializer) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.ArrayInitializer) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.PrefixExpression) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.PrefixExpression) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.PostfixExpression) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.PostfixExpression) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.CompoundAssignment) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.CompoundAssignment) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.Assignment) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.Assignment) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.ClassLiteralAccess) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.ClassLiteralAccess) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.FalseLiteral) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.FalseLiteral) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.TrueLiteral) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.TrueLiteral) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.NullLiteral) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.NullLiteral) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.DoubleLiteral) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.DoubleLiteral) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.IntLiteralMinValue) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.IntLiteralMinValue) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.IntLiteral) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.IntLiteral) expression); + } + if (expression instanceof StringLiteralConcatenation) { + return convert((StringLiteralConcatenation) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.ExtendedStringLiteral) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.ExtendedStringLiteral) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.StringLiteral) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.StringLiteral) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.AND_AND_Expression) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.AND_AND_Expression) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.OR_OR_Expression) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.OR_OR_Expression) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.EqualExpression) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.EqualExpression) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.InstanceOfExpression) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.InstanceOfExpression) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.UnaryExpression) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.UnaryExpression) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.ConditionalExpression) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.ConditionalExpression) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.Reference) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.Reference) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.TypeReference) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.TypeReference) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.FunctionExpression) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.FunctionExpression) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.ObjectLiteral) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.ObjectLiteral) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.ObjectLiteralField) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.ObjectLiteralField) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.UndefinedLiteral) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.UndefinedLiteral) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.RegExLiteral) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.RegExLiteral) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.ListExpression) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.ListExpression) expression); + } + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.EmptyExpression) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.EmptyExpression) expression); + } + return null; + } + + public StringLiteral convert(org.eclipse.wst.jsdt.internal.compiler.ast.ExtendedStringLiteral expression) { + expression.computeConstant(); + StringLiteral literal = new StringLiteral(this.ast); + if (this.resolveBindings) { + this.recordNodes(literal, expression); + } + literal.setLiteralValue(expression.constant.stringValue()); + literal.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); + return literal; + } + + public BooleanLiteral convert(org.eclipse.wst.jsdt.internal.compiler.ast.FalseLiteral expression) { + final BooleanLiteral literal = new BooleanLiteral(this.ast); + literal.setBooleanValue(false); + if (this.resolveBindings) { + this.recordNodes(literal, expression); + } + literal.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); + return literal; + } + + public Expression convert(org.eclipse.wst.jsdt.internal.compiler.ast.FieldReference reference) { + if (reference.receiver.isSuper()) { + final SuperFieldAccess superFieldAccess = new SuperFieldAccess(this.ast); + if (this.resolveBindings) { + recordNodes(superFieldAccess, reference); + } + final SimpleName simpleName = new SimpleName(this.ast); + simpleName.internalSetIdentifier(new String(reference.token)); + int sourceStart = (int)(reference.nameSourcePosition>>>32); + int length = (int)(reference.nameSourcePosition & 0xFFFFFFFF) - sourceStart + 1; + simpleName.setSourceRange(sourceStart, length); + superFieldAccess.setName(simpleName); + if (this.resolveBindings) { + recordNodes(simpleName, reference); + } + superFieldAccess.setSourceRange(reference.receiver.sourceStart, reference.sourceEnd - reference.receiver.sourceStart + 1); + return superFieldAccess; + } else { + final FieldAccess fieldAccess = new FieldAccess(this.ast); + if (this.resolveBindings) { + recordNodes(fieldAccess, reference); + } + Expression receiver = convert(reference.receiver); + fieldAccess.setExpression(receiver); + final SimpleName simpleName = new SimpleName(this.ast); + simpleName.internalSetIdentifier(new String(reference.token)); + int sourceStart = (int)(reference.nameSourcePosition>>>32); + int length = (int)(reference.nameSourcePosition & 0xFFFFFFFF) - sourceStart + 1; + simpleName.setSourceRange(sourceStart, length); + fieldAccess.setName(simpleName); + if (this.resolveBindings) { + recordNodes(simpleName, reference); + } + fieldAccess.setSourceRange(receiver.getStartPosition(), reference.sourceEnd - receiver.getStartPosition() + 1); + return fieldAccess; + } + } + + public Statement convert(ForeachStatement statement) { + switch(this.ast.apiLevel) { + case AST.JLS2_INTERNAL : + return createFakeEmptyStatement(statement); + case AST.JLS3 : + EnhancedForStatement enhancedForStatement = new EnhancedForStatement(this.ast); + enhancedForStatement.setParameter(convertToSingleVariableDeclaration(statement.elementVariable)); + org.eclipse.wst.jsdt.internal.compiler.ast.Expression collection = statement.collection; + if (collection == null) return null; enhancedForStatement.setExpression(convert(collection)); + final Statement action = convert(statement.action); + if (action == null) return null; + enhancedForStatement.setBody(action); + int start = statement.sourceStart; + int end = statement.sourceEnd; + enhancedForStatement.setSourceRange(start, end - start + 1); + return enhancedForStatement; + default: + return createFakeEmptyStatement(statement); + } + } + + public ForStatement convert(org.eclipse.wst.jsdt.internal.compiler.ast.ForStatement statement) { + ForStatement forStatement = new ForStatement(this.ast); + forStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); + org.eclipse.wst.jsdt.internal.compiler.ast.Statement[] initializations = statement.initializations; + if (initializations != null) { + // we know that we have at least one initialization + if (initializations[0] instanceof org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration) { + VariableDeclarationExpression variableDeclarationExpression = convertToVariableDeclarationExpression((org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration) initializations[0]); + int initializationsLength = initializations.length; + for (int i = 1; i < initializationsLength; i++) { + variableDeclarationExpression.fragments().add(convertToVariableDeclarationFragment((org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration)initializations[i])); + } + if (initializationsLength != 1) { + int start = variableDeclarationExpression.getStartPosition(); + int end = ((org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration) initializations[initializationsLength - 1]).declarationSourceEnd; + variableDeclarationExpression.setSourceRange(start, end - start + 1); + } + forStatement.initializers().add(variableDeclarationExpression); + } else { + int initializationsLength = initializations.length; + for (int i = 0; i < initializationsLength; i++) { + Expression initializer = convertToExpression(initializations[i]); + if (initializer != null) { + forStatement.initializers().add(initializer); + } else { + forStatement.setFlags(forStatement.getFlags() | ASTNode.MALFORMED); + } + } + } + } + if (statement.condition != null) { + forStatement.setExpression(convert(statement.condition)); + } + org.eclipse.wst.jsdt.internal.compiler.ast.Statement[] increments = statement.increments; + if (increments != null) { + int incrementsLength = increments.length; + for (int i = 0; i < incrementsLength; i++) { + forStatement.updaters().add(convertToExpression(increments[i])); + } + } + final Statement action = convert(statement.action); + if (action == null) return null; + forStatement.setBody(action); + return forStatement; + } + + + public ForInStatement convert(org.eclipse.wst.jsdt.internal.compiler.ast.ForInStatement statement) { + ForInStatement forInStatement = new ForInStatement(this.ast); + forInStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); + + Statement iterationVariable = convert(statement.iterationVariable); + forInStatement.setIterationVariable(iterationVariable); + + Expression collection = convert(statement.collection); + forInStatement.setCollection(collection); + + final Statement action = convert(statement.action); + if (action == null) return null; + forInStatement.setBody(action); + return forInStatement; + } + public IfStatement convert(org.eclipse.wst.jsdt.internal.compiler.ast.IfStatement statement) { + IfStatement ifStatement = new IfStatement(this.ast); + ifStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); + ifStatement.setExpression(convert(statement.condition)); + final Statement thenStatement = convert(statement.thenStatement); + if (thenStatement == null) return null; + ifStatement.setThenStatement(thenStatement); + org.eclipse.wst.jsdt.internal.compiler.ast.Statement statement2 = statement.elseStatement; + if (statement2 != null) { + final Statement elseStatement = convert(statement2); + if (elseStatement != null) { + ifStatement.setElseStatement(elseStatement); + } + } + return ifStatement; + } + + public InstanceofExpression convert(org.eclipse.wst.jsdt.internal.compiler.ast.InstanceOfExpression expression) { + InstanceofExpression instanceOfExpression = new InstanceofExpression(this.ast); + if (this.resolveBindings) { + recordNodes(instanceOfExpression, expression); + } + Expression leftExpression = convert(expression.expression); + instanceOfExpression.setLeftOperand(leftExpression); + final Type convertType = convertType(expression.type); + instanceOfExpression.setRightOperand(convertType); + int startPosition = leftExpression.getStartPosition(); + int sourceEnd = convertType.getStartPosition() + convertType.getLength() - 1; + instanceOfExpression.setSourceRange(startPosition, sourceEnd - startPosition + 1); + return instanceOfExpression; + } + + public NumberLiteral convert(org.eclipse.wst.jsdt.internal.compiler.ast.IntLiteral expression) { + int length = expression.sourceEnd - expression.sourceStart + 1; + int sourceStart = expression.sourceStart; + final NumberLiteral literal = new NumberLiteral(this.ast); + literal.internalSetToken(new String(this.compilationUnitSource, sourceStart, length)); + if (this.resolveBindings) { + this.recordNodes(literal, expression); + } + literal.setSourceRange(sourceStart, length); + removeLeadingAndTrailingCommentsFromLiteral(literal); + return literal; + } + + public NumberLiteral convert(org.eclipse.wst.jsdt.internal.compiler.ast.IntLiteralMinValue expression) { + int length = expression.sourceEnd - expression.sourceStart + 1; + int sourceStart = expression.sourceStart; + NumberLiteral literal = new NumberLiteral(this.ast); + literal.internalSetToken(new String(this.compilationUnitSource, sourceStart, length)); + if (this.resolveBindings) { + this.recordNodes(literal, expression); + } + literal.setSourceRange(sourceStart, length); + removeLeadingAndTrailingCommentsFromLiteral(literal); + return literal; + } + + public void convert(org.eclipse.wst.jsdt.internal.compiler.ast.Javadoc javadoc, BodyDeclaration bodyDeclaration) { + if (bodyDeclaration.getJavadoc() == null) { + if (javadoc != null) { + if (this.commentMapper == null || !this.commentMapper.hasSameTable(this.commentsTable)) { + this.commentMapper = new DefaultCommentMapper(this.commentsTable); + } + Comment comment = this.commentMapper.getComment(javadoc.sourceStart); + if (comment != null && comment.isDocComment() && comment.getParent() == null) { + JSdoc docComment = (JSdoc) comment; + if (this.resolveBindings) { + recordNodes(docComment, javadoc); + // resolve member and method references binding + Iterator tags = docComment.tags().listIterator(); + while (tags.hasNext()) { + recordNodes(javadoc, (TagElement) tags.next()); + } + } + bodyDeclaration.setJavadoc(docComment); + } + } + } + } + + public void convert(org.eclipse.wst.jsdt.internal.compiler.ast.Javadoc javadoc, VariableDeclarationStatement variable) { + if (variable.getJavadoc() == null) { + if (javadoc != null) { + if (this.commentMapper == null || !this.commentMapper.hasSameTable(this.commentsTable)) { + this.commentMapper = new DefaultCommentMapper(this.commentsTable); + } + Comment comment = this.commentMapper.getComment(javadoc.sourceStart); + if (comment != null && comment.isDocComment() && comment.getParent() == null) { + JSdoc docComment = (JSdoc) comment; + if (this.resolveBindings) { + recordNodes(docComment, javadoc); + // resolve member and method references binding + Iterator tags = docComment.tags().listIterator(); + while (tags.hasNext()) { + recordNodes(javadoc, (TagElement) tags.next()); + } + } + variable.setJavadoc(docComment); + } + } + } + } + + public void convert(org.eclipse.wst.jsdt.internal.compiler.ast.Javadoc javadoc, PackageDeclaration packageDeclaration) { + if (ast.apiLevel == AST.JLS3 && packageDeclaration.getJavadoc() == null) { + if (javadoc != null) { + if (this.commentMapper == null || !this.commentMapper.hasSameTable(this.commentsTable)) { + this.commentMapper = new DefaultCommentMapper(this.commentsTable); + } + Comment comment = this.commentMapper.getComment(javadoc.sourceStart); + if (comment != null && comment.isDocComment() && comment.getParent() == null) { + JSdoc docComment = (JSdoc) comment; + if (this.resolveBindings) { + recordNodes(docComment, javadoc); + // resolve member and method references binding + Iterator tags = docComment.tags().listIterator(); + while (tags.hasNext()) { + recordNodes(javadoc, (TagElement) tags.next()); + } + } + packageDeclaration.setJavadoc(docComment); + } + } + } + } + + public LabeledStatement convert(org.eclipse.wst.jsdt.internal.compiler.ast.LabeledStatement statement) { + LabeledStatement labeledStatement = new LabeledStatement(this.ast); + final int sourceStart = statement.sourceStart; + labeledStatement.setSourceRange(sourceStart, statement.sourceEnd - sourceStart + 1); + Statement body = convert(statement.statement); + if (body == null) return null; + labeledStatement.setBody(body); + final SimpleName name = new SimpleName(this.ast); + name.internalSetIdentifier(new String(statement.label)); + name.setSourceRange(sourceStart, statement.labelEnd - sourceStart + 1); + labeledStatement.setLabel(name); + return labeledStatement; + } + + public ListExpression convert(org.eclipse.wst.jsdt.internal.compiler.ast.ListExpression expression) { + ListExpression listExpression = new ListExpression(this.ast); + if (this.resolveBindings) { + recordNodes(listExpression, expression); + } + listExpression.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); + org.eclipse.wst.jsdt.internal.compiler.ast.Expression[] expressions = expression.expressions; + if (expressions != null) { + int length = expressions.length; + for (int i = 0; i < length; i++) { + Expression expr = convert(expressions[i]); + if (this.resolveBindings) { + recordNodes(expr, expressions[i]); + } + listExpression.expressions().add(expr); + } + } + return listExpression; + } + + public Expression convert(MessageSend expression) { + // will return a FunctionInvocation or a SuperMethodInvocation or + Expression expr; + int sourceStart = expression.sourceStart; + if (expression.isSuperAccess()) { + // returns a SuperMethodInvocation + final SuperMethodInvocation superMethodInvocation = new SuperMethodInvocation(this.ast); + if (this.resolveBindings) { + recordNodes(superMethodInvocation, expression); + } + final SimpleName name = new SimpleName(this.ast); + name.internalSetIdentifier(new String(expression.selector)); + int nameSourceStart = (int) (expression.nameSourcePosition >>> 32); + int nameSourceLength = ((int) expression.nameSourcePosition) - nameSourceStart + 1; + name.setSourceRange(nameSourceStart, nameSourceLength); + if (this.resolveBindings) { + recordNodes(name, expression); + } + superMethodInvocation.setName(name); + + org.eclipse.wst.jsdt.internal.compiler.ast.Expression[] arguments = expression.arguments; + if (arguments != null) { + int argumentsLength = arguments.length; + for (int i = 0; i < argumentsLength; i++) { + Expression expri = convert(arguments[i]); + if (this.resolveBindings) { + recordNodes(expri, arguments[i]); + } + superMethodInvocation.arguments().add(expri); + } + } + expr = superMethodInvocation; + } else { + // returns a FunctionInvocation + final FunctionInvocation methodInvocation = new FunctionInvocation(this.ast); + if (this.resolveBindings) { + recordNodes(methodInvocation, expression); + } + if (expression.selector!=null) + { + final SimpleName name = new SimpleName(this.ast); + name.internalSetIdentifier(new String(expression.selector)); + int nameSourceStart = (int) (expression.nameSourcePosition >>> 32); + int nameSourceLength = ((int) expression.nameSourcePosition) - nameSourceStart + 1; + name.setSourceRange(nameSourceStart, nameSourceLength); + methodInvocation.setName(name); + if (this.resolveBindings) { + recordNodes(name, expression); + } + + } + org.eclipse.wst.jsdt.internal.compiler.ast.Expression[] arguments = expression.arguments; + if (arguments != null) { + int argumentsLength = arguments.length; + for (int i = 0; i < argumentsLength; i++) { + Expression expri = convert(arguments[i]); + if (this.resolveBindings) { + recordNodes(expri, arguments[i]); + } + methodInvocation.arguments().add(expri); + } + } + Expression qualifier = null; + org.eclipse.wst.jsdt.internal.compiler.ast.Expression receiver = expression.receiver; + if (receiver instanceof MessageSend) { + if ((receiver.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.ParenthesizedMASK) != 0) { + qualifier = convertToParenthesizedExpression(receiver); + } else { + qualifier = convert((MessageSend) receiver); + } + } else { + qualifier = convert(receiver); + } + if (qualifier instanceof Name && this.resolveBindings) { + recordNodes(qualifier, receiver); + } + methodInvocation.setExpression(qualifier); + if (qualifier != null) { + sourceStart = qualifier.getStartPosition(); + } + expr = methodInvocation; + } + expr.setSourceRange(sourceStart, expression.sourceEnd - sourceStart + 1); + removeTrailingCommentFromExpressionEndingWithAParen(expr); + return expr; + } + + + public Name convert(org.eclipse.wst.jsdt.internal.compiler.ast.NameReference reference) { + if (reference instanceof org.eclipse.wst.jsdt.internal.compiler.ast.QualifiedNameReference) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.QualifiedNameReference) reference); + } else { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.SingleNameReference) reference); + } + } + + public InfixExpression convert(StringLiteralConcatenation expression) { + expression.computeConstant(); + final InfixExpression infixExpression = new InfixExpression(this.ast); + infixExpression.setOperator(InfixExpression.Operator.PLUS); + org.eclipse.wst.jsdt.internal.compiler.ast.Expression[] stringLiterals = expression.literals; + infixExpression.setLeftOperand(convert(stringLiterals[0])); + infixExpression.setRightOperand(convert(stringLiterals[1])); + for (int i = 2; i < expression.counter; i++) { + infixExpression.extendedOperands().add(convert(stringLiterals[i])); + } + if (this.resolveBindings) { + this.recordNodes(infixExpression, expression); + } + infixExpression.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); + return infixExpression; + } + + + public NullLiteral convert(org.eclipse.wst.jsdt.internal.compiler.ast.NullLiteral expression) { + final NullLiteral literal = new NullLiteral(this.ast); + if (this.resolveBindings) { + this.recordNodes(literal, expression); + } + literal.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); + return literal; + } + + public UndefinedLiteral convert(org.eclipse.wst.jsdt.internal.compiler.ast.UndefinedLiteral expression) { + final UndefinedLiteral literal = new UndefinedLiteral(this.ast); + if (this.resolveBindings) { + this.recordNodes(literal, expression); + } + literal.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); + return literal; + } + + public Expression convert(org.eclipse.wst.jsdt.internal.compiler.ast.OR_OR_Expression expression) { + InfixExpression infixExpression = new InfixExpression(this.ast); + infixExpression.setOperator(InfixExpression.Operator.CONDITIONAL_OR); + if (this.resolveBindings) { + this.recordNodes(infixExpression, expression); + } + final int expressionOperatorID = (expression.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorMASK) >> org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorSHIFT; + if (expression.left instanceof org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression + && ((expression.left.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.ParenthesizedMASK) == 0)) { + // create an extended string literal equivalent => use the extended operands list + infixExpression.extendedOperands().add(convert(expression.right)); + org.eclipse.wst.jsdt.internal.compiler.ast.Expression leftOperand = expression.left; + org.eclipse.wst.jsdt.internal.compiler.ast.Expression rightOperand = null; + do { + rightOperand = ((org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression) leftOperand).right; + if ((((leftOperand.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorMASK) >> org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorSHIFT) != expressionOperatorID + && ((leftOperand.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.ParenthesizedMASK) == 0)) + || ((rightOperand instanceof org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression + && ((rightOperand.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorMASK) >> org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorSHIFT) != expressionOperatorID) + && ((rightOperand.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.ParenthesizedMASK) == 0))) { + List extendedOperands = infixExpression.extendedOperands(); + InfixExpression temp = new InfixExpression(this.ast); + if (this.resolveBindings) { + this.recordNodes(temp, expression); + } + temp.setOperator(getOperatorFor(expressionOperatorID)); + Expression leftSide = convert(leftOperand); + temp.setLeftOperand(leftSide); + temp.setSourceRange(leftSide.getStartPosition(), leftSide.getLength()); + int size = extendedOperands.size(); + for (int i = 0; i < size - 1; i++) { + Expression expr = temp; + temp = new InfixExpression(this.ast); + + if (this.resolveBindings) { + this.recordNodes(temp, expression); + } + temp.setLeftOperand(expr); + temp.setOperator(getOperatorFor(expressionOperatorID)); + temp.setSourceRange(expr.getStartPosition(), expr.getLength()); + } + infixExpression = temp; + for (int i = 0; i < size; i++) { + Expression extendedOperand = (Expression) extendedOperands.remove(size - 1 - i); + temp.setRightOperand(extendedOperand); + int startPosition = temp.getLeftOperand().getStartPosition(); + temp.setSourceRange(startPosition, extendedOperand.getStartPosition() + extendedOperand.getLength() - startPosition); + if (temp.getLeftOperand().getNodeType() == ASTNode.INFIX_EXPRESSION) { + temp = (InfixExpression) temp.getLeftOperand(); + } + } + int startPosition = infixExpression.getLeftOperand().getStartPosition(); + infixExpression.setSourceRange(startPosition, expression.sourceEnd - startPosition + 1); + if (this.resolveBindings) { + this.recordNodes(infixExpression, expression); + } + return infixExpression; + } + infixExpression.extendedOperands().add(0, convert(rightOperand)); + leftOperand = ((org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression) leftOperand).left; + } while (leftOperand instanceof org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression && ((leftOperand.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.ParenthesizedMASK) == 0)); + Expression leftExpression = convert(leftOperand); + infixExpression.setLeftOperand(leftExpression); + infixExpression.setRightOperand((Expression)infixExpression.extendedOperands().remove(0)); + int startPosition = leftExpression.getStartPosition(); + infixExpression.setSourceRange(startPosition, expression.sourceEnd - startPosition + 1); + return infixExpression; + } + Expression leftExpression = convert(expression.left); + infixExpression.setLeftOperand(leftExpression); + infixExpression.setRightOperand(convert(expression.right)); + infixExpression.setOperator(InfixExpression.Operator.CONDITIONAL_OR); + int startPosition = leftExpression.getStartPosition(); + infixExpression.setSourceRange(startPosition, expression.sourceEnd - startPosition + 1); + return infixExpression; + } + + public PostfixExpression convert(org.eclipse.wst.jsdt.internal.compiler.ast.PostfixExpression expression) { + final PostfixExpression postfixExpression = new PostfixExpression(this.ast); + if (this.resolveBindings) { + recordNodes(postfixExpression, expression); + } + postfixExpression.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); + postfixExpression.setOperand(convert(expression.lhs)); + switch (expression.operator) { + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.PLUS : + postfixExpression.setOperator(PostfixExpression.Operator.INCREMENT); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.MINUS : + postfixExpression.setOperator(PostfixExpression.Operator.DECREMENT); + break; + } + return postfixExpression; + } + + public PrefixExpression convert(org.eclipse.wst.jsdt.internal.compiler.ast.PrefixExpression expression) { + final PrefixExpression prefixExpression = new PrefixExpression(this.ast); + if (this.resolveBindings) { + recordNodes(prefixExpression, expression); + } + prefixExpression.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); + prefixExpression.setOperand(convert(expression.lhs)); + switch (expression.operator) { + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.PLUS : + prefixExpression.setOperator(PrefixExpression.Operator.INCREMENT); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.MINUS : + prefixExpression.setOperator(PrefixExpression.Operator.DECREMENT); + break; + } + return prefixExpression; + } + + public Expression convert(org.eclipse.wst.jsdt.internal.compiler.ast.QualifiedAllocationExpression allocation) { + final ClassInstanceCreation classInstanceCreation = new ClassInstanceCreation(this.ast); + if (allocation.enclosingInstance != null) { + classInstanceCreation.setExpression(convert(allocation.enclosingInstance)); + } + if (allocation.member != null) { + classInstanceCreation.setMember(convert(allocation.member)); + } + if (allocation.type!=null) + { + switch(this.ast.apiLevel) { + case AST.JLS2_INTERNAL : + classInstanceCreation.internalSetName(convert(allocation.type)); + break; + case AST.JLS3 : + classInstanceCreation.setType(convertType(allocation.type)); + } + } + org.eclipse.wst.jsdt.internal.compiler.ast.Expression[] arguments = allocation.arguments; + if (arguments != null) { + int length = arguments.length; + for (int i = 0; i < length; i++) { + Expression argument = convert(arguments[i]); + if (this.resolveBindings) { + recordNodes(argument, arguments[i]); + } + classInstanceCreation.arguments().add(argument); + } + } + if (allocation.anonymousType != null) { + int declarationSourceStart = allocation.sourceStart; + classInstanceCreation.setSourceRange(declarationSourceStart, allocation.anonymousType.bodyEnd - declarationSourceStart + 1); + final AnonymousClassDeclaration anonymousClassDeclaration = new AnonymousClassDeclaration(this.ast); + int start = retrieveStartBlockPosition(allocation.anonymousType.sourceEnd, allocation.anonymousType.bodyEnd); + anonymousClassDeclaration.setSourceRange(start, allocation.anonymousType.bodyEnd - start + 1); + classInstanceCreation.setAnonymousClassDeclaration(anonymousClassDeclaration); + buildBodyDeclarations(allocation.anonymousType, anonymousClassDeclaration); + if (this.resolveBindings) { + recordNodes(classInstanceCreation, allocation.anonymousType); + recordNodes(anonymousClassDeclaration, allocation.anonymousType); + anonymousClassDeclaration.resolveBinding(); + } + return classInstanceCreation; + } else { + final int start = allocation.sourceStart; + classInstanceCreation.setSourceRange(start, allocation.sourceEnd - start + 1); + if (this.resolveBindings) { + recordNodes(classInstanceCreation, allocation); + } + removeTrailingCommentFromExpressionEndingWithAParen(classInstanceCreation); + return classInstanceCreation; + } + } + + public Name convert(org.eclipse.wst.jsdt.internal.compiler.ast.QualifiedNameReference nameReference) { + return setQualifiedNameNameAndSourceRanges(nameReference.tokens, nameReference.sourcePositions, nameReference); + } + + public ThisExpression convert(org.eclipse.wst.jsdt.internal.compiler.ast.QualifiedThisReference reference) { + final ThisExpression thisExpression = new ThisExpression(this.ast); + thisExpression.setSourceRange(reference.sourceStart, reference.sourceEnd - reference.sourceStart + 1); + thisExpression.setQualifier(convert(reference.qualification)); + if (this.resolveBindings) { + recordNodes(thisExpression, reference); + recordPendingThisExpressionScopeResolution(thisExpression); + } + return thisExpression; + } + + public Expression convert(org.eclipse.wst.jsdt.internal.compiler.ast.Reference reference) { + if (reference instanceof org.eclipse.wst.jsdt.internal.compiler.ast.NameReference) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.NameReference) reference); + } + if (reference instanceof org.eclipse.wst.jsdt.internal.compiler.ast.ThisReference) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.ThisReference) reference); + } + if (reference instanceof org.eclipse.wst.jsdt.internal.compiler.ast.ArrayReference) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.ArrayReference) reference); + } + if (reference instanceof org.eclipse.wst.jsdt.internal.compiler.ast.FieldReference) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.FieldReference) reference); + } + return null; // cannot be reached + } + + public ReturnStatement convert(org.eclipse.wst.jsdt.internal.compiler.ast.ReturnStatement statement) { + final ReturnStatement returnStatement = new ReturnStatement(this.ast); + returnStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); + if (statement.expression != null) { + returnStatement.setExpression(convert(statement.expression)); + } + return returnStatement; + } + + public SimpleName convert(org.eclipse.wst.jsdt.internal.compiler.ast.SingleNameReference nameReference) { + final SimpleName name = new SimpleName(this.ast); + name.internalSetIdentifier(new String(nameReference.token)); + if (this.resolveBindings) { + recordNodes(name, nameReference); + } + name.setSourceRange(nameReference.sourceStart, nameReference.sourceEnd - nameReference.sourceStart + 1); + return name; + } + + public Statement convert(org.eclipse.wst.jsdt.internal.compiler.ast.Statement statement) { + if (statement instanceof ForeachStatement) { + return convert((ForeachStatement) statement); + } + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration) { + return convertToVariableDeclarationStatement((org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration)statement); + } + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.Block) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.Block) statement); + } + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.BreakStatement) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.BreakStatement) statement); + } + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.ContinueStatement) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.ContinueStatement) statement); + } + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.CaseStatement) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.CaseStatement) statement); + } + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.DoStatement) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.DoStatement) statement); + } + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.EmptyStatement) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.EmptyStatement) statement); + } + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.ExplicitConstructorCall) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.ExplicitConstructorCall) statement); + } + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.ForStatement) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.ForStatement) statement); + } + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.ForInStatement) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.ForInStatement) statement); + } + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.IfStatement) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.IfStatement) statement); + } + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.LabeledStatement) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.LabeledStatement) statement); + } + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.ReturnStatement) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.ReturnStatement) statement); + } + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.SwitchStatement) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.SwitchStatement) statement); + } + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.ThrowStatement) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.ThrowStatement) statement); + } + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.TryStatement) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.TryStatement) statement); + } + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration) { + ASTNode result = convert((org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration) statement); + if (result == null) { + return createFakeEmptyStatement(statement); + } + TypeDeclaration typeDeclaration = (TypeDeclaration) result; + TypeDeclarationStatement typeDeclarationStatement = new TypeDeclarationStatement(this.ast); + typeDeclarationStatement.setDeclaration(typeDeclaration); + switch(this.ast.apiLevel) { + case AST.JLS2_INTERNAL : + TypeDeclaration typeDecl = typeDeclarationStatement.internalGetTypeDeclaration(); + typeDeclarationStatement.setSourceRange(typeDecl.getStartPosition(), typeDecl.getLength()); + break; + case AST.JLS3 : + AbstractTypeDeclaration typeDeclAST3 = typeDeclarationStatement.getDeclaration(); + typeDeclarationStatement.setSourceRange(typeDeclAST3.getStartPosition(), typeDeclAST3.getLength()); + break; + } + return typeDeclarationStatement; + + } + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.WhileStatement) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.WhileStatement) statement); + } + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.WithStatement) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.WithStatement) statement); + } + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.Expression) { + org.eclipse.wst.jsdt.internal.compiler.ast.Expression statement2 = (org.eclipse.wst.jsdt.internal.compiler.ast.Expression) statement; + final Expression expr = convert( statement2); + final ExpressionStatement stmt = new ExpressionStatement(this.ast); + stmt.setExpression(expr); + int sourceStart = expr.getStartPosition(); + int sourceEnd = statement2.statementEnd; + if (sourceEnd==-1) + sourceEnd=statement2.sourceEnd; + stmt.setSourceRange(sourceStart, sourceEnd - sourceStart + 1); + return stmt; + } + return createFakeEmptyStatement(statement); + } + + public Expression convert(org.eclipse.wst.jsdt.internal.compiler.ast.StringLiteral expression) { + if (expression instanceof StringLiteralConcatenation) { + return convert((StringLiteralConcatenation) expression); + } + int length = expression.sourceEnd - expression.sourceStart + 1; + int sourceStart = expression.sourceStart; + StringLiteral literal = new StringLiteral(this.ast); + if (this.resolveBindings) { + this.recordNodes(literal, expression); + } + literal.internalSetEscapedValue(new String(this.compilationUnitSource, sourceStart, length)); + literal.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); + return literal; + } + + public SwitchStatement convert(org.eclipse.wst.jsdt.internal.compiler.ast.SwitchStatement statement) { + SwitchStatement switchStatement = new SwitchStatement(this.ast); + switchStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); + switchStatement.setExpression(convert(statement.expression)); + org.eclipse.wst.jsdt.internal.compiler.ast.Statement[] statements = statement.statements; + if (statements != null) { + int statementsLength = statements.length; + for (int i = 0; i < statementsLength; i++) { + if (statements[i] instanceof org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration) { + checkAndAddMultipleLocalDeclaration(statements, i, switchStatement.statements()); + } else { + final Statement currentStatement = convert(statements[i]); + if (currentStatement != null) { + switchStatement.statements().add(currentStatement); + } + } + } + } + return switchStatement; + } + + public Expression convert(org.eclipse.wst.jsdt.internal.compiler.ast.ThisReference reference) { + if (reference.isImplicitThis()) { + // There is no source associated with an implicit this + return null; + } else if (reference instanceof org.eclipse.wst.jsdt.internal.compiler.ast.QualifiedThisReference) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.QualifiedThisReference) reference); + } else { + ThisExpression thisExpression = new ThisExpression(this.ast); + thisExpression.setSourceRange(reference.sourceStart, reference.sourceEnd - reference.sourceStart + 1); + if (this.resolveBindings) { + recordNodes(thisExpression, reference); + recordPendingThisExpressionScopeResolution(thisExpression); + } + return thisExpression; + } + } + + public ThrowStatement convert(org.eclipse.wst.jsdt.internal.compiler.ast.ThrowStatement statement) { + final ThrowStatement throwStatement = new ThrowStatement(this.ast); + throwStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); + throwStatement.setExpression(convert(statement.exception)); + return throwStatement; + } + + public BooleanLiteral convert(org.eclipse.wst.jsdt.internal.compiler.ast.TrueLiteral expression) { + final BooleanLiteral literal = new BooleanLiteral(this.ast); + literal.setBooleanValue(true); + if (this.resolveBindings) { + this.recordNodes(literal, expression); + } + literal.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); + return literal; + } + + public TryStatement convert(org.eclipse.wst.jsdt.internal.compiler.ast.TryStatement statement) { + final TryStatement tryStatement = new TryStatement(this.ast); + tryStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); + + tryStatement.setBody(convert(statement.tryBlock)); + org.eclipse.wst.jsdt.internal.compiler.ast.Argument[] catchArguments = statement.catchArguments; + if (catchArguments != null) { + int catchArgumentsLength = catchArguments.length; + org.eclipse.wst.jsdt.internal.compiler.ast.Block[] catchBlocks = statement.catchBlocks; + int start = statement.tryBlock.sourceEnd; + for (int i = 0; i < catchArgumentsLength; i++) { + CatchClause catchClause = new CatchClause(this.ast); + int catchClauseSourceStart = retrieveStartingCatchPosition(start, catchArguments[i].sourceStart); + catchClause.setSourceRange(catchClauseSourceStart, catchBlocks[i].sourceEnd - catchClauseSourceStart + 1); + catchClause.setBody(convert(catchBlocks[i])); + catchClause.setException(convert(catchArguments[i])); + tryStatement.catchClauses().add(catchClause); + start = catchBlocks[i].sourceEnd; + } + } + if (statement.finallyBlock != null) { + tryStatement.setFinally(convert(statement.finallyBlock)); + } + return tryStatement; + } + + public ASTNode convert(org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration typeDeclaration) { + checkCanceled(); + TypeDeclaration typeDecl = new TypeDeclaration(this.ast); + if (typeDeclaration.modifiersSourceStart != -1) { + setModifiers(typeDecl, typeDeclaration); + } + final SimpleName typeName = new SimpleName(this.ast); + typeName.internalSetIdentifier(new String(typeDeclaration.name)); + typeName.setSourceRange(typeDeclaration.sourceStart, typeDeclaration.sourceEnd - typeDeclaration.sourceStart + 1); + typeDecl.setName(typeName); + typeDecl.setSourceRange(typeDeclaration.declarationSourceStart, typeDeclaration.bodyEnd - typeDeclaration.declarationSourceStart + 1); + + // need to set the superclass and super interfaces here since we cannot distinguish them at + // the type references level. + if (typeDeclaration.superclass != null) { + switch(this.ast.apiLevel) { + case AST.JLS2_INTERNAL : + typeDecl.internalSetSuperclass(convert(typeDeclaration.superclass)); + break; + case AST.JLS3 : + typeDecl.setSuperclassType(convertType(typeDeclaration.superclass)); + break; + } + } + + buildBodyDeclarations(typeDeclaration, typeDecl); + if (this.resolveBindings) { + recordNodes(typeDecl, typeDeclaration); + recordNodes(typeName, typeDeclaration); + typeDecl.resolveBinding(); + } + return typeDecl; + } + + public Name convert(org.eclipse.wst.jsdt.internal.compiler.ast.TypeReference typeReference) { + char[][] typeName = typeReference.getTypeName(); + int length = typeName.length; + if (length > 1) { + // QualifiedName + org.eclipse.wst.jsdt.internal.compiler.ast.QualifiedTypeReference qualifiedTypeReference = (org.eclipse.wst.jsdt.internal.compiler.ast.QualifiedTypeReference) typeReference; + final long[] positions = qualifiedTypeReference.sourcePositions; + return setQualifiedNameNameAndSourceRanges(typeName, positions, typeReference); + } else { + final SimpleName name = new SimpleName(this.ast); + name.internalSetIdentifier(new String(typeName[0])); + name.setSourceRange(typeReference.sourceStart, typeReference.sourceEnd - typeReference.sourceStart + 1); + name.index = 1; + if (this.resolveBindings) { + recordNodes(name, typeReference); + } + return name; + } + } + + public PrefixExpression convert(org.eclipse.wst.jsdt.internal.compiler.ast.UnaryExpression expression) { + final PrefixExpression prefixExpression = new PrefixExpression(this.ast); + if (this.resolveBindings) { + this.recordNodes(prefixExpression, expression); + } + prefixExpression.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); + prefixExpression.setOperand(convert(expression.expression)); + switch ((expression.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorMASK) >> org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OperatorSHIFT) { + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.PLUS : + prefixExpression.setOperator(PrefixExpression.Operator.PLUS); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.MINUS : + prefixExpression.setOperator(PrefixExpression.Operator.MINUS); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.NOT : + prefixExpression.setOperator(PrefixExpression.Operator.NOT); + break; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.TWIDDLE : + prefixExpression.setOperator(PrefixExpression.Operator.COMPLEMENT); + } + return prefixExpression; + } + + public WhileStatement convert(org.eclipse.wst.jsdt.internal.compiler.ast.WhileStatement statement) { + final WhileStatement whileStatement = new WhileStatement(this.ast); + whileStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); + whileStatement.setExpression(convert(statement.condition)); + final Statement action = convert(statement.action); + if (action == null) return null; + whileStatement.setBody(action); + return whileStatement; + } + + + public WithStatement convert(org.eclipse.wst.jsdt.internal.compiler.ast.WithStatement statement) { + final WithStatement withStatement = new WithStatement(this.ast); + withStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); + withStatement.setExpression(convert(statement.condition)); + final Statement action = convert(statement.action); + if (action == null) return null; + withStatement.setBody(action); + return withStatement; + } + + public ImportDeclaration convertImport(org.eclipse.wst.jsdt.internal.compiler.ast.ImportReference importReference) { + final ImportDeclaration importDeclaration = new ImportDeclaration(this.ast); + final boolean onDemand = (importReference.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.OnDemand) != 0; + final char[][] tokens = importReference.tokens; + int length = importReference.tokens.length; + final long[] positions = importReference.sourcePositions; + if (length > 1) { + importDeclaration.setName(setQualifiedNameNameAndSourceRanges(tokens, positions, importReference)); + } else if(length == 1) { + final SimpleName name = new SimpleName(this.ast); + name.internalSetIdentifier(new String(tokens[0])); + final int start = (int)(positions[0]>>>32); + final int end = (int)(positions[0] & 0xFFFFFFFF); + name.setSourceRange(start, end - start + 1); + name.index = 1; + importDeclaration.setName(name); + if (this.resolveBindings) { + recordNodes(name, importReference); + } + } + boolean isFile=(importReference.bits&org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.IsFileImport)!=0; + importDeclaration.setSourceRange(importReference.declarationSourceStart, importReference.declarationEnd - importReference.declarationSourceStart + 1); + importDeclaration.setOnDemand(onDemand && !isFile); + importDeclaration.setIsFileImport(isFile); + + if (this.resolveBindings) { + recordNodes(importDeclaration, importReference); + } + return importDeclaration; + } + + public PackageDeclaration convertPackage(org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration compilationUnitDeclaration) { + org.eclipse.wst.jsdt.internal.compiler.ast.ImportReference importReference = compilationUnitDeclaration.currentPackage; + final PackageDeclaration packageDeclaration = new PackageDeclaration(this.ast); + final char[][] tokens = importReference.tokens; + final int length = importReference.tokens.length; + long[] positions = importReference.sourcePositions; + if (length > 1) { + packageDeclaration.setName(setQualifiedNameNameAndSourceRanges(tokens, positions, importReference)); + } else { + final SimpleName name = new SimpleName(this.ast); + name.internalSetIdentifier(new String(tokens[0])); + int start = (int)(positions[0]>>>32); + int end = (int)(positions[length - 1] & 0xFFFFFFFF); + name.setSourceRange(start, end - start + 1); + name.index = 1; + packageDeclaration.setName(name); + if (this.resolveBindings) { + recordNodes(name, compilationUnitDeclaration); + } + } + packageDeclaration.setSourceRange(importReference.declarationSourceStart, importReference.declarationEnd - importReference.declarationSourceStart + 1); + + if (this.resolveBindings) { + recordNodes(packageDeclaration, importReference); + } + // Set javadoc + convert(compilationUnitDeclaration.javadoc, packageDeclaration); + return packageDeclaration; + } + + public Expression convertToExpression(org.eclipse.wst.jsdt.internal.compiler.ast.Statement statement) { + if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.Expression) { + return convert((org.eclipse.wst.jsdt.internal.compiler.ast.Expression) statement); + } else { + return null; + } + } + + protected FieldDeclaration convertToFieldDeclaration(org.eclipse.wst.jsdt.internal.compiler.ast.AbstractVariableDeclaration fieldDecl) { + VariableDeclarationFragment variableDeclarationFragment = convertToVariableDeclarationFragment(fieldDecl); + final FieldDeclaration fieldDeclaration = new FieldDeclaration(this.ast); + fieldDeclaration.fragments().add(variableDeclarationFragment); + if (this.resolveBindings) { + recordNodes(variableDeclarationFragment, fieldDecl); + variableDeclarationFragment.resolveBinding(); + } + fieldDeclaration.setSourceRange(fieldDecl.declarationSourceStart, fieldDecl.declarationEnd - fieldDecl.declarationSourceStart + 1); + Type type = convertType(fieldDecl.type,fieldDecl.inferredType); + setTypeForField(fieldDeclaration, type, variableDeclarationFragment.getExtraDimensions()); +// setModifiers(fieldDeclaration, fieldDecl); + convert(fieldDecl.javadoc, fieldDeclaration); + return fieldDeclaration; + } + + public ParenthesizedExpression convertToParenthesizedExpression(org.eclipse.wst.jsdt.internal.compiler.ast.Expression expression) { + final ParenthesizedExpression parenthesizedExpression = new ParenthesizedExpression(this.ast); + if (this.resolveBindings) { + recordNodes(parenthesizedExpression, expression); + } + parenthesizedExpression.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); + adjustSourcePositionsForParent(expression); + trimWhiteSpacesAndComments(expression); + // decrement the number of parenthesis + int numberOfParenthesis = (expression.bits & org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.ParenthesizedMASK) >> org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.ParenthesizedSHIFT; + expression.bits &= ~org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.ParenthesizedMASK; + expression.bits |= (numberOfParenthesis - 1) << org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode.ParenthesizedSHIFT; + parenthesizedExpression.setExpression(convert(expression)); + return parenthesizedExpression; + } + + public Type convertToType(org.eclipse.wst.jsdt.internal.compiler.ast.NameReference reference) { + Name name = convert(reference); + final SimpleType type = new SimpleType(this.ast); + type.setName(name); + type.setSourceRange(name.getStartPosition(), name.getLength()); + if (this.resolveBindings) { + this.recordNodes(type, reference); + } + return type; + } + + protected VariableDeclarationExpression convertToVariableDeclarationExpression(org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration localDeclaration) { + final VariableDeclarationFragment variableDeclarationFragment = convertToVariableDeclarationFragment(localDeclaration); + final VariableDeclarationExpression variableDeclarationExpression = new VariableDeclarationExpression(this.ast); + variableDeclarationExpression.fragments().add(variableDeclarationFragment); + if (this.resolveBindings) { + recordNodes(variableDeclarationFragment, localDeclaration); + } + variableDeclarationExpression.setSourceRange(localDeclaration.declarationSourceStart, localDeclaration.declarationSourceEnd - localDeclaration.declarationSourceStart + 1); + Type type = convertType(localDeclaration.type,localDeclaration.inferredType); + setTypeForVariableDeclarationExpression(variableDeclarationExpression, type, variableDeclarationFragment.getExtraDimensions()); + if (localDeclaration.modifiersSourceStart != -1) { + setModifiers(variableDeclarationExpression, localDeclaration); + } + return variableDeclarationExpression; + } + + protected SingleVariableDeclaration convertToSingleVariableDeclaration(LocalDeclaration localDeclaration) { + final SingleVariableDeclaration variableDecl = new SingleVariableDeclaration(this.ast); + setModifiers(variableDecl, localDeclaration); + final SimpleName name = new SimpleName(this.ast); + name.internalSetIdentifier(new String(localDeclaration.name)); + int start = localDeclaration.sourceStart; + int nameEnd = localDeclaration.sourceEnd; + name.setSourceRange(start, nameEnd - start + 1); + variableDecl.setName(name); + final int extraDimensions = retrieveExtraDimension(nameEnd + 1, localDeclaration.type.sourceEnd); + variableDecl.setExtraDimensions(extraDimensions); + Type type = convertType(localDeclaration.type,localDeclaration.inferredType); + int typeEnd = type.getStartPosition() + type.getLength() - 1; + int rightEnd = Math.max(typeEnd, localDeclaration.declarationSourceEnd); + /* + * There is extra work to do to set the proper type positions + * See PR http://bugs.eclipse.org/bugs/show_bug.cgi?id=23284 + */ + setTypeForSingleVariableDeclaration(variableDecl, type, extraDimensions); + variableDecl.setSourceRange(localDeclaration.declarationSourceStart, rightEnd - localDeclaration.declarationSourceStart + 1); + if (this.resolveBindings) { + recordNodes(name, localDeclaration); + recordNodes(variableDecl, localDeclaration); + variableDecl.resolveBinding(); + } + return variableDecl; + } + + protected VariableDeclarationFragment convertToVariableDeclarationFragment(org.eclipse.wst.jsdt.internal.compiler.ast.AbstractVariableDeclaration fieldDeclaration) { + final VariableDeclarationFragment variableDeclarationFragment = new VariableDeclarationFragment(this.ast); + final SimpleName name = new SimpleName(this.ast); + name.internalSetIdentifier(new String(fieldDeclaration.name)); + name.setSourceRange(fieldDeclaration.sourceStart, fieldDeclaration.sourceEnd - fieldDeclaration.sourceStart + 1); + variableDeclarationFragment.setName(name); + int start = fieldDeclaration.sourceEnd; + if (fieldDeclaration.initialization != null) { + final Expression expression = convert(fieldDeclaration.initialization); + variableDeclarationFragment.setInitializer(expression); + start = expression.getStartPosition() + expression.getLength(); + } + int end = retrievePositionBeforeNextCommaOrSemiColon(start, fieldDeclaration.declarationSourceEnd); + if (end == -1) { + variableDeclarationFragment.setSourceRange(fieldDeclaration.sourceStart, fieldDeclaration.declarationSourceEnd - fieldDeclaration.sourceStart + 1); + variableDeclarationFragment.setFlags(variableDeclarationFragment.getFlags() | ASTNode.MALFORMED); + } else { + variableDeclarationFragment.setSourceRange(fieldDeclaration.sourceStart, end - fieldDeclaration.sourceStart + 1); + } + variableDeclarationFragment.setExtraDimensions(retrieveExtraDimension(fieldDeclaration.sourceEnd + 1, fieldDeclaration.declarationSourceEnd )); + if (this.resolveBindings) { + recordNodes(name, fieldDeclaration); + recordNodes(variableDeclarationFragment, fieldDeclaration); + variableDeclarationFragment.resolveBinding(); + } + return variableDeclarationFragment; + } + + protected VariableDeclarationFragment convertToVariableDeclarationFragment(org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration localDeclaration) { + final VariableDeclarationFragment variableDeclarationFragment = new VariableDeclarationFragment(this.ast); + final SimpleName name = new SimpleName(this.ast); + name.internalSetIdentifier(new String(localDeclaration.name)); + name.setSourceRange(localDeclaration.sourceStart, localDeclaration.sourceEnd - localDeclaration.sourceStart + 1); + variableDeclarationFragment.setName(name); + int start = localDeclaration.sourceEnd; + org.eclipse.wst.jsdt.internal.compiler.ast.Expression initialization = localDeclaration.initialization; + boolean hasInitialization = initialization != null; + if (hasInitialization) { + final Expression expression = convert(initialization); + variableDeclarationFragment.setInitializer(expression); + start = expression.getStartPosition() + expression.getLength(); + } + int end = retrievePositionBeforeNextCommaOrSemiColon(start, localDeclaration.declarationSourceEnd); + if (end == -1) { + if (hasInitialization) { + // the initiazation sourceEnd is modified during convert(initialization) + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=128961 + end = start - 1; + } else { + end = localDeclaration.sourceEnd; + } + } + variableDeclarationFragment.setSourceRange(localDeclaration.sourceStart, end - localDeclaration.sourceStart + 1); + variableDeclarationFragment.setExtraDimensions(retrieveExtraDimension(localDeclaration.sourceEnd + 1, this.compilationUnitSourceLength)); + if (this.resolveBindings) { + recordNodes(variableDeclarationFragment, localDeclaration); + recordNodes(name, localDeclaration); + variableDeclarationFragment.resolveBinding(); + } + return variableDeclarationFragment; + } + + protected VariableDeclarationStatement convertToVariableDeclarationStatement(org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration localDeclaration) { + final VariableDeclarationFragment variableDeclarationFragment = convertToVariableDeclarationFragment(localDeclaration); + final VariableDeclarationStatement variableDeclarationStatement = new VariableDeclarationStatement(this.ast); + variableDeclarationStatement.fragments().add(variableDeclarationFragment); + if (this.resolveBindings) { + recordNodes(variableDeclarationFragment, localDeclaration); + } + variableDeclarationStatement.setSourceRange(localDeclaration.declarationSourceStart, localDeclaration.declarationSourceEnd - localDeclaration.declarationSourceStart + 1); + if (localDeclaration.type!=null) + { + Type type = convertType(localDeclaration.type,localDeclaration.inferredType); + setTypeForVariableDeclarationStatement(variableDeclarationStatement, type, variableDeclarationFragment.getExtraDimensions()); + } + org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration local = localDeclaration; + while (local.nextLocal!=null) { + variableDeclarationStatement.fragments().add(convertToVariableDeclarationFragment(local.nextLocal)); + local=(org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration)local.nextLocal; + } + + if (localDeclaration.modifiersSourceStart != -1) { + setModifiers(variableDeclarationStatement, localDeclaration); + } + convert(localDeclaration.javadoc, variableDeclarationStatement); + return variableDeclarationStatement; + } + + public Type convertType(TypeReference typeReference) { + return convertType(typeReference,null); + } + public Type convertType(TypeReference typeReference, org.eclipse.wst.jsdt.core.infer.InferredType inferredType) { + if (typeReference==null) + { + InferredType newType=new InferredType(this.ast); + newType.setSourceRange(-1,0); + if (inferredType!=null) + { + newType.type=new String(inferredType.getName()); + if (this.resolveBindings) + recordNodes(newType, inferredType); + } + return newType; + } + Type type = null; + int sourceStart = -1; + int length = 0; + int dimensions = typeReference.dimensions(); + if (typeReference instanceof org.eclipse.wst.jsdt.internal.compiler.ast.SingleTypeReference) { + // this is either an ArrayTypeReference or a SingleTypeReference + char[] name = ((org.eclipse.wst.jsdt.internal.compiler.ast.SingleTypeReference) typeReference).getTypeName()[0]; + sourceStart = typeReference.sourceStart; + length = typeReference.sourceEnd - typeReference.sourceStart + 1; + // need to find out if this is an array type of primitive types or not + if (isPrimitiveType(name)) { + int end = retrieveEndOfElementTypeNamePosition(sourceStart, sourceStart + length); + if (end == -1) { + end = sourceStart + length - 1; + } + final PrimitiveType primitiveType = new PrimitiveType(this.ast); + primitiveType.setPrimitiveTypeCode(getPrimitiveTypeCode(name)); + primitiveType.setSourceRange(sourceStart, end - sourceStart + 1); + type = primitiveType; + } else { + final SimpleName simpleName = new SimpleName(this.ast); + simpleName.internalSetIdentifier(new String(name)); + // we need to search for the starting position of the first brace in order to set the proper length + // PR http://dev.eclipse.org/bugs/show_bug.cgi?id=10759 + int end = retrieveEndOfElementTypeNamePosition(sourceStart, sourceStart + length); + if (end == -1) { + end = sourceStart + length - 1; + } + simpleName.setSourceRange(sourceStart, end - sourceStart + 1); + final SimpleType simpleType = new SimpleType(this.ast); + simpleType.setName(simpleName); + type = simpleType; + type.setSourceRange(sourceStart, end - sourceStart + 1); + type = simpleType; + if (this.resolveBindings) { + this.recordNodes(simpleName, typeReference); + } + } + if (dimensions != 0) { + type = this.ast.newArrayType(type, dimensions); + type.setSourceRange(sourceStart, length); + ArrayType subarrayType = (ArrayType) type; + int index = dimensions - 1; + while (index > 0) { + subarrayType = (ArrayType) subarrayType.getComponentType(); + int end = retrieveProperRightBracketPosition(index, sourceStart); + subarrayType.setSourceRange(sourceStart, end - sourceStart + 1); + index--; + } + if (this.resolveBindings) { + // store keys for inner types + completeRecord((ArrayType) type, typeReference); + } + } + } else { + char[][] name = ((org.eclipse.wst.jsdt.internal.compiler.ast.QualifiedTypeReference) typeReference).getTypeName(); + int nameLength = name.length; + long[] positions = ((org.eclipse.wst.jsdt.internal.compiler.ast.QualifiedTypeReference) typeReference).sourcePositions; + sourceStart = (int)(positions[0]>>>32); + length = (int)(positions[nameLength - 1] & 0xFFFFFFFF) - sourceStart + 1; + final Name qualifiedName = this.setQualifiedNameNameAndSourceRanges(name, positions, typeReference); + final SimpleType simpleType = new SimpleType(this.ast); + simpleType.setName(qualifiedName); + type = simpleType; + type.setSourceRange(sourceStart, length); + + length = typeReference.sourceEnd - sourceStart + 1; + if (dimensions != 0) { + type = this.ast.newArrayType(type, dimensions); + if (this.resolveBindings) { + completeRecord((ArrayType) type, typeReference); + } + int end = retrieveEndOfDimensionsPosition(sourceStart+length, this.compilationUnitSourceLength); + if (end != -1) { + type.setSourceRange(sourceStart, end - sourceStart + 1); + } else { + type.setSourceRange(sourceStart, length); + } + ArrayType subarrayType = (ArrayType) type; + int index = dimensions - 1; + while (index > 0) { + subarrayType = (ArrayType) subarrayType.getComponentType(); + end = retrieveProperRightBracketPosition(index, sourceStart); + subarrayType.setSourceRange(sourceStart, end - sourceStart + 1); + index--; + } + } + } + if (this.resolveBindings) { + this.recordNodes(type, typeReference); + } + return type; + } + + protected Comment createComment(int[] positions) { + // Create comment node + Comment comment = null; + int start = positions[0]; + int end = positions[1]; + if (positions[1]>0) { // jsdoc comments have positive end position + JSdoc docComment = this.docParser.parse(positions); + if (docComment == null) return null; + comment = docComment; + } else { + end = -end; + if (positions[0] == 0) { // we cannot know without testing chars again + if (this.docParser.scanner.source[1] == '/') { + comment = new LineComment(this.ast); + } else { + comment = new BlockComment(this.ast); + } + } + else if (positions[0]>0) { // Block comment have positive start position + comment = new BlockComment(this.ast); + } else { // Line comment have negative start and end position + start = -start; + comment = new LineComment(this.ast); + } + comment.setSourceRange(start, end - start); + } + return comment; + } + + protected Statement createFakeEmptyStatement(org.eclipse.wst.jsdt.internal.compiler.ast.Statement statement) { + if (statement == null) return null; + EmptyStatement emptyStatement = new EmptyStatement(this.ast); + emptyStatement.setFlags(emptyStatement.getFlags() | ASTNode.MALFORMED); + int start = statement.sourceStart; + int end = statement.sourceEnd; + emptyStatement.setSourceRange(start, end - start + 1); + return emptyStatement; + } + /** + * @return a new modifier + */ + private Modifier createModifier(ModifierKeyword keyword) { + final Modifier modifier = new Modifier(this.ast); + modifier.setKeyword(keyword); + int start = this.scanner.getCurrentTokenStartPosition(); + int end = this.scanner.getCurrentTokenEndPosition(); + modifier.setSourceRange(start, end - start + 1); + return modifier; + } + + protected InfixExpression.Operator getOperatorFor(int operatorID) { + switch (operatorID) { + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.EQUAL_EQUAL : + return InfixExpression.Operator.EQUALS; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.LESS_EQUAL : + return InfixExpression.Operator.LESS_EQUALS; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.GREATER_EQUAL : + return InfixExpression.Operator.GREATER_EQUALS; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.NOT_EQUAL : + return InfixExpression.Operator.NOT_EQUALS; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.LEFT_SHIFT : + return InfixExpression.Operator.LEFT_SHIFT; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.RIGHT_SHIFT : + return InfixExpression.Operator.RIGHT_SHIFT_SIGNED; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.UNSIGNED_RIGHT_SHIFT : + return InfixExpression.Operator.RIGHT_SHIFT_UNSIGNED; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.OR_OR : + return InfixExpression.Operator.CONDITIONAL_OR; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.AND_AND : + return InfixExpression.Operator.CONDITIONAL_AND; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.PLUS : + return InfixExpression.Operator.PLUS; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.MINUS : + return InfixExpression.Operator.MINUS; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.REMAINDER : + return InfixExpression.Operator.REMAINDER; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.XOR : + return InfixExpression.Operator.XOR; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.AND : + return InfixExpression.Operator.AND; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.MULTIPLY : + return InfixExpression.Operator.TIMES; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.OR : + return InfixExpression.Operator.OR; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.DIVIDE : + return InfixExpression.Operator.DIVIDE; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.GREATER : + return InfixExpression.Operator.GREATER; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.LESS : + return InfixExpression.Operator.LESS; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.INSTANCEOF : + return InfixExpression.Operator.INSTANCEOF; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.IN : + return InfixExpression.Operator.IN; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.EQUAL_EQUAL_EQUAL : + return InfixExpression.Operator.EQUAL_EQUAL_EQUAL; + case org.eclipse.wst.jsdt.internal.compiler.ast.OperatorIds.NOT_EQUAL_EQUAL : + return InfixExpression.Operator.NOT_EQUAL_EQUAL; + } + return null; + } + + protected PrimitiveType.Code getPrimitiveTypeCode(char[] name) { + switch(name[0]) { + case 'i' : + if (name.length == 3 && name[1] == 'n' && name[2] == 't') { + return PrimitiveType.INT; + } + break; + case 'l' : + if (name.length == 4 && name[1] == 'o' && name[2] == 'n' && name[3] == 'g') { + return PrimitiveType.LONG; + } + break; + case 'd' : + if (name.length == 6 + && name[1] == 'o' + && name[2] == 'u' + && name[3] == 'b' + && name[4] == 'l' + && name[5] == 'e') { + return PrimitiveType.DOUBLE; + } + break; + case 'f' : + if (name.length == 5 + && name[1] == 'l' + && name[2] == 'o' + && name[3] == 'a' + && name[4] == 't') { + return PrimitiveType.FLOAT; + } + break; + case 'b' : + if (name.length == 4 + && name[1] == 'y' + && name[2] == 't' + && name[3] == 'e') { + return PrimitiveType.BYTE; + } else + if (name.length == 7 + && name[1] == 'o' + && name[2] == 'o' + && name[3] == 'l' + && name[4] == 'e' + && name[5] == 'a' + && name[6] == 'n') { + return PrimitiveType.BOOLEAN; + } + break; + case 'c' : + if (name.length == 4 + && name[1] == 'h' + && name[2] == 'a' + && name[3] == 'r') { + return PrimitiveType.CHAR; + } + break; + case 's' : + if (name.length == 5 + && name[1] == 'h' + && name[2] == 'o' + && name[3] == 'r' + && name[4] == 't') { + return PrimitiveType.SHORT; + } + break; + case 'v' : + if (name.length == 4 + && name[1] == 'o' + && name[2] == 'i' + && name[3] == 'd') { + return PrimitiveType.VOID; + } + } + return null; // cannot be reached + } + + protected boolean isPrimitiveType(char[] name) { + switch(name[0]) { + case 'i' : + if (name.length == 3 && name[1] == 'n' && name[2] == 't') { + return true; + } + return false; + case 'l' : + if (name.length == 4 && name[1] == 'o' && name[2] == 'n' && name[3] == 'g') { + return true; + } + return false; + case 'd' : + if (name.length == 6 + && name[1] == 'o' + && name[2] == 'u' + && name[3] == 'b' + && name[4] == 'l' + && name[5] == 'e') { + return true; + } + return false; + case 'f' : + if (name.length == 5 + && name[1] == 'l' + && name[2] == 'o' + && name[3] == 'a' + && name[4] == 't') { + return true; + } + return false; + case 'b' : + if (name.length == 4 + && name[1] == 'y' + && name[2] == 't' + && name[3] == 'e') { + return true; + } else + if (name.length == 7 + && name[1] == 'o' + && name[2] == 'o' + && name[3] == 'l' + && name[4] == 'e' + && name[5] == 'a' + && name[6] == 'n') { + return true; + } + return false; + case 'c' : + if (name.length == 4 + && name[1] == 'h' + && name[2] == 'a' + && name[3] == 'r') { + return true; + } + return false; + case 's' : + if (name.length == 5 + && name[1] == 'h' + && name[2] == 'o' + && name[3] == 'r' + && name[4] == 't') { + return true; + } + return false; + case 'v' : + if (name.length == 4 + && name[1] == 'o' + && name[2] == 'i' + && name[3] == 'd') { + return true; + } + return false; + } + return false; + } + + private void lookupForScopes() { + if (this.pendingNameScopeResolution != null) { + for (Iterator iterator = this.pendingNameScopeResolution.iterator(); iterator.hasNext(); ) { + Name name = (Name) iterator.next(); + this.ast.getBindingResolver().recordScope(name, lookupScope(name)); + } + } + if (this.pendingThisExpressionScopeResolution != null) { + for (Iterator iterator = this.pendingThisExpressionScopeResolution.iterator(); iterator.hasNext(); ) { + ThisExpression thisExpression = (ThisExpression) iterator.next(); + this.ast.getBindingResolver().recordScope(thisExpression, lookupScope(thisExpression)); + } + } + + } + + private BlockScope lookupScope(ASTNode node) { + ASTNode currentNode = node; + while(currentNode != null + &&!(currentNode instanceof FunctionDeclaration) + && !(currentNode instanceof Initializer) + && !(currentNode instanceof FieldDeclaration)) { + currentNode = currentNode.getParent(); + } + if (currentNode == null) { + return null; + } + if (currentNode instanceof Initializer) { + Initializer initializer = (Initializer) currentNode; + while(!(currentNode instanceof AbstractTypeDeclaration)) { + currentNode = currentNode.getParent(); + } + if (currentNode instanceof TypeDeclaration) { + org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration typeDecl = (org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration) this.ast.getBindingResolver().getCorrespondingNode(currentNode); + if ((initializer.getModifiers() & Modifier.STATIC) != 0) { + return typeDecl.staticInitializerScope; + } else { + return typeDecl.initializerScope; + } + } + } else if (currentNode instanceof FieldDeclaration) { + FieldDeclaration fieldDeclaration = (FieldDeclaration) currentNode; + while(!(currentNode instanceof AbstractTypeDeclaration)) { + currentNode = currentNode.getParent(); + } + if (currentNode instanceof TypeDeclaration) { + org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration typeDecl = (org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration) this.ast.getBindingResolver().getCorrespondingNode(currentNode); + if ((fieldDeclaration.getModifiers() & Modifier.STATIC) != 0) { + return typeDecl.staticInitializerScope; + } else { + return typeDecl.initializerScope; + } + } + } + AbstractMethodDeclaration abstractMethodDeclaration = (AbstractMethodDeclaration) this.ast.getBindingResolver().getCorrespondingNode(currentNode); + return abstractMethodDeclaration.scope; + } + + protected void recordName(Name name, org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode compilerNode) { + if (compilerNode != null) { + recordNodes(name, compilerNode); + if (compilerNode instanceof org.eclipse.wst.jsdt.internal.compiler.ast.TypeReference) { + org.eclipse.wst.jsdt.internal.compiler.ast.TypeReference typeRef = (org.eclipse.wst.jsdt.internal.compiler.ast.TypeReference) compilerNode; + if (name.isQualifiedName()) { + SimpleName simpleName = null; + while (name.isQualifiedName()) { + simpleName = ((QualifiedName) name).getName(); + recordNodes(simpleName, typeRef); + name = ((QualifiedName) name).getQualifier(); + recordNodes(name, typeRef); + } + } + } + } + } + + protected void recordNodes(ASTNode node, org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode oldASTNode) { + this.ast.getBindingResolver().store(node, oldASTNode); + } + + protected void recordNodes(org.eclipse.wst.jsdt.internal.compiler.ast.Javadoc javadoc, TagElement tagElement) { + Iterator fragments = tagElement.fragments().listIterator(); + while (fragments.hasNext()) { + ASTNode node = (ASTNode) fragments.next(); + if (node.getNodeType() == ASTNode.MEMBER_REF) { + MemberRef memberRef = (MemberRef) node; + Name name = memberRef.getName(); + // get compiler node and record nodes + int start = name.getStartPosition(); + org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode compilerNode = javadoc.getNodeStartingAt(start); + if (compilerNode!= null) { + recordNodes(name, compilerNode); + recordNodes(node, compilerNode); + } + // Replace qualifier to have all nodes recorded + if (memberRef.getQualifier() != null) { + org.eclipse.wst.jsdt.internal.compiler.ast.TypeReference typeRef = null; + if (compilerNode instanceof JavadocFieldReference) { + org.eclipse.wst.jsdt.internal.compiler.ast.Expression expression = ((JavadocFieldReference)compilerNode).receiver; + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.TypeReference) { + typeRef = (org.eclipse.wst.jsdt.internal.compiler.ast.TypeReference) expression; + } + } + else if (compilerNode instanceof JavadocMessageSend) { + org.eclipse.wst.jsdt.internal.compiler.ast.Expression expression = ((JavadocMessageSend)compilerNode).receiver; + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.TypeReference) { + typeRef = (org.eclipse.wst.jsdt.internal.compiler.ast.TypeReference) expression; + } + } + if (typeRef != null) { + recordName(memberRef.getQualifier(), typeRef); + } + } + } else if (node.getNodeType() == ASTNode.FUNCTION_REF) { + FunctionRef methodRef = (FunctionRef) node; + Name name = methodRef.getName(); + // get method name start position + int start = methodRef.getStartPosition(); + this.scanner.resetTo(start, start + name.getStartPosition()+name.getLength()); + int token; + try { + nextToken: while((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF && token != TerminalTokens.TokenNameLPAREN) { + if (token == TerminalTokens.TokenNameERROR && this.scanner.currentCharacter == '#') { + start = this.scanner.getCurrentTokenEndPosition()+1; + break nextToken; + } + } + } + catch(InvalidInputException e) { + // ignore + } + // get compiler node and record nodes + org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode compilerNode = javadoc.getNodeStartingAt(start); + // record nodes + if (compilerNode != null) { + recordNodes(methodRef, compilerNode); + // get type ref + org.eclipse.wst.jsdt.internal.compiler.ast.TypeReference typeRef = null; + if (compilerNode instanceof org.eclipse.wst.jsdt.internal.compiler.ast.JavadocAllocationExpression) { + typeRef = ((org.eclipse.wst.jsdt.internal.compiler.ast.JavadocAllocationExpression)compilerNode).type; + if (typeRef != null) recordNodes(name, compilerNode); + } + else if (compilerNode instanceof org.eclipse.wst.jsdt.internal.compiler.ast.JavadocMessageSend) { + org.eclipse.wst.jsdt.internal.compiler.ast.Expression expression = ((org.eclipse.wst.jsdt.internal.compiler.ast.JavadocMessageSend)compilerNode).receiver; + if (expression instanceof org.eclipse.wst.jsdt.internal.compiler.ast.TypeReference) { + typeRef = (org.eclipse.wst.jsdt.internal.compiler.ast.TypeReference) expression; + } + recordNodes(name, compilerNode); + } + // record name and qualifier + if (typeRef != null && methodRef.getQualifier() != null) { + recordName(methodRef.getQualifier(), typeRef); + } + } + // Resolve parameters + Iterator parameters = methodRef.parameters().listIterator(); + while (parameters.hasNext()) { + FunctionRefParameter param = (FunctionRefParameter) parameters.next(); + org.eclipse.wst.jsdt.internal.compiler.ast.Expression expression = (org.eclipse.wst.jsdt.internal.compiler.ast.Expression) javadoc.getNodeStartingAt(param.getStartPosition()); + if (expression != null) { + recordNodes(param, expression); + if (expression instanceof JavadocArgumentExpression) { + JavadocArgumentExpression argExpr = (JavadocArgumentExpression) expression; + org.eclipse.wst.jsdt.internal.compiler.ast.TypeReference typeRef = argExpr.argument.type; + if (this.ast.apiLevel >= AST.JLS3) param.setVarargs(argExpr.argument.isVarArgs()); + recordNodes(param.getType(), typeRef); + if (param.getType().isSimpleType()) { + recordName(((SimpleType)param.getType()).getName(), typeRef); + } else if (param.getType().isArrayType()) { + Type type = ((ArrayType) param.getType()).getElementType(); + recordNodes(type, typeRef); + if (type.isSimpleType()) { + recordName(((SimpleType)type).getName(), typeRef); + } + } + } + } + } + } else if (node.getNodeType() == ASTNode.SIMPLE_NAME || + node.getNodeType() == ASTNode.QUALIFIED_NAME) { + org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode compilerNode = javadoc.getNodeStartingAt(node.getStartPosition()); + recordName((Name) node, compilerNode); + } else if (node.getNodeType() == ASTNode.TAG_ELEMENT) { + // resolve member and method references binding + recordNodes(javadoc, (TagElement) node); + } + } + } + protected void recordPendingNameScopeResolution(Name name) { + if (this.pendingNameScopeResolution == null) { + this.pendingNameScopeResolution = new HashSet(); + } + this.pendingNameScopeResolution.add(name); + } + + protected void recordPendingThisExpressionScopeResolution(ThisExpression thisExpression) { + if (this.pendingThisExpressionScopeResolution == null) { + this.pendingThisExpressionScopeResolution = new HashSet(); + } + this.pendingThisExpressionScopeResolution.add(thisExpression); + } + + /** + * Remove whitespaces and comments before and after the expression. + */ + private void trimWhiteSpacesAndComments(org.eclipse.wst.jsdt.internal.compiler.ast.Expression expression) { + int start = expression.sourceStart; + int end = expression.sourceEnd; + int token; + int trimLeftPosition = expression.sourceStart; + int trimRightPosition = expression.sourceEnd; + boolean first = true; + Scanner removeBlankScanner = this.ast.scanner; + try { + removeBlankScanner.setSource(this.compilationUnitSource); + removeBlankScanner.resetTo(start, end); + while (true) { + token = removeBlankScanner.getNextToken(); + switch (token) { + case TerminalTokens.TokenNameCOMMENT_JAVADOC : + case TerminalTokens.TokenNameCOMMENT_LINE : + case TerminalTokens.TokenNameCOMMENT_BLOCK : + if (first) { + trimLeftPosition = removeBlankScanner.currentPosition; + } + break; + case TerminalTokens.TokenNameWHITESPACE : + if (first) { + trimLeftPosition = removeBlankScanner.currentPosition; + } + break; + case TerminalTokens.TokenNameEOF : + expression.sourceStart = trimLeftPosition; + expression.sourceEnd = trimRightPosition; + return; + default : + /* + * if we find something else than a whitespace or a comment, + * then we reset the trimRigthPosition to the expression + * source end. + */ + trimRightPosition = removeBlankScanner.currentPosition - 1; + first = false; + } + } + } catch (InvalidInputException e){ + // ignore + } + } + + /** + * Remove potential trailing comment by settings the source end on the closing parenthesis + */ + protected void removeLeadingAndTrailingCommentsFromLiteral(ASTNode node) { + int start = node.getStartPosition(); + this.scanner.resetTo(start, start + node.getLength()); + int token; + int startPosition = -1; + try { + while((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + switch(token) { + case TerminalTokens.TokenNameIntegerLiteral : + case TerminalTokens.TokenNameFloatingPointLiteral : + case TerminalTokens.TokenNameLongLiteral : + case TerminalTokens.TokenNameDoubleLiteral : + case TerminalTokens.TokenNameCharacterLiteral : + case TerminalTokens.TokenNameRegExLiteral : + if (startPosition == -1) { + startPosition = this.scanner.startPosition; + } + int end = this.scanner.currentPosition; + node.setSourceRange(startPosition, end - startPosition); + return; + case TerminalTokens.TokenNameMINUS : + startPosition = this.scanner.startPosition; + break; + } + } + } catch(InvalidInputException e) { + // ignore + } + } + + /** + * Remove potential trailing comment by settings the source end on the closing parenthesis + */ + protected void removeTrailingCommentFromExpressionEndingWithAParen(ASTNode node) { + int start = node.getStartPosition(); + this.scanner.resetTo(start, start + node.getLength()); + int token; + int parenCounter = 0; + try { + while((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + switch(token) { + case TerminalTokens.TokenNameLPAREN : + parenCounter++; + break; + case TerminalTokens.TokenNameRPAREN : + parenCounter--; + if (parenCounter == 0) { + int end = this.scanner.currentPosition - 1; + node.setSourceRange(start, end - start + 1); + } + } + } + } catch(InvalidInputException e) { + // ignore + } + } + + /** + * This method is used to retrieve the end position of the block. + * @return int the dimension found, -1 if none + */ + protected int retrieveClosingAngleBracketPosition(int start) { + this.scanner.resetTo(start, this.compilationUnitSourceLength); + this.scanner.returnOnlyGreater = true; + try { + int token; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + switch(token) { + case TerminalTokens.TokenNameGREATER: + return this.scanner.currentPosition - 1; + default: + return start; + } + } + } catch(InvalidInputException e) { + // ignore + } + this.scanner.returnOnlyGreater = false; + return start; + } + + /** + * This method is used to set the right end position for expression + * statement. The actual AST nodes don't include the trailing semicolon. + * This method fixes the length of the corresponding node. + */ + protected void retrieveColonPosition(ASTNode node) { + int start = node.getStartPosition(); + int length = node.getLength(); + int end = start + length; + this.scanner.resetTo(end, this.compilationUnitSourceLength); + try { + int token; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + switch(token) { + case TerminalTokens.TokenNameCOLON: + node.setSourceRange(start, this.scanner.currentPosition - start); + return; + } + } + } catch(InvalidInputException e) { + // ignore + } + } +// /** +// * This method is used to retrieve the start position of the Ellipsis +// */ +// protected int retrieveEllipsisStartPosition(int start, int end) { +// this.scanner.resetTo(start, end); +// try { +// int token; +// while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { +// switch(token) { +// case TerminalTokens.TokenNameELLIPSIS: +// return this.scanner.startPosition - 1; +// } +// } +// } catch(InvalidInputException e) { +// // ignore +// } +// return -1; +// +// } + /** + * This method is used to retrieve the end position of the block. + * @return int the dimension found, -1 if none + */ + protected int retrieveEndBlockPosition(int start, int end) { + this.scanner.resetTo(start, end); + int count = 0; + try { + int token; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + switch(token) { + case TerminalTokens.TokenNameLBRACE://110 + count++; + break; + case TerminalTokens.TokenNameRBRACE://95 + count--; + if (count == 0) { + return this.scanner.currentPosition - 1; + } + } + } + } catch(InvalidInputException e) { + // ignore + } + return -1; + } + + protected int retrieveSemiColonPosition(Expression node) { + int start = node.getStartPosition(); + int length = node.getLength(); + int end = start + length; + this.scanner.resetTo(end, this.compilationUnitSourceLength); + try { + int token; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + switch(token) { + case TerminalTokens.TokenNameSEMICOLON: + return this.scanner.currentPosition - 1; + } + } + } catch(InvalidInputException e) { + // ignore + } + return -1; + } + + /** + * This method is used to retrieve the ending position for a type declaration when the dimension is right after the type + * name. + * For example: + * int[] i; => return 5, but int i[] => return -1; + * @return int the dimension found + */ + protected int retrieveEndOfDimensionsPosition(int start, int end) { + this.scanner.resetTo(start, end); + int foundPosition = -1; + try { + int token; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + switch(token) { + case TerminalTokens.TokenNameLBRACKET: + case TerminalTokens.TokenNameCOMMENT_BLOCK: + case TerminalTokens.TokenNameCOMMENT_JAVADOC: + case TerminalTokens.TokenNameCOMMENT_LINE: + break; + case TerminalTokens.TokenNameRBRACKET://166 + foundPosition = this.scanner.currentPosition - 1; + break; + default: + return foundPosition; + } + } + } catch(InvalidInputException e) { + // ignore + } + return foundPosition; + } + + /** + * This method is used to retrieve the position just before the left bracket. + * @return int the dimension found, -1 if none + */ + protected int retrieveEndOfElementTypeNamePosition(int start, int end) { + this.scanner.resetTo(start, end); + try { + int token; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + switch(token) { + case TerminalTokens.TokenNameIdentifier: + case TerminalTokens.TokenNamebyte: + case TerminalTokens.TokenNamechar: + case TerminalTokens.TokenNamedouble: + case TerminalTokens.TokenNamefloat: + case TerminalTokens.TokenNameint: + case TerminalTokens.TokenNamelong: + case TerminalTokens.TokenNameshort: + case TerminalTokens.TokenNameboolean: + return this.scanner.currentPosition - 1; + } + } + } catch(InvalidInputException e) { + // ignore + } + return -1; + } + + /** + * This method is used to retrieve the position after the right parenthesis. + * @return int the position found + */ + protected int retrieveEndOfRightParenthesisPosition(int start, int end) { + this.scanner.resetTo(start, end); + try { + int token; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + switch(token) { + case TerminalTokens.TokenNameRPAREN: + return this.scanner.currentPosition; + } + } + } catch(InvalidInputException e) { + // ignore + } + return -1; + } + + /** + * This method is used to retrieve the array dimension declared after the + * name of a local or a field declaration. + * For example: + * int i, j[] = null, k[][] = {{}}; + * It should return 0 for i, 1 for j and 2 for k. + * @return int the dimension found + */ + protected int retrieveExtraDimension(int start, int end) { + this.scanner.resetTo(start, end); + int dimensions = 0; + try { + int token; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + switch(token) { + case TerminalTokens.TokenNameLBRACKET: + case TerminalTokens.TokenNameCOMMENT_BLOCK: + case TerminalTokens.TokenNameCOMMENT_JAVADOC: + case TerminalTokens.TokenNameCOMMENT_LINE: + break; + case TerminalTokens.TokenNameRBRACKET://166 + dimensions++; + break; + default: + return dimensions; + } + } + } catch(InvalidInputException e) { + // ignore + } + return dimensions; + } + + protected void retrieveIdentifierAndSetPositions(int start, int end, Name name) { + this.scanner.resetTo(start, end); + int token; + try { + while((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + if (token == TerminalTokens.TokenNameIdentifier) { + int startName = this.scanner.startPosition; + int endName = this.scanner.currentPosition - 1; + name.setSourceRange(startName, endName - startName + 1); + return; + } + } + } catch(InvalidInputException e) { + // ignore + } + } + + /** + * This method is used to retrieve the start position of the block. + * @return int the dimension found, -1 if none + */ + protected int retrieveIdentifierEndPosition(int start, int end) { + this.scanner.resetTo(start, end); + try { + int token; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + switch(token) { + case TerminalTokens.TokenNameIdentifier://110 + return this.scanner.getCurrentTokenEndPosition(); + } + } + } catch(InvalidInputException e) { + // ignore + } + return -1; + } + + /** + * This method is used to retrieve position before the next comma or semi-colon. + * @return int the position found. + */ + protected int retrievePositionBeforeNextCommaOrSemiColon(int start, int end) { + this.scanner.resetTo(start, end); + try { + int token; + int balance = 0; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + switch(token) { + case TerminalTokens.TokenNameLBRACE : + balance++; + break; + case TerminalTokens.TokenNameRBRACE : + balance --; + break; + case TerminalTokens.TokenNameCOMMA : + if (balance == 0) return this.scanner.startPosition - 1; + break; + case TerminalTokens.TokenNameSEMICOLON : + return this.scanner.startPosition - 1; + } + } + } catch(InvalidInputException e) { + // ignore + } + return -1; + } + + protected int retrieveProperRightBracketPosition(int bracketNumber, int start) { + this.scanner.resetTo(start, this.compilationUnitSourceLength); + try { + int token, count = 0; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + switch(token) { + case TerminalTokens.TokenNameRBRACKET: + count++; + if (count == bracketNumber) { + return this.scanner.currentPosition - 1; + } + } + } + } catch(InvalidInputException e) { + // ignore + } + return -1; + } + + /** + * This method is used to retrieve position before the next right brace or semi-colon. + * @return int the position found. + */ + protected int retrieveRightBraceOrSemiColonPosition(int start, int end) { + this.scanner.resetTo(start, end); + try { + int token; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + switch(token) { + case TerminalTokens.TokenNameRBRACE : + return this.scanner.currentPosition - 1; + case TerminalTokens.TokenNameSEMICOLON : + return this.scanner.currentPosition - 1; + } + } + } catch(InvalidInputException e) { + // ignore + } + return -1; + } + + /** + * This method is used to retrieve position before the next right brace or semi-colon. + * @return int the position found. + */ + protected int retrieveRightBrace(int start, int end) { + this.scanner.resetTo(start, end); + try { + int token; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + switch(token) { + case TerminalTokens.TokenNameRBRACE : + return this.scanner.currentPosition - 1; + } + } + } catch(InvalidInputException e) { + // ignore + } + return -1; + } + + /** + * This method is used to retrieve the position of the right bracket. + * @return int the dimension found, -1 if none + */ + protected int retrieveRightBracketPosition(int start, int end) { + this.scanner.resetTo(start, end); + try { + int token; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + switch(token) { + case TerminalTokens.TokenNameRBRACKET: + return this.scanner.currentPosition - 1; + } + } + } catch(InvalidInputException e) { + // ignore + } + return -1; + } + + + + /** + * This method is used to retrieve the start position of the block. + * @return int the dimension found, -1 if none + */ + protected int retrieveStartBlockPosition(int start, int end) { + this.scanner.resetTo(start, end); + try { + int token; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + switch(token) { + case TerminalTokens.TokenNameLBRACE://110 + return this.scanner.startPosition; + } + } + } catch(InvalidInputException e) { + // ignore + } + return -1; + } + + /** + * This method is used to retrieve the starting position of the catch keyword. + * @return int the dimension found, -1 if none + */ + protected int retrieveStartingCatchPosition(int start, int end) { + this.scanner.resetTo(start, end); + try { + int token; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + switch(token) { + case TerminalTokens.TokenNamecatch://225 + return this.scanner.startPosition; + } + } + } catch(InvalidInputException e) { + // ignore + } + return -1; + } + + public void setAST(AST ast) { + this.ast = ast; + this.docParser = new DocCommentParser(this.ast, this.scanner, this.insideComments); + } + + /** + * @param bodyDeclaration + */ + protected void setModifiers(BodyDeclaration bodyDeclaration) { + try { + int token; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + IExtendedModifier modifier = null; + switch(token) { + case TerminalTokens.TokenNameabstract: + modifier = createModifier(Modifier.ModifierKeyword.ABSTRACT_KEYWORD); + break; + case TerminalTokens.TokenNamepublic: + modifier = createModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD); + break; + case TerminalTokens.TokenNamestatic: + modifier = createModifier(Modifier.ModifierKeyword.STATIC_KEYWORD); + break; + case TerminalTokens.TokenNameprotected: + modifier = createModifier(Modifier.ModifierKeyword.PROTECTED_KEYWORD); + break; + case TerminalTokens.TokenNameprivate: + modifier = createModifier(Modifier.ModifierKeyword.PRIVATE_KEYWORD); + break; + case TerminalTokens.TokenNamefinal: + modifier = createModifier(Modifier.ModifierKeyword.FINAL_KEYWORD); + break; + case TerminalTokens.TokenNamenative: + modifier = createModifier(Modifier.ModifierKeyword.NATIVE_KEYWORD); + break; + case TerminalTokens.TokenNamesynchronized: + modifier = createModifier(Modifier.ModifierKeyword.SYNCHRONIZED_KEYWORD); + break; + case TerminalTokens.TokenNametransient: + modifier = createModifier(Modifier.ModifierKeyword.TRANSIENT_KEYWORD); + break; + case TerminalTokens.TokenNamevolatile: + modifier = createModifier(Modifier.ModifierKeyword.VOLATILE_KEYWORD); + break; + case TerminalTokens.TokenNameCOMMENT_BLOCK : + case TerminalTokens.TokenNameCOMMENT_LINE : + case TerminalTokens.TokenNameCOMMENT_JAVADOC : + break; + default : + return; + } + if (modifier != null) { + bodyDeclaration.modifiers().add(modifier); + } + } + } catch(InvalidInputException e) { + // ignore + } + } + + + /** + * @param fieldDeclaration + * @param fieldDecl + */ + protected void setModifiers(FieldDeclaration fieldDeclaration, org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration fieldDecl) { + switch(this.ast.apiLevel) { + case AST.JLS2_INTERNAL : + fieldDeclaration.internalSetModifiers(fieldDecl.modifiers & ExtraCompilerModifiers.AccJustFlag); + break; + case AST.JLS3 : + this.scanner.resetTo(fieldDecl.declarationSourceStart, fieldDecl.sourceStart); + this.setModifiers(fieldDeclaration); + } + } + + /** + * @param initializer + * @param oldInitializer + */ + protected void setModifiers(Initializer initializer, org.eclipse.wst.jsdt.internal.compiler.ast.Initializer oldInitializer) { + switch(this.ast.apiLevel) { + case AST.JLS2_INTERNAL: + initializer.internalSetModifiers(oldInitializer.modifiers & ExtraCompilerModifiers.AccJustFlag); + break; + case AST.JLS3 : + this.scanner.resetTo(oldInitializer.declarationSourceStart, oldInitializer.bodyStart); + this.setModifiers(initializer); + } + } + /** + * @param methodDecl + * @param methodDeclaration + */ + protected void setModifiers(FunctionDeclaration methodDecl, AbstractMethodDeclaration methodDeclaration) { + switch(this.ast.apiLevel) { + case AST.JLS2_INTERNAL : + methodDecl.internalSetModifiers(methodDeclaration.modifiers & ExtraCompilerModifiers.AccJustFlag); + break; + case AST.JLS3 : + if (methodDeclaration.sourceStart>methodDeclaration.declarationSourceStart) + { + this.scanner.resetTo(methodDeclaration.declarationSourceStart, methodDeclaration.sourceStart); + this.setModifiers(methodDecl); + } + } + } + + /** + * @param variableDecl + * @param argument + */ + protected void setModifiers(SingleVariableDeclaration variableDecl, Argument argument) { + switch(this.ast.apiLevel) { + case AST.JLS2_INTERNAL : + variableDecl.internalSetModifiers(argument.modifiers & ExtraCompilerModifiers.AccJustFlag); + break; + case AST.JLS3 : + this.scanner.resetTo(argument.declarationSourceStart, argument.sourceStart); + try { + int token; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + IExtendedModifier modifier = null; + switch(token) { + case TerminalTokens.TokenNameabstract: + modifier = createModifier(Modifier.ModifierKeyword.ABSTRACT_KEYWORD); + break; + case TerminalTokens.TokenNamepublic: + modifier = createModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD); + break; + case TerminalTokens.TokenNamestatic: + modifier = createModifier(Modifier.ModifierKeyword.STATIC_KEYWORD); + break; + case TerminalTokens.TokenNameprotected: + modifier = createModifier(Modifier.ModifierKeyword.PROTECTED_KEYWORD); + break; + case TerminalTokens.TokenNameprivate: + modifier = createModifier(Modifier.ModifierKeyword.PRIVATE_KEYWORD); + break; + case TerminalTokens.TokenNamefinal: + modifier = createModifier(Modifier.ModifierKeyword.FINAL_KEYWORD); + break; + case TerminalTokens.TokenNamenative: + modifier = createModifier(Modifier.ModifierKeyword.NATIVE_KEYWORD); + break; + case TerminalTokens.TokenNamesynchronized: + modifier = createModifier(Modifier.ModifierKeyword.SYNCHRONIZED_KEYWORD); + break; + case TerminalTokens.TokenNametransient: + modifier = createModifier(Modifier.ModifierKeyword.TRANSIENT_KEYWORD); + break; + case TerminalTokens.TokenNamevolatile: + modifier = createModifier(Modifier.ModifierKeyword.VOLATILE_KEYWORD); + break; + case TerminalTokens.TokenNameCOMMENT_BLOCK : + case TerminalTokens.TokenNameCOMMENT_LINE : + case TerminalTokens.TokenNameCOMMENT_JAVADOC : + break; + default : + return; + } + if (modifier != null) { + variableDecl.modifiers().add(modifier); + } + } + } catch(InvalidInputException e) { + // ignore + } + } + } + + protected void setModifiers(SingleVariableDeclaration variableDecl, LocalDeclaration localDeclaration) { + switch(this.ast.apiLevel) { + case AST.JLS2_INTERNAL : + variableDecl.internalSetModifiers(localDeclaration.modifiers & ExtraCompilerModifiers.AccJustFlag); + break; + case AST.JLS3 : + this.scanner.resetTo(localDeclaration.declarationSourceStart, localDeclaration.sourceStart); + try { + int token; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + IExtendedModifier modifier = null; + switch(token) { + case TerminalTokens.TokenNameabstract: + modifier = createModifier(Modifier.ModifierKeyword.ABSTRACT_KEYWORD); + break; + case TerminalTokens.TokenNamepublic: + modifier = createModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD); + break; + case TerminalTokens.TokenNamestatic: + modifier = createModifier(Modifier.ModifierKeyword.STATIC_KEYWORD); + break; + case TerminalTokens.TokenNameprotected: + modifier = createModifier(Modifier.ModifierKeyword.PROTECTED_KEYWORD); + break; + case TerminalTokens.TokenNameprivate: + modifier = createModifier(Modifier.ModifierKeyword.PRIVATE_KEYWORD); + break; + case TerminalTokens.TokenNamefinal: + modifier = createModifier(Modifier.ModifierKeyword.FINAL_KEYWORD); + break; + case TerminalTokens.TokenNamenative: + modifier = createModifier(Modifier.ModifierKeyword.NATIVE_KEYWORD); + break; + case TerminalTokens.TokenNamesynchronized: + modifier = createModifier(Modifier.ModifierKeyword.SYNCHRONIZED_KEYWORD); + break; + case TerminalTokens.TokenNametransient: + modifier = createModifier(Modifier.ModifierKeyword.TRANSIENT_KEYWORD); + break; + case TerminalTokens.TokenNamevolatile: + modifier = createModifier(Modifier.ModifierKeyword.VOLATILE_KEYWORD); + break; + case TerminalTokens.TokenNameCOMMENT_BLOCK : + case TerminalTokens.TokenNameCOMMENT_LINE : + case TerminalTokens.TokenNameCOMMENT_JAVADOC : + break; + default : + return; + } + if (modifier != null) { + variableDecl.modifiers().add(modifier); + } + } + } catch(InvalidInputException e) { + // ignore + } + } + } + + /** + * @param typeDecl + * @param typeDeclaration + */ + protected void setModifiers(TypeDeclaration typeDecl, org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration typeDeclaration) { + switch(this.ast.apiLevel) { + case AST.JLS2_INTERNAL : + int modifiers = typeDeclaration.modifiers; + modifiers &= ExtraCompilerModifiers.AccJustFlag; + typeDecl.internalSetModifiers(modifiers); + break; + case AST.JLS3 : + this.scanner.resetTo(typeDeclaration.declarationSourceStart, typeDeclaration.sourceStart); + this.setModifiers(typeDecl); + } + } + + /** + * @param variableDeclarationExpression + * @param localDeclaration + */ + protected void setModifiers(VariableDeclarationExpression variableDeclarationExpression, LocalDeclaration localDeclaration) { + switch(this.ast.apiLevel) { + case AST.JLS2_INTERNAL : + int modifiers = localDeclaration.modifiers & ExtraCompilerModifiers.AccJustFlag; + modifiers &= ~ExtraCompilerModifiers.AccBlankFinal; + variableDeclarationExpression.internalSetModifiers(modifiers); + break; + case AST.JLS3 : + this.scanner.resetTo(localDeclaration.declarationSourceStart, localDeclaration.sourceStart); + try { + int token; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + IExtendedModifier modifier = null; + switch(token) { + case TerminalTokens.TokenNameabstract: + modifier = createModifier(Modifier.ModifierKeyword.ABSTRACT_KEYWORD); + break; + case TerminalTokens.TokenNamepublic: + modifier = createModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD); + break; + case TerminalTokens.TokenNamestatic: + modifier = createModifier(Modifier.ModifierKeyword.STATIC_KEYWORD); + break; + case TerminalTokens.TokenNameprotected: + modifier = createModifier(Modifier.ModifierKeyword.PROTECTED_KEYWORD); + break; + case TerminalTokens.TokenNameprivate: + modifier = createModifier(Modifier.ModifierKeyword.PRIVATE_KEYWORD); + break; + case TerminalTokens.TokenNamefinal: + modifier = createModifier(Modifier.ModifierKeyword.FINAL_KEYWORD); + break; + case TerminalTokens.TokenNamenative: + modifier = createModifier(Modifier.ModifierKeyword.NATIVE_KEYWORD); + break; + case TerminalTokens.TokenNamesynchronized: + modifier = createModifier(Modifier.ModifierKeyword.SYNCHRONIZED_KEYWORD); + break; + case TerminalTokens.TokenNametransient: + modifier = createModifier(Modifier.ModifierKeyword.TRANSIENT_KEYWORD); + break; + case TerminalTokens.TokenNamevolatile: + modifier = createModifier(Modifier.ModifierKeyword.VOLATILE_KEYWORD); + break; + case TerminalTokens.TokenNameCOMMENT_BLOCK : + case TerminalTokens.TokenNameCOMMENT_LINE : + case TerminalTokens.TokenNameCOMMENT_JAVADOC : + break; + default : + return; + } + if (modifier != null) { + variableDeclarationExpression.modifiers().add(modifier); + } + } + } catch(InvalidInputException e) { + // ignore + } + } + } + + /** + * @param variableDeclarationStatement + * @param localDeclaration + */ + protected void setModifiers(VariableDeclarationStatement variableDeclarationStatement, LocalDeclaration localDeclaration) { + switch(this.ast.apiLevel) { + case AST.JLS2_INTERNAL : + int modifiers = localDeclaration.modifiers & ExtraCompilerModifiers.AccJustFlag; + modifiers &= ~ExtraCompilerModifiers.AccBlankFinal; + variableDeclarationStatement.internalSetModifiers(modifiers); + break; + case AST.JLS3 : + this.scanner.resetTo(localDeclaration.declarationSourceStart, localDeclaration.sourceStart); + try { + int token; + while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + IExtendedModifier modifier = null; + switch(token) { + case TerminalTokens.TokenNameabstract: + modifier = createModifier(Modifier.ModifierKeyword.ABSTRACT_KEYWORD); + break; + case TerminalTokens.TokenNamepublic: + modifier = createModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD); + break; + case TerminalTokens.TokenNamestatic: + modifier = createModifier(Modifier.ModifierKeyword.STATIC_KEYWORD); + break; + case TerminalTokens.TokenNameprotected: + modifier = createModifier(Modifier.ModifierKeyword.PROTECTED_KEYWORD); + break; + case TerminalTokens.TokenNameprivate: + modifier = createModifier(Modifier.ModifierKeyword.PRIVATE_KEYWORD); + break; + case TerminalTokens.TokenNamefinal: + modifier = createModifier(Modifier.ModifierKeyword.FINAL_KEYWORD); + break; + case TerminalTokens.TokenNamenative: + modifier = createModifier(Modifier.ModifierKeyword.NATIVE_KEYWORD); + break; + case TerminalTokens.TokenNamesynchronized: + modifier = createModifier(Modifier.ModifierKeyword.SYNCHRONIZED_KEYWORD); + break; + case TerminalTokens.TokenNametransient: + modifier = createModifier(Modifier.ModifierKeyword.TRANSIENT_KEYWORD); + break; + case TerminalTokens.TokenNamevolatile: + modifier = createModifier(Modifier.ModifierKeyword.VOLATILE_KEYWORD); + break; + case TerminalTokens.TokenNameCOMMENT_BLOCK : + case TerminalTokens.TokenNameCOMMENT_LINE : + case TerminalTokens.TokenNameCOMMENT_JAVADOC : + break; + default : + return; + } + if (modifier != null) { + variableDeclarationStatement.modifiers().add(modifier); + } + } + } catch(InvalidInputException e) { + // ignore + } + } + } + + protected QualifiedName setQualifiedNameNameAndSourceRanges(char[][] typeName, long[] positions, org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode node) { + int length = typeName.length; + final SimpleName firstToken = new SimpleName(this.ast); + firstToken.internalSetIdentifier(new String(typeName[0])); + firstToken.index = 1; + int start0 = (int)(positions[0]>>>32); + int start = start0; + int end = (int)(positions[0] & 0xFFFFFFFF); + firstToken.setSourceRange(start, end - start + 1); + final SimpleName secondToken = new SimpleName(this.ast); + secondToken.internalSetIdentifier(new String(typeName[1])); + secondToken.index = 2; + start = (int)(positions[1]>>>32); + end = (int)(positions[1] & 0xFFFFFFFF); + secondToken.setSourceRange(start, end - start + 1); + QualifiedName qualifiedName = new QualifiedName(this.ast); + qualifiedName.setQualifier(firstToken); + qualifiedName.setName(secondToken); + if (this.resolveBindings) { + recordNodes(qualifiedName, node); + recordPendingNameScopeResolution(qualifiedName); + recordNodes(firstToken, node); + recordNodes(secondToken, node); + recordPendingNameScopeResolution(firstToken); + recordPendingNameScopeResolution(secondToken); + } + qualifiedName.index = 2; + qualifiedName.setSourceRange(start0, end - start0 + 1); + SimpleName newPart = null; + for (int i = 2; i < length; i++) { + newPart = new SimpleName(this.ast); + newPart.internalSetIdentifier(new String(typeName[i])); + newPart.index = i + 1; + start = (int)(positions[i]>>>32); + end = (int)(positions[i] & 0xFFFFFFFF); + newPart.setSourceRange(start, end - start + 1); + QualifiedName qualifiedName2 = new QualifiedName(this.ast); + qualifiedName2.setQualifier(qualifiedName); + qualifiedName2.setName(newPart); + qualifiedName = qualifiedName2; + qualifiedName.index = newPart.index; + qualifiedName.setSourceRange(start0, end - start0 + 1); + if (this.resolveBindings) { + recordNodes(qualifiedName, node); + recordNodes(newPart, node); + recordPendingNameScopeResolution(qualifiedName); + recordPendingNameScopeResolution(newPart); + } + } + QualifiedName name = qualifiedName; + if (this.resolveBindings) { + recordNodes(name, node); + recordPendingNameScopeResolution(name); + } + return name; + } + + protected QualifiedName setQualifiedNameNameAndSourceRanges(char[][] typeName, long[] positions, int endingIndex, org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode node) { + int length = endingIndex + 1; + final SimpleName firstToken = new SimpleName(this.ast); + firstToken.internalSetIdentifier(new String(typeName[0])); + firstToken.index = 1; + int start0 = (int)(positions[0]>>>32); + int start = start0; + int end = (int) positions[0]; + firstToken.setSourceRange(start, end - start + 1); + final SimpleName secondToken = new SimpleName(this.ast); + secondToken.internalSetIdentifier(new String(typeName[1])); + secondToken.index = 2; + start = (int)(positions[1]>>>32); + end = (int) positions[1]; + secondToken.setSourceRange(start, end - start + 1); + QualifiedName qualifiedName = new QualifiedName(this.ast); + qualifiedName.setQualifier(firstToken); + qualifiedName.setName(secondToken); + if (this.resolveBindings) { + recordNodes(qualifiedName, node); + recordPendingNameScopeResolution(qualifiedName); + recordNodes(firstToken, node); + recordNodes(secondToken, node); + recordPendingNameScopeResolution(firstToken); + recordPendingNameScopeResolution(secondToken); + } + qualifiedName.index = 2; + qualifiedName.setSourceRange(start0, end - start0 + 1); + SimpleName newPart = null; + for (int i = 2; i < length; i++) { + newPart = new SimpleName(this.ast); + newPart.internalSetIdentifier(new String(typeName[i])); + newPart.index = i + 1; + start = (int)(positions[i]>>>32); + end = (int) positions[i]; + newPart.setSourceRange(start, end - start + 1); + QualifiedName qualifiedName2 = new QualifiedName(this.ast); + qualifiedName2.setQualifier(qualifiedName); + qualifiedName2.setName(newPart); + qualifiedName = qualifiedName2; + qualifiedName.index = newPart.index; + qualifiedName.setSourceRange(start0, end - start0 + 1); + if (this.resolveBindings) { + recordNodes(qualifiedName, node); + recordNodes(newPart, node); + recordPendingNameScopeResolution(qualifiedName); + recordPendingNameScopeResolution(newPart); + } + } + if (newPart == null && this.resolveBindings) { + recordNodes(qualifiedName, node); + recordPendingNameScopeResolution(qualifiedName); + } + return qualifiedName; + } + + + protected void setTypeForField(FieldDeclaration fieldDeclaration, Type type, int extraDimension) { + if (extraDimension != 0) { + if (type.isArrayType()) { + ArrayType arrayType = (ArrayType) type; + int remainingDimensions = arrayType.getDimensions() - extraDimension; + if (remainingDimensions == 0) { + // the dimensions are after the name so the type of the fieldDeclaration is a simpleType + Type elementType = arrayType.getElementType(); + // cut the child loose from its parent (without creating garbage) + elementType.setParent(null, null); + this.ast.getBindingResolver().updateKey(type, elementType); + fieldDeclaration.setType(elementType); + } else { + int start = type.getStartPosition(); + ArrayType subarrayType = arrayType; + int index = extraDimension; + while (index > 0) { + subarrayType = (ArrayType) subarrayType.getComponentType(); + index--; + } + int end = retrieveProperRightBracketPosition(remainingDimensions, start); + subarrayType.setSourceRange(start, end - start + 1); + // cut the child loose from its parent (without creating garbage) + subarrayType.setParent(null, null); + fieldDeclaration.setType(subarrayType); + updateInnerPositions(subarrayType, remainingDimensions); + this.ast.getBindingResolver().updateKey(type, subarrayType); + } + } else { + fieldDeclaration.setType(type); + } + } else { + if (type.isArrayType()) { + // update positions of the component types of the array type + int dimensions = ((ArrayType) type).getDimensions(); + updateInnerPositions(type, dimensions); + } + fieldDeclaration.setType(type); + } + } + + protected void setTypeForMethodDeclaration(FunctionDeclaration methodDeclaration, Type type, int extraDimension) { + if (extraDimension != 0) { + if (type.isArrayType()) { + ArrayType arrayType = (ArrayType) type; + int remainingDimensions = arrayType.getDimensions() - extraDimension; + if (remainingDimensions == 0) { + // the dimensions are after the name so the type of the fieldDeclaration is a simpleType + Type elementType = arrayType.getElementType(); + // cut the child loose from its parent (without creating garbage) + elementType.setParent(null, null); + this.ast.getBindingResolver().updateKey(type, elementType); + switch(this.ast.apiLevel) { + case AST.JLS2_INTERNAL : + methodDeclaration.internalSetReturnType(elementType); + break; + case AST.JLS3 : + methodDeclaration.setReturnType2(elementType); + break; + } + } else { + int start = type.getStartPosition(); + ArrayType subarrayType = arrayType; + int index = extraDimension; + while (index > 0) { + subarrayType = (ArrayType) subarrayType.getComponentType(); + index--; + } + int end = retrieveProperRightBracketPosition(remainingDimensions, start); + subarrayType.setSourceRange(start, end - start + 1); + // cut the child loose from its parent (without creating garbage) + subarrayType.setParent(null, null); + updateInnerPositions(subarrayType, remainingDimensions); + switch(this.ast.apiLevel) { + case AST.JLS2_INTERNAL : + methodDeclaration.internalSetReturnType(subarrayType); + break; + case AST.JLS3 : + methodDeclaration.setReturnType2(subarrayType); + break; + } + this.ast.getBindingResolver().updateKey(type, subarrayType); + } + } else { + switch(this.ast.apiLevel) { + case AST.JLS2_INTERNAL : + methodDeclaration.internalSetReturnType(type); + break; + case AST.JLS3 : + methodDeclaration.setReturnType2(type); + break; + } + } + } else { + switch(this.ast.apiLevel) { + case AST.JLS2_INTERNAL : + methodDeclaration.internalSetReturnType(type); + break; + case AST.JLS3 : + methodDeclaration.setReturnType2(type); + break; + } + } + } + + protected void setTypeForSingleVariableDeclaration(SingleVariableDeclaration singleVariableDeclaration, Type type, int extraDimension) { + if (extraDimension != 0) { + if (type.isArrayType()) { + ArrayType arrayType = (ArrayType) type; + int remainingDimensions = arrayType.getDimensions() - extraDimension; + if (remainingDimensions == 0) { + // the dimensions are after the name so the type of the fieldDeclaration is a simpleType + Type elementType = arrayType.getElementType(); + // cut the child loose from its parent (without creating garbage) + elementType.setParent(null, null); + this.ast.getBindingResolver().updateKey(type, elementType); + singleVariableDeclaration.setType(elementType); + } else { + int start = type.getStartPosition(); + ArrayType subarrayType = arrayType; + int index = extraDimension; + while (index > 0) { + subarrayType = (ArrayType) subarrayType.getComponentType(); + index--; + } + int end = retrieveProperRightBracketPosition(remainingDimensions, start); + subarrayType.setSourceRange(start, end - start + 1); + // cut the child loose from its parent (without creating garbage) + subarrayType.setParent(null, null); + updateInnerPositions(subarrayType, remainingDimensions); + singleVariableDeclaration.setType(subarrayType); + this.ast.getBindingResolver().updateKey(type, subarrayType); + } + } else { + singleVariableDeclaration.setType(type); + } + } else { + singleVariableDeclaration.setType(type); + } + } + + protected void setTypeForVariableDeclarationExpression(VariableDeclarationExpression variableDeclarationExpression, Type type, int extraDimension) { + if (extraDimension != 0) { + if (type.isArrayType()) { + ArrayType arrayType = (ArrayType) type; + int remainingDimensions = arrayType.getDimensions() - extraDimension; + if (remainingDimensions == 0) { + // the dimensions are after the name so the type of the fieldDeclaration is a simpleType + Type elementType = arrayType.getElementType(); + // cut the child loose from its parent (without creating garbage) + elementType.setParent(null, null); + this.ast.getBindingResolver().updateKey(type, elementType); + variableDeclarationExpression.setType(elementType); + } else { + int start = type.getStartPosition(); + ArrayType subarrayType = arrayType; + int index = extraDimension; + while (index > 0) { + subarrayType = (ArrayType) subarrayType.getComponentType(); + index--; + } + int end = retrieveProperRightBracketPosition(remainingDimensions, start); + subarrayType.setSourceRange(start, end - start + 1); + // cut the child loose from its parent (without creating garbage) + subarrayType.setParent(null, null); + updateInnerPositions(subarrayType, remainingDimensions); + variableDeclarationExpression.setType(subarrayType); + this.ast.getBindingResolver().updateKey(type, subarrayType); + } + } else { + variableDeclarationExpression.setType(type); + } + } else { + variableDeclarationExpression.setType(type); + } + } + + protected void setTypeForVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement, Type type, int extraDimension) { + if (extraDimension != 0) { + if (type.isArrayType()) { + ArrayType arrayType = (ArrayType) type; + int remainingDimensions = arrayType.getDimensions() - extraDimension; + if (remainingDimensions == 0) { + // the dimensions are after the name so the type of the fieldDeclaration is a simpleType + Type elementType = arrayType.getElementType(); + // cut the child loose from its parent (without creating garbage) + elementType.setParent(null, null); + this.ast.getBindingResolver().updateKey(type, elementType); + variableDeclarationStatement.setType(elementType); + } else { + int start = type.getStartPosition(); + ArrayType subarrayType = arrayType; + int index = extraDimension; + while (index > 0) { + subarrayType = (ArrayType) subarrayType.getComponentType(); + index--; + } + int end = retrieveProperRightBracketPosition(remainingDimensions, start); + subarrayType.setSourceRange(start, end - start + 1); + // cut the child loose from its parent (without creating garbage) + subarrayType.setParent(null, null); + updateInnerPositions(subarrayType, remainingDimensions); + variableDeclarationStatement.setType(subarrayType); + this.ast.getBindingResolver().updateKey(type, subarrayType); + } + } else { + variableDeclarationStatement.setType(type); + } + } else { + variableDeclarationStatement.setType(type); + } + } + + protected void updateInnerPositions(Type type, int dimensions) { + if (dimensions > 1) { + // need to set positions for intermediate array type see 42839 + int start = type.getStartPosition(); + Type currentComponentType = ((ArrayType) type).getComponentType(); + int searchedDimension = dimensions - 1; + int rightBracketEndPosition = start; + while (currentComponentType.isArrayType()) { + rightBracketEndPosition = retrieveProperRightBracketPosition(searchedDimension, start); + currentComponentType.setSourceRange(start, rightBracketEndPosition - start + 1); + currentComponentType = ((ArrayType) currentComponentType).getComponentType(); + searchedDimension--; + } + } + } +} + diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTMatcher.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTMatcher.java new file mode 100644 index 0000000..a5de253 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTMatcher.java @@ -0,0 +1,2083 @@ +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core.dom; + +import java.util.Iterator; +import java.util.List; + +/** + * Concrete superclass and default implementation of an AST subtree matcher. + *

+ * For example, to compute whether two ASTs subtrees are structurally + * isomorphic, use n1.subtreeMatch(new ASTMatcher(), n2) where + * n1 and n2 are the AST root nodes of the subtrees. + *

+ *

+ * For each different concrete AST node type T there is a + * public boolean match(T node, Object other) method + * that matches the given node against another object (typically another + * AST node, although this is not essential). The default implementations + * provided by this class tests whether the other object is a node of the + * same type with structurally isomorphic child subtrees. For nodes with + * list-valued properties, the child nodes within the list are compared in + * order. For nodes with multiple properties, the child nodes are compared + * in the order that most closely corresponds to the lexical reading order + * of the source program. For instance, for a type declaration node, the + * child ordering is: name, superclass, superinterfaces, and body + * declarations. + *

+ *

+ * Subclasses may override (extend or reimplement) some or all of the + * match methods in order to define more specialized subtree + * matchers. + *

+ * + * @see org.eclipse.wst.jsdt.core.dom.ASTNode#subtreeMatch(ASTMatcher, Object) + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public class ASTMatcher { + + /** + * Indicates whether doc tags should be matched. + */ + private boolean matchDocTags; + + /** + * Creates a new AST matcher instance. + *

+ * For backwards compatibility, the matcher ignores tag + * elements below doc comments by default. Use + * {@link #ASTMatcher(boolean) ASTMatcher(true)} + * for a matcher that compares doc tags by default. + *

+ */ + public ASTMatcher() { + this(false); + } + + /** + * Creates a new AST matcher instance. + * + * @param matchDocTags true if doc comment tags are + * to be compared by default, and false otherwise + * @see #match(JSdoc,Object) + */ + public ASTMatcher(boolean matchDocTags) { + this.matchDocTags = matchDocTags; + } + + /** + * Returns whether the given lists of AST nodes match pair wise according + * to ASTNode.subtreeMatch. + *

+ * Note that this is a convenience method, useful for writing recursive + * subtree matchers. + *

+ * + * @param list1 the first list of AST nodes + * (element type: ASTNode) + * @param list2 the second list of AST nodes + * (element type: ASTNode) + * @return true if the lists have the same number of elements + * and match pair-wise according to ASTNode.subtreeMatch + * @see ASTNode#subtreeMatch(ASTMatcher matcher, Object other) + */ + public final boolean safeSubtreeListMatch(List list1, List list2) { + int size1 = list1.size(); + int size2 = list2.size(); + if (size1 != size2) { + return false; + } + for (Iterator it1 = list1.iterator(), it2 = list2.iterator(); it1.hasNext();) { + ASTNode n1 = (ASTNode) it1.next(); + ASTNode n2 = (ASTNode) it2.next(); + if (!n1.subtreeMatch(this, n2)) { + return false; + } + } + return true; + } + + /** + * Returns whether the given nodes match according to + * AST.subtreeMatch. Returns false if one or + * the other of the nodes are null. Returns true + * if both nodes are null. + *

+ * Note that this is a convenience method, useful for writing recursive + * subtree matchers. + *

+ * + * @param node1 the first AST node, or null; must be an + * instance of ASTNode + * @param node2 the second AST node, or null; must be an + * instance of ASTNode + * @return true if the nodes match according + * to AST.subtreeMatch or both are null, and + * false otherwise + * @see ASTNode#subtreeMatch(ASTMatcher, Object) + */ + public final boolean safeSubtreeMatch(Object node1, Object node2) { + if (node1 == null && node2 == null) { + return true; + } + if (node1 == null || node2 == null) { + return false; + } + // N.B. call subtreeMatch even node1==node2!=null + return ((ASTNode) node1).subtreeMatch(this, node2); + } + + /** + * Returns whether the given objects are equal according to + * equals. Returns false if either + * node is null. + * + * @param o1 the first object, or null + * @param o2 the second object, or null + * @return true if the nodes are equal according to + * equals or both null, and + * false otherwise + */ + public static boolean safeEquals(Object o1, Object o2) { + if (o1 == o2) { + return true; + } + if (o1 == null || o2 == null) { + return false; + } + return o1.equals(o2); + } + + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(AnonymousClassDeclaration node, Object other) { + if (!(other instanceof AnonymousClassDeclaration)) { + return false; + } + AnonymousClassDeclaration o = (AnonymousClassDeclaration) other; + return safeSubtreeListMatch(node.bodyDeclarations(), o.bodyDeclarations()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(ArrayAccess node, Object other) { + if (!(other instanceof ArrayAccess)) { + return false; + } + ArrayAccess o = (ArrayAccess) other; + return ( + safeSubtreeMatch(node.getArray(), o.getArray()) + && safeSubtreeMatch(node.getIndex(), o.getIndex())); + } + + /** + * Returns whether the given node and the other object object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(ArrayCreation node, Object other) { + if (!(other instanceof ArrayCreation)) { + return false; + } + ArrayCreation o = (ArrayCreation) other; + return ( + safeSubtreeMatch(node.getType(), o.getType()) + && safeSubtreeListMatch(node.dimensions(), o.dimensions()) + && safeSubtreeMatch(node.getInitializer(), o.getInitializer())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(ArrayInitializer node, Object other) { + if (!(other instanceof ArrayInitializer)) { + return false; + } + ArrayInitializer o = (ArrayInitializer) other; + return safeSubtreeListMatch(node.expressions(), o.expressions()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(ArrayType node, Object other) { + if (!(other instanceof ArrayType)) { + return false; + } + ArrayType o = (ArrayType) other; + return safeSubtreeMatch(node.getComponentType(), o.getComponentType()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(Assignment node, Object other) { + if (!(other instanceof Assignment)) { + return false; + } + Assignment o = (Assignment) other; + return ( + node.getOperator().equals(o.getOperator()) + && safeSubtreeMatch(node.getLeftHandSide(), o.getLeftHandSide()) + && safeSubtreeMatch(node.getRightHandSide(), o.getRightHandSide())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(Block node, Object other) { + if (!(other instanceof Block)) { + return false; + } + Block o = (Block) other; + return safeSubtreeListMatch(node.statements(), o.statements()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type. Subclasses may override + * this method as needed. + *

+ *

Note: {@link LineComment} and {@link BlockComment} nodes are + * not considered part of main structure of the AST. This method will + * only be called if a client goes out of their way to visit this + * kind of node explicitly. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(BlockComment node, Object other) { + if (!(other instanceof BlockComment)) { + return false; + } + return true; + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(BooleanLiteral node, Object other) { + if (!(other instanceof BooleanLiteral)) { + return false; + } + BooleanLiteral o = (BooleanLiteral) other; + return node.booleanValue() == o.booleanValue(); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(BreakStatement node, Object other) { + if (!(other instanceof BreakStatement)) { + return false; + } + BreakStatement o = (BreakStatement) other; + return safeSubtreeMatch(node.getLabel(), o.getLabel()); + } + + public boolean match(FunctionExpression node, Object other) { + if (!(other instanceof FunctionExpression)) { + return false; + } + FunctionExpression o = (FunctionExpression) other; + return + safeSubtreeMatch(node.getMethod(), o.getMethod()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(CatchClause node, Object other) { + if (!(other instanceof CatchClause)) { + return false; + } + CatchClause o = (CatchClause) other; + return ( + safeSubtreeMatch(node.getException(), o.getException()) + && safeSubtreeMatch(node.getBody(), o.getBody())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(CharacterLiteral node, Object other) { + if (!(other instanceof CharacterLiteral)) { + return false; + } + CharacterLiteral o = (CharacterLiteral) other; + return safeEquals(node.getEscapedValue(), o.getEscapedValue()); + } + + public boolean match(RegularExpressionLiteral node, Object other) { + if (!(other instanceof CharacterLiteral)) { + return false; + } + RegularExpressionLiteral o = (RegularExpressionLiteral) other; + return safeEquals(node.getRegularExpression(), o.getRegularExpression()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(ClassInstanceCreation node, Object other) { + if (!(other instanceof ClassInstanceCreation)) { + return false; + } + ClassInstanceCreation o = (ClassInstanceCreation) other; + int level = node.getAST().apiLevel; + if (level == AST.JLS2_INTERNAL) { + if (!safeSubtreeMatch(node.internalGetName(), o.internalGetName())) { + return false; + } + } + if (level >= AST.JLS3) { + if (!safeSubtreeListMatch(node.typeArguments(), o.typeArguments())) { + return false; + } + if (!safeSubtreeMatch(node.getType(), o.getType())) { + return false; + } + } + return + safeSubtreeMatch(node.getExpression(), o.getExpression()) + && safeSubtreeMatch(node.getMember(), o.getMember()) + && safeSubtreeListMatch(node.arguments(), o.arguments()) + && safeSubtreeMatch( + node.getAnonymousClassDeclaration(), + o.getAnonymousClassDeclaration()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(JavaScriptUnit node, Object other) { + if (!(other instanceof JavaScriptUnit)) { + return false; + } + JavaScriptUnit o = (JavaScriptUnit) other; + return ( + safeSubtreeMatch(node.getPackage(), o.getPackage()) + && safeSubtreeListMatch(node.imports(), o.imports()) + && safeSubtreeListMatch(node.types(), o.types())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(ConditionalExpression node, Object other) { + if (!(other instanceof ConditionalExpression)) { + return false; + } + ConditionalExpression o = (ConditionalExpression) other; + return ( + safeSubtreeMatch(node.getExpression(), o.getExpression()) + && safeSubtreeMatch(node.getThenExpression(), o.getThenExpression()) + && safeSubtreeMatch(node.getElseExpression(), o.getElseExpression())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(ConstructorInvocation node, Object other) { + if (!(other instanceof ConstructorInvocation)) { + return false; + } + ConstructorInvocation o = (ConstructorInvocation) other; + if (node.getAST().apiLevel >= AST.JLS3) { + if (!safeSubtreeListMatch(node.typeArguments(), o.typeArguments())) { + return false; + } + } + return safeSubtreeListMatch(node.arguments(), o.arguments()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(ContinueStatement node, Object other) { + if (!(other instanceof ContinueStatement)) { + return false; + } + ContinueStatement o = (ContinueStatement) other; + return safeSubtreeMatch(node.getLabel(), o.getLabel()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(DoStatement node, Object other) { + if (!(other instanceof DoStatement)) { + return false; + } + DoStatement o = (DoStatement) other; + return ( + safeSubtreeMatch(node.getExpression(), o.getExpression()) + && safeSubtreeMatch(node.getBody(), o.getBody())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(EmptyStatement node, Object other) { + if (!(other instanceof EmptyStatement)) { + return false; + } + return true; + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(EnhancedForStatement node, Object other) { + if (!(other instanceof EnhancedForStatement)) { + return false; + } + EnhancedForStatement o = (EnhancedForStatement) other; + return ( + safeSubtreeMatch(node.getParameter(), o.getParameter()) + && safeSubtreeMatch(node.getExpression(), o.getExpression()) + && safeSubtreeMatch(node.getBody(), o.getBody())); + } + + + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(ExpressionStatement node, Object other) { + if (!(other instanceof ExpressionStatement)) { + return false; + } + ExpressionStatement o = (ExpressionStatement) other; + return safeSubtreeMatch(node.getExpression(), o.getExpression()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(FieldAccess node, Object other) { + if (!(other instanceof FieldAccess)) { + return false; + } + FieldAccess o = (FieldAccess) other; + return ( + safeSubtreeMatch(node.getExpression(), o.getExpression()) + && safeSubtreeMatch(node.getName(), o.getName())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(FieldDeclaration node, Object other) { + if (!(other instanceof FieldDeclaration)) { + return false; + } + FieldDeclaration o = (FieldDeclaration) other; + int level = node.getAST().apiLevel; + if (level == AST.JLS2_INTERNAL) { + if (node.getModifiers() != o.getModifiers()) { + return false; + } + } + if (level >= AST.JLS3) { + if (!safeSubtreeListMatch(node.modifiers(), o.modifiers())) { + return false; + } + } + return + safeSubtreeMatch(node.getJavadoc(), o.getJavadoc()) + && safeSubtreeMatch(node.getType(), o.getType()) + && safeSubtreeListMatch(node.fragments(), o.fragments()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(ForStatement node, Object other) { + if (!(other instanceof ForStatement)) { + return false; + } + ForStatement o = (ForStatement) other; + return ( + safeSubtreeListMatch(node.initializers(), o.initializers()) + && safeSubtreeMatch(node.getExpression(), o.getExpression()) + && safeSubtreeListMatch(node.updaters(), o.updaters()) + && safeSubtreeMatch(node.getBody(), o.getBody())); + } + + public boolean match(ForInStatement node, Object other) { + if (!(other instanceof ForInStatement)) { + return false; + } + ForInStatement o = (ForInStatement) other; + return ( + safeSubtreeMatch(node.getIterationVariable(), o.getIterationVariable()) + && safeSubtreeMatch(node.getCollection(), o.getCollection()) + && safeSubtreeMatch(node.getBody(), o.getBody())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(IfStatement node, Object other) { + if (!(other instanceof IfStatement)) { + return false; + } + IfStatement o = (IfStatement) other; + return ( + safeSubtreeMatch(node.getExpression(), o.getExpression()) + && safeSubtreeMatch(node.getThenStatement(), o.getThenStatement()) + && safeSubtreeMatch(node.getElseStatement(), o.getElseStatement())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(ImportDeclaration node, Object other) { + if (!(other instanceof ImportDeclaration)) { + return false; + } + ImportDeclaration o = (ImportDeclaration) other; + if (node.getAST().apiLevel >= AST.JLS3) { + if (node.isStatic() != o.isStatic()) { + return false; + } + } + if (node.isFileImport() != o.isFileImport()) { + return false; + } + return ( + safeSubtreeMatch(node.getName(), o.getName()) + && node.isOnDemand() == o.isOnDemand()); + } + + + public boolean match(InferredType node, Object other) { + if (!(other instanceof InferredType)) { + return false; + } + InferredType o = (InferredType) other; + if (node.type==null || o.type==null) + return true; + + return node.type.equals(o.type); + } + + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(InfixExpression node, Object other) { + if (!(other instanceof InfixExpression)) { + return false; + } + InfixExpression o = (InfixExpression) other; + // be careful not to trigger lazy creation of extended operand lists + if (node.hasExtendedOperands() && o.hasExtendedOperands()) { + if (!safeSubtreeListMatch(node.extendedOperands(), o.extendedOperands())) { + return false; + } + } + if (node.hasExtendedOperands() != o.hasExtendedOperands()) { + return false; + } + return ( + node.getOperator().equals(o.getOperator()) + && safeSubtreeMatch(node.getLeftOperand(), o.getLeftOperand()) + && safeSubtreeMatch(node.getRightOperand(), o.getRightOperand())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(InstanceofExpression node, Object other) { + if (!(other instanceof InstanceofExpression)) { + return false; + } + InstanceofExpression o = (InstanceofExpression) other; + return ( + safeSubtreeMatch(node.getLeftOperand(), o.getLeftOperand()) + && safeSubtreeMatch(node.getRightOperand(), o.getRightOperand())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(Initializer node, Object other) { + if (!(other instanceof Initializer)) { + return false; + } + Initializer o = (Initializer) other; + int level = node.getAST().apiLevel; + if (level == AST.JLS2_INTERNAL) { + if (node.getModifiers() != o.getModifiers()) { + return false; + } + } + if (level >= AST.JLS3) { + if (!safeSubtreeListMatch(node.modifiers(), o.modifiers())) { + return false; + } + } + return ( + safeSubtreeMatch(node.getJavadoc(), o.getJavadoc()) + && safeSubtreeMatch(node.getBody(), o.getBody())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * Unlike other node types, the behavior of the default + * implementation is controlled by a constructor-supplied + * parameter {@link #ASTMatcher(boolean) ASTMatcher(boolean)} + * which is false if not specified. + * When this parameter is true, the implementation + * tests whether the other object is also a Javadoc + * with structurally isomorphic child subtrees; the comment string + * (Javadoc.getComment()) is ignored. + * Conversely, when the parameter is false, the + * implementation tests whether the other object is also a + * Javadoc with exactly the same comment string; + * the tag elements ({@link JSdoc#tags() Javadoc.tags} are + * ignored. Subclasses may reimplement. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + * @see #ASTMatcher() + * @see #ASTMatcher(boolean) + */ + public boolean match(JSdoc node, Object other) { + if (!(other instanceof JSdoc)) { + return false; + } + JSdoc o = (JSdoc) other; + if (this.matchDocTags) { + return safeSubtreeListMatch(node.tags(), o.tags()); + } else { + return compareDeprecatedComment(node, o); + } + } + + /** + * Return whether the deprecated comment strings of the given jsdoc are equals. + *

+ * Note the only purpose of this method is to hide deprecated warnings. + * @deprecated mark deprecated to hide deprecated usage + */ + private boolean compareDeprecatedComment(JSdoc first, JSdoc second) { + if (first.getAST().apiLevel == AST.JLS2_INTERNAL) { + return safeEquals(first.getComment(), second.getComment()); + } else { + return true; + } + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(LabeledStatement node, Object other) { + if (!(other instanceof LabeledStatement)) { + return false; + } + LabeledStatement o = (LabeledStatement) other; + return ( + safeSubtreeMatch(node.getLabel(), o.getLabel()) + && safeSubtreeMatch(node.getBody(), o.getBody())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type. Subclasses may override + * this method as needed. + *

+ *

Note: {@link LineComment} and {@link BlockComment} nodes are + * not considered part of main structure of the AST. This method will + * only be called if a client goes out of their way to visit this + * kind of node explicitly. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(LineComment node, Object other) { + if (!(other instanceof LineComment)) { + return false; + } + return true; + } + + public boolean match(ListExpression node, Object other) { + if (!(other instanceof ListExpression)) { + return false; + } + ListExpression o = (ListExpression) other; + return safeSubtreeListMatch(node.expressions(), o.expressions()); + } + + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(MemberRef node, Object other) { + if (!(other instanceof MemberRef)) { + return false; + } + MemberRef o = (MemberRef) other; + return ( + safeSubtreeMatch(node.getQualifier(), o.getQualifier()) + && safeSubtreeMatch(node.getName(), o.getName())); + } + + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(FunctionRef node, Object other) { + if (!(other instanceof FunctionRef)) { + return false; + } + FunctionRef o = (FunctionRef) other; + return ( + safeSubtreeMatch(node.getQualifier(), o.getQualifier()) + && safeSubtreeMatch(node.getName(), o.getName()) + && safeSubtreeListMatch(node.parameters(), o.parameters())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(FunctionRefParameter node, Object other) { + if (!(other instanceof FunctionRefParameter)) { + return false; + } + FunctionRefParameter o = (FunctionRefParameter) other; + int level = node.getAST().apiLevel; + if (level >= AST.JLS3) { + if (node.isVarargs() != o.isVarargs()) { + return false; + } + } + return ( + safeSubtreeMatch(node.getType(), o.getType()) + && safeSubtreeMatch(node.getName(), o.getName())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ *

+ * Note that extra array dimensions are compared since they are an + * important part of the method declaration. + *

+ *

+ * Note that the method return types are compared even for constructor + * declarations. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(FunctionDeclaration node, Object other) { + if (!(other instanceof FunctionDeclaration)) { + return false; + } + FunctionDeclaration o = (FunctionDeclaration) other; + int level = node.getAST().apiLevel; + if (level == AST.JLS2_INTERNAL) { + if (node.getModifiers() != o.getModifiers()) { + return false; + } + if (!safeSubtreeMatch(node.internalGetReturnType(), o.internalGetReturnType())) { + return false; + } + } + if (level >= AST.JLS3) { + if (!safeSubtreeListMatch(node.modifiers(), o.modifiers())) { + return false; + } + if (!safeSubtreeMatch(node.getReturnType2(), o.getReturnType2())) { + return false; + } + } + return ((node.isConstructor() == o.isConstructor()) + && safeSubtreeMatch(node.getJavadoc(), o.getJavadoc()) + && safeSubtreeMatch(node.getName(), o.getName()) + // n.b. compare return type even for constructors + && safeSubtreeListMatch(node.parameters(), o.parameters()) + && node.getExtraDimensions() == o.getExtraDimensions() + && safeSubtreeListMatch(node.thrownExceptions(), o.thrownExceptions()) + && safeSubtreeMatch(node.getBody(), o.getBody())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(FunctionInvocation node, Object other) { + if (!(other instanceof FunctionInvocation)) { + return false; + } + FunctionInvocation o = (FunctionInvocation) other; + if (node.getAST().apiLevel >= AST.JLS3) { + if (!safeSubtreeListMatch(node.typeArguments(), o.typeArguments())) { + return false; + } + } + return ( + safeSubtreeMatch(node.getExpression(), o.getExpression()) + && safeSubtreeMatch(node.getName(), o.getName()) + && safeSubtreeListMatch(node.arguments(), o.arguments())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(Modifier node, Object other) { + if (!(other instanceof Modifier)) { + return false; + } + Modifier o = (Modifier) other; + return (node.getKeyword() == o.getKeyword()); + } + + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(NullLiteral node, Object other) { + if (!(other instanceof NullLiteral)) { + return false; + } + return true; + } + + public boolean match(UndefinedLiteral node, Object other) { + if (!(other instanceof UndefinedLiteral)) { + return false; + } + return true; + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(NumberLiteral node, Object other) { + if (!(other instanceof NumberLiteral)) { + return false; + } + NumberLiteral o = (NumberLiteral) other; + return safeEquals(node.getToken(), o.getToken()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(PackageDeclaration node, Object other) { + if (!(other instanceof PackageDeclaration)) { + return false; + } + PackageDeclaration o = (PackageDeclaration) other; + if (node.getAST().apiLevel >= AST.JLS3) { + if (!safeSubtreeMatch(node.getJavadoc(), o.getJavadoc())) { + return false; + } + if (!safeSubtreeListMatch(node.annotations(), o.annotations())) { + return false; + } + } + return safeSubtreeMatch(node.getName(), o.getName()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(ParenthesizedExpression node, Object other) { + if (!(other instanceof ParenthesizedExpression)) { + return false; + } + ParenthesizedExpression o = (ParenthesizedExpression) other; + return safeSubtreeMatch(node.getExpression(), o.getExpression()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(PostfixExpression node, Object other) { + if (!(other instanceof PostfixExpression)) { + return false; + } + PostfixExpression o = (PostfixExpression) other; + return ( + node.getOperator().equals(o.getOperator()) + && safeSubtreeMatch(node.getOperand(), o.getOperand())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(PrefixExpression node, Object other) { + if (!(other instanceof PrefixExpression)) { + return false; + } + PrefixExpression o = (PrefixExpression) other; + return ( + node.getOperator().equals(o.getOperator()) + && safeSubtreeMatch(node.getOperand(), o.getOperand())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(PrimitiveType node, Object other) { + if (!(other instanceof PrimitiveType)) { + return false; + } + PrimitiveType o = (PrimitiveType) other; + return (node.getPrimitiveTypeCode() == o.getPrimitiveTypeCode()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(QualifiedName node, Object other) { + if (!(other instanceof QualifiedName)) { + return false; + } + QualifiedName o = (QualifiedName) other; + return ( + safeSubtreeMatch(node.getQualifier(), o.getQualifier()) + && safeSubtreeMatch(node.getName(), o.getName())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(QualifiedType node, Object other) { + if (!(other instanceof QualifiedType)) { + return false; + } + QualifiedType o = (QualifiedType) other; + return ( + safeSubtreeMatch(node.getQualifier(), o.getQualifier()) + && safeSubtreeMatch(node.getName(), o.getName())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(ReturnStatement node, Object other) { + if (!(other instanceof ReturnStatement)) { + return false; + } + ReturnStatement o = (ReturnStatement) other; + return safeSubtreeMatch(node.getExpression(), o.getExpression()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(SimpleName node, Object other) { + if (!(other instanceof SimpleName)) { + return false; + } + SimpleName o = (SimpleName) other; + return node.getIdentifier().equals(o.getIdentifier()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(SimpleType node, Object other) { + if (!(other instanceof SimpleType)) { + return false; + } + SimpleType o = (SimpleType) other; + return safeSubtreeMatch(node.getName(), o.getName()); + } + + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ *

+ * Note that extra array dimensions and the variable arity flag + * are compared since they are both important parts of the declaration. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(SingleVariableDeclaration node, Object other) { + if (!(other instanceof SingleVariableDeclaration)) { + return false; + } + SingleVariableDeclaration o = (SingleVariableDeclaration) other; + int level = node.getAST().apiLevel; + if (level == AST.JLS2_INTERNAL) { + if (node.getModifiers() != o.getModifiers()) { + return false; + } + } + if (level >= AST.JLS3) { + if (!safeSubtreeListMatch(node.modifiers(), o.modifiers())) { + return false; + } + if (node.isVarargs() != o.isVarargs()) { + return false; + } + } + return + safeSubtreeMatch(node.getType(), o.getType()) + && safeSubtreeMatch(node.getName(), o.getName()) + && node.getExtraDimensions() == o.getExtraDimensions() + && safeSubtreeMatch(node.getInitializer(), o.getInitializer()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(StringLiteral node, Object other) { + if (!(other instanceof StringLiteral)) { + return false; + } + StringLiteral o = (StringLiteral) other; + return safeEquals(node.getEscapedValue(), o.getEscapedValue()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(SuperConstructorInvocation node, Object other) { + if (!(other instanceof SuperConstructorInvocation)) { + return false; + } + SuperConstructorInvocation o = (SuperConstructorInvocation) other; + if (node.getAST().apiLevel >= AST.JLS3) { + if (!safeSubtreeListMatch(node.typeArguments(), o.typeArguments())) { + return false; + } + } + return ( + safeSubtreeMatch(node.getExpression(), o.getExpression()) + && safeSubtreeListMatch(node.arguments(), o.arguments())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(SuperFieldAccess node, Object other) { + if (!(other instanceof SuperFieldAccess)) { + return false; + } + SuperFieldAccess o = (SuperFieldAccess) other; + return ( + safeSubtreeMatch(node.getName(), o.getName()) + && safeSubtreeMatch(node.getQualifier(), o.getQualifier())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(SuperMethodInvocation node, Object other) { + if (!(other instanceof SuperMethodInvocation)) { + return false; + } + SuperMethodInvocation o = (SuperMethodInvocation) other; + if (node.getAST().apiLevel >= AST.JLS3) { + if (!safeSubtreeListMatch(node.typeArguments(), o.typeArguments())) { + return false; + } + } + return ( + safeSubtreeMatch(node.getQualifier(), o.getQualifier()) + && safeSubtreeMatch(node.getName(), o.getName()) + && safeSubtreeListMatch(node.arguments(), o.arguments())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(SwitchCase node, Object other) { + if (!(other instanceof SwitchCase)) { + return false; + } + SwitchCase o = (SwitchCase) other; + return safeSubtreeMatch(node.getExpression(), o.getExpression()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(SwitchStatement node, Object other) { + if (!(other instanceof SwitchStatement)) { + return false; + } + SwitchStatement o = (SwitchStatement) other; + return ( + safeSubtreeMatch(node.getExpression(), o.getExpression()) + && safeSubtreeListMatch(node.statements(), o.statements())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(TagElement node, Object other) { + if (!(other instanceof TagElement)) { + return false; + } + TagElement o = (TagElement) other; + return ( + safeEquals(node.getTagName(), o.getTagName()) + && safeSubtreeListMatch(node.fragments(), o.fragments())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(TextElement node, Object other) { + if (!(other instanceof TextElement)) { + return false; + } + TextElement o = (TextElement) other; + return safeEquals(node.getText(), o.getText()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(ThisExpression node, Object other) { + if (!(other instanceof ThisExpression)) { + return false; + } + ThisExpression o = (ThisExpression) other; + return safeSubtreeMatch(node.getQualifier(), o.getQualifier()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(ThrowStatement node, Object other) { + if (!(other instanceof ThrowStatement)) { + return false; + } + ThrowStatement o = (ThrowStatement) other; + return safeSubtreeMatch(node.getExpression(), o.getExpression()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(TryStatement node, Object other) { + if (!(other instanceof TryStatement)) { + return false; + } + TryStatement o = (TryStatement) other; + return ( + safeSubtreeMatch(node.getBody(), o.getBody()) + && safeSubtreeListMatch(node.catchClauses(), o.catchClauses()) + && safeSubtreeMatch(node.getFinally(), o.getFinally())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(TypeDeclaration node, Object other) { + if (!(other instanceof TypeDeclaration)) { + return false; + } + TypeDeclaration o = (TypeDeclaration) other; + int level = node.getAST().apiLevel; + if (level == AST.JLS2_INTERNAL) { + if (node.getModifiers() != o.getModifiers()) { + return false; + } + if (!safeSubtreeMatch(node.internalGetSuperclass(), o.internalGetSuperclass())) { + return false; + } + } + if (level >= AST.JLS3) { + if (!safeSubtreeListMatch(node.modifiers(), o.modifiers())) { + return false; + } + if (!safeSubtreeMatch(node.getSuperclassType(), o.getSuperclassType())) { + return false; + } + } + return ( + safeSubtreeMatch(node.getJavadoc(), o.getJavadoc()) + && safeSubtreeMatch(node.getName(), o.getName()) + && safeSubtreeListMatch(node.bodyDeclarations(), o.bodyDeclarations())); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(TypeDeclarationStatement node, Object other) { + if (!(other instanceof TypeDeclarationStatement)) { + return false; + } + TypeDeclarationStatement o = (TypeDeclarationStatement) other; + return safeSubtreeMatch(node.getDeclaration(), o.getDeclaration()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(TypeLiteral node, Object other) { + if (!(other instanceof TypeLiteral)) { + return false; + } + TypeLiteral o = (TypeLiteral) other; + return safeSubtreeMatch(node.getType(), o.getType()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(VariableDeclarationExpression node, Object other) { + if (!(other instanceof VariableDeclarationExpression)) { + return false; + } + VariableDeclarationExpression o = (VariableDeclarationExpression) other; + int level = node.getAST().apiLevel; + if (level == AST.JLS2_INTERNAL) { + if (node.getModifiers() != o.getModifiers()) { + return false; + } + } + if (level >= AST.JLS3) { + if (!safeSubtreeListMatch(node.modifiers(), o.modifiers())) { + return false; + } + } + return safeSubtreeMatch(node.getType(), o.getType()) + && safeSubtreeListMatch(node.fragments(), o.fragments()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ *

+ * Note that extra array dimensions are compared since they are an + * important part of the type of the variable. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(VariableDeclarationFragment node, Object other) { + if (!(other instanceof VariableDeclarationFragment)) { + return false; + } + VariableDeclarationFragment o = (VariableDeclarationFragment) other; + return safeSubtreeMatch(node.getName(), o.getName()) + && node.getExtraDimensions() == o.getExtraDimensions() + && safeSubtreeMatch(node.getInitializer(), o.getInitializer()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(VariableDeclarationStatement node, Object other) { + if (!(other instanceof VariableDeclarationStatement)) { + return false; + } + VariableDeclarationStatement o = (VariableDeclarationStatement) other; + int level = node.getAST().apiLevel; + if (level == AST.JLS2_INTERNAL) { + if (node.getModifiers() != o.getModifiers()) { + return false; + } + } + if (level >= AST.JLS3) { + if (!safeSubtreeListMatch(node.modifiers(), o.modifiers())) { + return false; + } + } + return safeSubtreeMatch(node.getType(), o.getType()) + && safeSubtreeListMatch(node.fragments(), o.fragments()); + } + + /** + * Returns whether the given node and the other object match. + *

+ * The default implementation provided by this class tests whether the + * other object is a node of the same type with structurally isomorphic + * child subtrees. Subclasses may override this method as needed. + *

+ * + * @param node the node + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match or the other object has a + * different node type or is null + */ + public boolean match(WhileStatement node, Object other) { + if (!(other instanceof WhileStatement)) { + return false; + } + WhileStatement o = (WhileStatement) other; + return ( + safeSubtreeMatch(node.getExpression(), o.getExpression()) + && safeSubtreeMatch(node.getBody(), o.getBody())); + } + + public boolean match(WithStatement node, Object other) { + if (!(other instanceof WithStatement)) { + return false; + } + WithStatement o = (WithStatement) other; + return ( + safeSubtreeMatch(node.getExpression(), o.getExpression()) + && safeSubtreeMatch(node.getBody(), o.getBody())); + } + + public boolean match(ObjectLiteral node, Object other) { + if (!(other instanceof ObjectLiteral)) { + return false; + } + ObjectLiteral o = (ObjectLiteral) other; + return safeSubtreeListMatch(node.fields(), o.fields()); + } + + public boolean match(ObjectLiteralField node, Object other) { + if (!(other instanceof ObjectLiteralField)) { + return false; + } + ObjectLiteralField o = (ObjectLiteralField) other; + return safeSubtreeMatch(node.getFieldName(), o.getFieldName()) + && safeSubtreeMatch(node.getInitializer(), o.getInitializer()); + } + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTNode.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTNode.java new file mode 100644 index 0000000..2c7b0b1 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTNode.java @@ -0,0 +1,2635 @@ +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * bug 227489 - Etienne Pfister + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.dom; + +import java.util.AbstractList; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * Abstract superclass of all Abstract Syntax Tree (AST) node types. + *

+ * An AST node represents a JavaScript source code construct, such + * as a name, type, expression, statement, or declaration. + *

+ *

+ * Each AST node belongs to a unique AST instance, called the owning AST. + * The children of an AST node always have the same owner as their parent node. + * If a node from one AST is to be added to a different AST, the subtree must + * be cloned first to ensure that the added nodes have the correct owning AST. + *

+ *

+ * When an AST node is part of an AST, it has a unique parent node. + * Clients can navigate upwards, from child to parent, as well as downwards, + * from parent to child. Newly created nodes are unparented. When an + * unparented node is set as a child of a node (using a + * setCHILD method), its parent link is set automatically + * and the parent link of the former child is set to null. + * For nodes with properties that include a list of children (for example, + * Block whose statements property is a list + * of statements), adding or removing an element to/for the list property + * automatically updates the parent links. These lists support the + * List.set method; however, the constraint that the same + * node cannot appear more than once means that this method cannot be used + * to swap elements without first removing the node. + *

+ *

+ * ASTs must not contain cycles. All operations that could create a cycle + * detect this possibility and fail. + *

+ *

+ * ASTs do not contain "holes" (missing subtrees). If a node is required to + * have a certain property, a syntactically plausible initial value is + * always supplied. + *

+ *

+ * The hierarchy of AST node types has some convenient groupings marked + * by abstract superclasses: + *

    + *
  • expressions - Expression
  • + *
  • names - Name (a sub-kind of expression)
  • + *
  • statements - Statement
  • + *
  • types - Type
  • + *
  • type body declarations - BodyDeclaration
  • + *
+ *

+ *

+ * Abstract syntax trees may be hand constructed by clients, using the + * newTYPE factory methods (see AST) to + * create new nodes, and the various setCHILD methods + * to connect them together. + *

+ *

+ * The class {@link ASTParser} parses a string + * containing a JavaScript source code and returns an abstract syntax tree + * for it. The resulting nodes carry source ranges relating the node back to + * the original source characters. The source range covers the construct + * as a whole. + *

+ *

+ * Each AST node carries bit flags, which may convey additional information about + * the node. For instance, the parser uses a flag to indicate a syntax error. + * Newly created nodes have no flags set. + *

+ *

+ * Each AST node is capable of carrying an open-ended collection of + * client-defined properties. Newly created nodes have none. + * getProperty and setProperty are used to access + * these properties. + *

+ *

+ * AST nodes are thread-safe for readers provided there are no active writers. + * If one thread is modifying an AST, including creating new nodes or cloning + * existing ones, it is not safe for another thread to read, visit, + * write, create, or clone any of the nodes on the same AST. + * When synchronization is required, consider using the common AST + * object that owns the node; that is, use + * synchronize (node.getAST()) {...}. + *

+ *

+ * ASTs also support the visitor pattern; see the class ASTVisitor + * for details. + *

+ *

+ * JavaScript units created by ASTParser from a + * source document can be serialized after arbitrary modifications + * with minimal loss of original formatting. See + * {@link JavaScriptUnit#recordModifications()} for details. + * See also {@link org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite} for + * an alternative way to describe and serialize changes to a + * read-only AST. + *

+ * This class is not intended to be subclassed by clients. + * + * @see ASTParser + * @see ASTVisitor + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public abstract class ASTNode { + /* + * INSTRUCTIONS FOR ADDING NEW CONCRETE AST NODE TYPES + * + * There are several things that need to be changed when a + * new concrete AST node type (call it "FooBar"): + * + * 1. Create the FooBar AST node type class. + * The most effective way to do this is to copy a similar + * existing concrete node class to get a template that + * includes all the framework methods that must be implemented. + * + * 2. Add node type constant ASTNode.FOO_BAR. + * Node constants are numbered consecutively. Add the + * constant after the existing ones. + * + * 3. Add entry to ASTNode.nodeClassForType(int). + * + * 4. Add AST.newFooBar() factory method. + * + * 5. Add ASTVisitor.visit(FooBar) and endVisit(FooBar) methods. + * + * 6. Add ASTMatcher.match(FooBar,Object) method. + * + * 7. Ensure that SimpleName.isDeclaration() covers FooBar + * nodes if required. + * + * 8. Add NaiveASTFlattener.visit(FooBar) method to illustrate + * how these nodes should be serialized. + * + * 9. Update the AST test suites. + * + * The next steps are to update AST.parse* to start generating + * the new type of nodes, and ASTRewrite to serialize them back out. + */ + + /** + * Node type constant indicating a node of type + * AnonymousClassDeclaration. + * @see AnonymousClassDeclaration + */ + public static final int ANONYMOUS_CLASS_DECLARATION = 1; + + /** + * Node type constant indicating a node of type + * ArrayAccess. + * @see ArrayAccess + */ + public static final int ARRAY_ACCESS = 2; + + /** + * Node type constant indicating a node of type + * ArrayCreation. + * @see ArrayCreation + */ + public static final int ARRAY_CREATION = 3; + + /** + * Node type constant indicating a node of type + * ArrayInitializer. + * @see ArrayInitializer + */ + public static final int ARRAY_INITIALIZER = 4; + + /** + * Node type constant indicating a node of type + * ArrayType. + * @see ArrayType + */ + public static final int ARRAY_TYPE = 5; + + /** + * Node type constant indicating a node of type + * Assignment. + * @see Assignment + */ + public static final int ASSIGNMENT = 7; + + /** + * Node type constant indicating a node of type + * Block. + * @see Block + */ + public static final int BLOCK = 8; + + /** + * Node type constant indicating a node of type + * BooleanLiteral. + * @see BooleanLiteral + */ + public static final int BOOLEAN_LITERAL = 9; + + /** + * Node type constant indicating a node of type + * BreakStatement. + * @see BreakStatement + */ + public static final int BREAK_STATEMENT = 10; + + /** + * Node type constant indicating a node of type + * CatchClause. + * @see CatchClause + */ + public static final int CATCH_CLAUSE = 12; + + /** + * Node type constant indicating a node of type + * CharacterLiteral. + * @see CharacterLiteral + */ + public static final int CHARACTER_LITERAL = 13; + + /** + * Node type constant indicating a node of type + * ClassInstanceCreation. + * @see ClassInstanceCreation + */ + public static final int CLASS_INSTANCE_CREATION = 14; + + /** + * Node type constant indicating a node of type + * JavaScriptUnit. + * @see JavaScriptUnit + */ + public static final int JAVASCRIPT_UNIT = 15; + + /** + * Node type constant indicating a node of type + * ConditionalExpression. + * @see ConditionalExpression + */ + public static final int CONDITIONAL_EXPRESSION = 16; + + /** + * Node type constant indicating a node of type + * ConstructorInvocation. + * @see ConstructorInvocation + */ + public static final int CONSTRUCTOR_INVOCATION = 17; + + /** + * Node type constant indicating a node of type + * ContinueStatement. + * @see ContinueStatement + */ + public static final int CONTINUE_STATEMENT = 18; + + /** + * Node type constant indicating a node of type + * DoStatement. + * @see DoStatement + */ + public static final int DO_STATEMENT = 19; + + /** + * Node type constant indicating a node of type + * EmptyStatement. + * @see EmptyStatement + */ + public static final int EMPTY_STATEMENT = 20; + + /** + * Node type constant indicating a node of type + * ExpressionStatement. + * @see ExpressionStatement + */ + public static final int EXPRESSION_STATEMENT = 21; + + /** + * Node type constant indicating a node of type + * FieldAccess. + * @see FieldAccess + */ + public static final int FIELD_ACCESS = 22; + + /** + * Node type constant indicating a node of type + * FieldDeclaration. + * @see FieldDeclaration + */ + public static final int FIELD_DECLARATION = 23; + + /** + * Node type constant indicating a node of type + * ForStatement. + * @see ForStatement + */ + public static final int FOR_STATEMENT = 24; + + /** + * Node type constant indicating a node of type + * IfStatement. + * @see IfStatement + */ + public static final int IF_STATEMENT = 25; + + /** + * Node type constant indicating a node of type + * ImportDeclaration. + * @see ImportDeclaration + */ + public static final int IMPORT_DECLARATION = 26; + + /** + * Node type constant indicating a node of type + * InfixExpression. + * @see InfixExpression + */ + public static final int INFIX_EXPRESSION = 27; + + /** + * Node type constant indicating a node of type + * Initializer. + * @see Initializer + */ + public static final int INITIALIZER = 28; + + /** + * Node type constant indicating a node of type + * Javadoc. + * @see JSdoc + */ + public static final int JSDOC = 29; + + /** + * Node type constant indicating a node of type + * LabeledStatement. + * @see LabeledStatement + */ + public static final int LABELED_STATEMENT = 30; + + /** + * Node type constant indicating a node of type + * FunctionDeclaration. + * @see FunctionDeclaration + */ + public static final int FUNCTION_DECLARATION = 31; + + /** + * Node type constant indicating a node of type + * FunctionInvocation. + * @see FunctionInvocation + */ + public static final int FUNCTION_INVOCATION = 32; + + /** + * Node type constant indicating a node of type + * NullLiteral. + * @see NullLiteral + */ + public static final int NULL_LITERAL = 33; + + /** + * Node type constant indicating a node of type + * NumberLiteral. + * @see NumberLiteral + */ + public static final int NUMBER_LITERAL = 34; + + /** + * Node type constant indicating a node of type + * PackageDeclaration. + * @see PackageDeclaration + */ + public static final int PACKAGE_DECLARATION = 35; + + /** + * Node type constant indicating a node of type + * ParenthesizedExpression. + * @see ParenthesizedExpression + */ + public static final int PARENTHESIZED_EXPRESSION = 36; + + /** + * Node type constant indicating a node of type + * PostfixExpression. + * @see PostfixExpression + */ + public static final int POSTFIX_EXPRESSION = 37; + + /** + * Node type constant indicating a node of type + * PrefixExpression. + * @see PrefixExpression + */ + public static final int PREFIX_EXPRESSION = 38; + + /** + * Node type constant indicating a node of type + * PrimitiveType. + * @see PrimitiveType + */ + public static final int PRIMITIVE_TYPE = 39; + + /** + * Node type constant indicating a node of type + * QualifiedName. + * @see QualifiedName + */ + public static final int QUALIFIED_NAME = 40; + + /** + * Node type constant indicating a node of type + * ReturnStatement. + * @see ReturnStatement + */ + public static final int RETURN_STATEMENT = 41; + + /** + * Node type constant indicating a node of type + * SimpleName. + * @see SimpleName + */ + public static final int SIMPLE_NAME = 42; + + /** + * Node type constant indicating a node of type + * SimpleType. + * @see SimpleType + */ + public static final int SIMPLE_TYPE = 43; + + /** + * Node type constant indicating a node of type + * SingleVariableDeclaration. + * @see SingleVariableDeclaration + */ + public static final int SINGLE_VARIABLE_DECLARATION = 44; + + /** + * Node type constant indicating a node of type + * StringLiteral. + * @see StringLiteral + */ + public static final int STRING_LITERAL = 45; + + /** + * Node type constant indicating a node of type + * SuperConstructorInvocation. + * @see SuperConstructorInvocation + */ + public static final int SUPER_CONSTRUCTOR_INVOCATION = 46; + + /** + * Node type constant indicating a node of type + * SuperFieldAccess. + * @see SuperFieldAccess + */ + public static final int SUPER_FIELD_ACCESS = 47; + + /** + * Node type constant indicating a node of type + * SuperMethodInvocation. + * @see SuperMethodInvocation + */ + public static final int SUPER_METHOD_INVOCATION = 48; + + /** + * Node type constant indicating a node of type + * SwitchCase. + * @see SwitchCase + */ + public static final int SWITCH_CASE = 49; + + /** + * Node type constant indicating a node of type + * SwitchStatement. + * @see SwitchStatement + */ + public static final int SWITCH_STATEMENT = 50; + + /** + * Node type constant indicating a node of type + * ThisExpression. + * @see ThisExpression + */ + public static final int THIS_EXPRESSION = 52; + + /** + * Node type constant indicating a node of type + * ThrowStatement. + * @see ThrowStatement + */ + public static final int THROW_STATEMENT = 53; + + /** + * Node type constant indicating a node of type + * TryStatement. + * @see TryStatement + */ + public static final int TRY_STATEMENT = 54; + + /** + * Node type constant indicating a node of type + * TypeDeclaration. + * @see TypeDeclaration + */ + public static final int TYPE_DECLARATION = 55; + + /** + * Node type constant indicating a node of type + * TypeDeclarationStatement. + * @see TypeDeclarationStatement + */ + public static final int TYPE_DECLARATION_STATEMENT = 56; + + /** + * Node type constant indicating a node of type + * TypeLiteral. + * @see TypeLiteral + */ + public static final int TYPE_LITERAL = 57; + + /** + * Node type constant indicating a node of type + * VariableDeclarationExpression. + * @see VariableDeclarationExpression + */ + public static final int VARIABLE_DECLARATION_EXPRESSION = 58; + + /** + * Node type constant indicating a node of type + * VariableDeclarationFragment. + * @see VariableDeclarationFragment + */ + public static final int VARIABLE_DECLARATION_FRAGMENT = 59; + + /** + * Node type constant indicating a node of type + * VariableDeclarationStatement. + * @see VariableDeclarationStatement + */ + public static final int VARIABLE_DECLARATION_STATEMENT = 60; + + /** + * Node type constant indicating a node of type + * WhileStatement. + * @see WhileStatement + */ + public static final int WHILE_STATEMENT = 61; + + /** + * Node type constant indicating a node of type + * InstanceofExpression. + * @see InstanceofExpression + */ + public static final int INSTANCEOF_EXPRESSION = 62; + + /** + * Node type constant indicating a node of type + * LineComment. + * @see LineComment + */ + public static final int LINE_COMMENT = 63; + + /** + * Node type constant indicating a node of type + * BlockComment. + * @see BlockComment + * + */ + public static final int BLOCK_COMMENT = 64; + + /** + * Node type constant indicating a node of type + * TagElement. + * @see TagElement + * + */ + public static final int TAG_ELEMENT = 65; + + /** + * Node type constant indicating a node of type + * TextElement. + * @see TextElement + * + */ + public static final int TEXT_ELEMENT = 66; + + /** + * Node type constant indicating a node of type + * MemberRef. + * @see MemberRef + * + */ + public static final int MEMBER_REF = 67; + + /** + * Node type constant indicating a node of type + * FunctionRef. + * @see FunctionRef + * + */ + public static final int FUNCTION_REF = 68; + + /** + * Node type constant indicating a node of type + * FunctionRefParameter. + * @see FunctionRefParameter + * + */ + public static final int FUNCTION_REF_PARAMETER = 69; + + /** + * Node type constant indicating a node of type + * EnhancedForStatement. + * @see EnhancedForStatement + * + */ + public static final int ENHANCED_FOR_STATEMENT = 70; + + /** + * Node type constant indicating a node of type + * QualifiedType. + * @see QualifiedType + * + */ + public static final int QUALIFIED_TYPE = 75; + + + public static final int FOR_IN_STATEMENT = 83; + public static final int FUNCTION_EXPRESSION = 84; + public static final int OBJECT_LITERAL = 85; + public static final int OBJECT_LITERAL_FIELD = 86; + public static final int UNDEFINED_LITERAL = 87; + public static final int REGULAR_EXPRESSION_LITERAL = 88; + public static final int INFERRED_TYPE = 89; + public static final int WITH_STATEMENT = 90; + public static final int LIST_EXPRESSION = 91; + public static final int EMPTY_EXPRESSION = 92; + + + + + + /** + * Node type constant indicating a node of type + * Modifier. + * @see Modifier + */ + public static final int MODIFIER = 100; + + /** + * Returns the node class for the corresponding node type. + * + * @param nodeType AST node type + * @return the corresponding ASTNode subclass + * @exception IllegalArgumentException if nodeType is + * not a legal AST node type + * @see #getNodeType() + */ + public static Class nodeClassForType(int nodeType) { + switch (nodeType) { + case ANONYMOUS_CLASS_DECLARATION : + return AnonymousClassDeclaration.class; + case ARRAY_ACCESS : + return ArrayAccess.class; + case ARRAY_CREATION : + return ArrayCreation.class; + case ARRAY_INITIALIZER : + return ArrayInitializer.class; + case ARRAY_TYPE : + return ArrayType.class; + case ASSIGNMENT : + return Assignment.class; + case BLOCK : + return Block.class; + case BLOCK_COMMENT : + return BlockComment.class; + case BOOLEAN_LITERAL : + return BooleanLiteral.class; + case BREAK_STATEMENT : + return BreakStatement.class; + case CATCH_CLAUSE : + return CatchClause.class; + case CHARACTER_LITERAL : + return CharacterLiteral.class; + case CLASS_INSTANCE_CREATION : + return ClassInstanceCreation.class; + case JAVASCRIPT_UNIT : + return JavaScriptUnit.class; + case CONDITIONAL_EXPRESSION : + return ConditionalExpression.class; + case CONSTRUCTOR_INVOCATION : + return ConstructorInvocation.class; + case CONTINUE_STATEMENT : + return ContinueStatement.class; + case DO_STATEMENT : + return DoStatement.class; + case EMPTY_STATEMENT : + return EmptyStatement.class; + case ENHANCED_FOR_STATEMENT : + return EnhancedForStatement.class; + case EXPRESSION_STATEMENT : + return ExpressionStatement.class; + case FIELD_ACCESS : + return FieldAccess.class; + case FIELD_DECLARATION : + return FieldDeclaration.class; + case FOR_STATEMENT : + return ForStatement.class; + case FOR_IN_STATEMENT: + return ForInStatement.class; + case IF_STATEMENT : + return IfStatement.class; + case IMPORT_DECLARATION : + return ImportDeclaration.class; + case INFIX_EXPRESSION : + return InfixExpression.class; + case INITIALIZER : + return Initializer.class; + case INSTANCEOF_EXPRESSION : + return InstanceofExpression.class; + case JSDOC : + return JSdoc.class; + case LABELED_STATEMENT : + return LabeledStatement.class; + case LINE_COMMENT : + return LineComment.class; + case MEMBER_REF : + return MemberRef.class; + case FUNCTION_DECLARATION : + return FunctionDeclaration.class; + case FUNCTION_INVOCATION : + return FunctionInvocation.class; + case FUNCTION_REF : + return FunctionRef.class; + case FUNCTION_REF_PARAMETER : + return FunctionRefParameter.class; + case MODIFIER : + return Modifier.class; + case NULL_LITERAL : + return NullLiteral.class; + case UNDEFINED_LITERAL : + return UndefinedLiteral.class; + case NUMBER_LITERAL : + return NumberLiteral.class; + case PACKAGE_DECLARATION : + return PackageDeclaration.class; + case PARENTHESIZED_EXPRESSION : + return ParenthesizedExpression.class; + case POSTFIX_EXPRESSION : + return PostfixExpression.class; + case PREFIX_EXPRESSION : + return PrefixExpression.class; + case PRIMITIVE_TYPE : + return PrimitiveType.class; + case QUALIFIED_NAME : + return QualifiedName.class; + case QUALIFIED_TYPE : + return QualifiedType.class; + case RETURN_STATEMENT : + return ReturnStatement.class; + case SIMPLE_NAME : + return SimpleName.class; + case SIMPLE_TYPE : + return SimpleType.class; + case SINGLE_VARIABLE_DECLARATION : + return SingleVariableDeclaration.class; + case STRING_LITERAL : + return StringLiteral.class; + case SUPER_CONSTRUCTOR_INVOCATION : + return SuperConstructorInvocation.class; + case SUPER_FIELD_ACCESS : + return SuperFieldAccess.class; + case SUPER_METHOD_INVOCATION : + return SuperMethodInvocation.class; + case SWITCH_CASE: + return SwitchCase.class; + case SWITCH_STATEMENT : + return SwitchStatement.class; + case TAG_ELEMENT : + return TagElement.class; + case TEXT_ELEMENT : + return TextElement.class; + case THIS_EXPRESSION : + return ThisExpression.class; + case THROW_STATEMENT : + return ThrowStatement.class; + case TRY_STATEMENT : + return TryStatement.class; + case TYPE_DECLARATION : + return TypeDeclaration.class; + case TYPE_DECLARATION_STATEMENT : + return TypeDeclarationStatement.class; + case TYPE_LITERAL : + return TypeLiteral.class; + case VARIABLE_DECLARATION_EXPRESSION : + return VariableDeclarationExpression.class; + case VARIABLE_DECLARATION_FRAGMENT : + return VariableDeclarationFragment.class; + case VARIABLE_DECLARATION_STATEMENT : + return VariableDeclarationStatement.class; + case WHILE_STATEMENT : + return WhileStatement.class; + case WITH_STATEMENT : + return WithStatement.class; + case OBJECT_LITERAL : + return ObjectLiteral.class; + case OBJECT_LITERAL_FIELD : + return ObjectLiteralField.class; + case FUNCTION_EXPRESSION : + return FunctionExpression.class; + case REGULAR_EXPRESSION_LITERAL : + return RegularExpressionLiteral.class; + case LIST_EXPRESSION : + return ListExpression.class; + } + throw new IllegalArgumentException(); + } + + /** + * Owning AST. + *

+ * N.B. This ia a private field, but declared as package-visible + * for more efficient access from inner classes. + *

+ */ + final AST ast; + + /** + * Parent AST node, or null if this node is a root. + * Initially null. + */ + private ASTNode parent = null; + + /** + * An unmodifiable empty map (used to implement properties()). + */ + private static final Map UNMODIFIABLE_EMPTY_MAP + = Collections.unmodifiableMap(new HashMap(1)); + + /** + * Primary field used in representing node properties efficiently. + * If null, this node has no properties. + * If a String, this is the name of this node's sole property, + * and property2 contains its value. + * If a HashMap, this is the table of property name-value + * mappings; property2, if non-null is its unmodifiable + * equivalent. + * Initially null. + * + * @see #property2 + */ + private Object property1 = null; + + /** + * Auxillary field used in representing node properties efficiently. + * + * @see #property1 + */ + private Object property2 = null; + + /** + * A character index into the original source string, + * or -1 if no source position information is available + * for this node; -1 by default. + */ + private int startPosition = -1; + + /** + * A character length, or 0 if no source position + * information is recorded for this node; 0 by default. + */ + private int length = 0; + + /** + * Flag constant (bit mask, value 1) indicating that there is something + * not quite right with this AST node. + *

+ * The standard parser (ASTParser) sets this + * flag on a node to indicate a syntax error detected in the vicinity. + *

+ */ + public static final int MALFORMED = 1; + + /** + * Flag constant (bit mask, value 2) indicating that this is a node + * that was created by the parser (as opposed to one created by another + * party). + *

+ * The standard parser (ASTParser) sets this + * flag on the nodes it creates. + *

+ * + */ + public static final int ORIGINAL = 2; + + /** + * Flag constant (bit mask, value 4) indicating that this node + * is unmodifiable. When a node is marked unmodifiable, the + * following operations result in a runtime exception: + *
    + *
  • Change a simple property of this node.
  • + *
  • Add or remove a child node from this node.
  • + *
  • Parent (or reparent) this node.
  • + *
+ *

+ * The standard parser (ASTParser) does not set + * this flag on the nodes it creates. However, clients may set + * this flag on a node to prevent further modification of the + * its structural properties. + *

+ */ + public static final int PROTECT = 4; + + /** + * Flag constant (bit mask, value 8) indicating that this node + * or a part of this node is recovered from source that contains + * a syntax error detected in the vicinity. + *

+ * The standard parser (ASTParser) sets this + * flag on a node to indicate a recovered node. + *

+ */ + public static final int RECOVERED = 8; + + /** + * int containing the node type in the top 16 bits and + * flags in the bottom 16 bits; none set by default. + *

+ * N.B. This is a private field, but declared as package-visible + * for more efficient access from inner classes. + *

+ * + * @see #MALFORMED + */ + int typeAndFlags = 0; + + /** + * Property of parent in which this node is a child, or null + * if this node is a root. Initially null. + * + * @see #getLocationInParent + */ + private StructuralPropertyDescriptor location = null; + + /** Internal convenience constant indicating that there is definite risk of cycles. + */ + static final boolean CYCLE_RISK = true; + + /** Internal convenience constant indicating that there is no risk of cycles. + */ + static final boolean NO_CYCLE_RISK = false; + + /** Internal convenience constant indicating that a structural property is mandatory. + */ + static final boolean MANDATORY = true; + + /** Internal convenience constant indicating that a structural property is optional. + */ + static final boolean OPTIONAL = false; + + /** + * A specialized implementation of a list of ASTNodes. The + * implementation is based on an ArrayList. + */ + class NodeList extends AbstractList { + + /** + * The underlying list in which the nodes of this list are + * stored (element type: ASTNode). + *

+ * Be stingy on storage - assume that list will be empty. + *

+ *

+ * This field declared default visibility (rather than private) + * so that accesses from NodeList.Cursor do not require + * a synthetic accessor method. + *

+ */ + ArrayList store = new ArrayList(0); + + /** + * The property descriptor for this list. + */ + ChildListPropertyDescriptor propertyDescriptor; + + /** + * A cursor for iterating over the elements of the list. + * Does not lose its position if the list is changed during + * the iteration. + */ + class Cursor implements Iterator { + /** + * The position of the cursor between elements. If the value + * is N, then the cursor sits between the element at positions + * N-1 and N. Initially just before the first element of the + * list. + */ + private int position = 0; + + /* (non-Javadoc) + * Method declared on Iterator. + */ + public boolean hasNext() { + return this.position < NodeList.this.store.size(); + } + + /* (non-Javadoc) + * Method declared on Iterator. + */ + public Object next() { + Object result = NodeList.this.store.get(this.position); + this.position++; + return result; + } + + /* (non-Javadoc) + * Method declared on Iterator. + */ + public void remove() { + throw new UnsupportedOperationException(); + } + + /** + * Adjusts this cursor to accomodate an add/remove at the given + * index. + * + * @param index the position at which the element was added + * or removed + * @param delta +1 for add, and -1 for remove + */ + void update(int index, int delta) { + if (this.position > index) { + // the cursor has passed the added or removed element + this.position += delta; + } + } + } + + /** + * A list of currently active cursors (element type: + * Cursor), or null if there are no + * active cursors. + *

+ * It is important for storage considerations to maintain the + * null-means-empty invariant; otherwise, every NodeList instance + * will waste a lot of space. A cursor is needed only for the duration + * of a visit to the child nodes. Under normal circumstances, only a + * single cursor is needed; multiple cursors are only required if there + * are multiple visits going on at the same time. + *

+ */ + private List cursors = null; + + /** + * Creates a new empty list of nodes owned by this node. + * This node will be the common parent of all nodes added to + * this list. + * + * @param property the property descriptor + */ + NodeList(ChildListPropertyDescriptor property) { + super(); + this.propertyDescriptor = property; + } + + /* (non-javadoc) + * @see java.util.AbstractCollection#size() + */ + public int size() { + return this.store.size(); + } + + /* (non-javadoc) + * @see AbstractList#get(int) + */ + public Object get(int index) { + return this.store.get(index); + } + + /* (non-javadoc) + * @see List#set(int, java.lang.Object) + */ + public Object set(int index, Object element) { + if (element == null) { + throw new IllegalArgumentException(); + } + if ((ASTNode.this.typeAndFlags & PROTECT) != 0) { + // this node is protected => cannot gain or lose children + throw new IllegalArgumentException("AST node cannot be modified"); //$NON-NLS-1$ + } + // delink old child from parent, and link new child to parent + ASTNode newChild = (ASTNode) element; + ASTNode oldChild = (ASTNode) this.store.get(index); + if (oldChild == newChild) { + return oldChild; + } + if ((oldChild.typeAndFlags & PROTECT) != 0) { + // old child is protected => cannot be unparented + throw new IllegalArgumentException("AST node cannot be modified"); //$NON-NLS-1$ + } + ASTNode.checkNewChild(ASTNode.this, newChild, this.propertyDescriptor.cycleRisk, this.propertyDescriptor.elementType); + ASTNode.this.ast.preReplaceChildEvent(ASTNode.this, oldChild, newChild, this.propertyDescriptor); + + Object result = this.store.set(index, newChild); + // n.b. setParent will call ast.modifying() + oldChild.setParent(null, null); + newChild.setParent(ASTNode.this, this.propertyDescriptor); + ASTNode.this.ast.postReplaceChildEvent(ASTNode.this, oldChild, newChild, this.propertyDescriptor); + return result; + } + + /* (non-javadoc) + * @see List#add(int, java.lang.Object) + */ + public void add(int index, Object element) { + if (element == null) { + // http://bugs.eclipse.org/255538 - Very frequent IllegalArgumentException in JSDT + // XXX: Workaround until we've gotten the AST corrected, silenty return + return; + //throw new IllegalArgumentException(); + } + if ((ASTNode.this.typeAndFlags & PROTECT) != 0) { + // this node is protected => cannot gain or lose children + throw new IllegalArgumentException("AST node cannot be modified"); //$NON-NLS-1$ + } + // link new child to parent + ASTNode newChild = (ASTNode) element; + ASTNode.checkNewChild(ASTNode.this, newChild, this.propertyDescriptor.cycleRisk, this.propertyDescriptor.elementType); + ASTNode.this.ast.preAddChildEvent(ASTNode.this, newChild, this.propertyDescriptor); + + + this.store.add(index, element); + updateCursors(index, +1); + // n.b. setParent will call ast.modifying() + newChild.setParent(ASTNode.this, this.propertyDescriptor); + ASTNode.this.ast.postAddChildEvent(ASTNode.this, newChild, this.propertyDescriptor); + } + + /* (non-javadoc) + * @see List#remove(int) + */ + public Object remove(int index) { + if ((ASTNode.this.typeAndFlags & PROTECT) != 0) { + // this node is protected => cannot gain or lose children + throw new IllegalArgumentException("AST node cannot be modified"); //$NON-NLS-1$ + } + // delink old child from parent + ASTNode oldChild = (ASTNode) this.store.get(index); + if ((oldChild.typeAndFlags & PROTECT) != 0) { + // old child is protected => cannot be unparented + throw new IllegalArgumentException("AST node cannot be modified"); //$NON-NLS-1$ + } + + ASTNode.this.ast.preRemoveChildEvent(ASTNode.this, oldChild, this.propertyDescriptor); + // n.b. setParent will call ast.modifying() + oldChild.setParent(null, null); + Object result = this.store.remove(index); + updateCursors(index, -1); + ASTNode.this.ast.postRemoveChildEvent(ASTNode.this, oldChild, this.propertyDescriptor); + return result; + + } + + /** + * Allocate a cursor to use for a visit. The client must call + * releaseCursor when done. + *

+ * This method is internally synchronized on this NodeList. + * It is thread-safe to create a cursor. + *

+ * + * @return a new cursor positioned before the first element + * of the list + */ + Cursor newCursor() { + synchronized (this) { + // serialize cursor management on this NodeList + if (this.cursors == null) { + // convert null to empty list + this.cursors = new ArrayList(1); + } + Cursor result = new Cursor(); + this.cursors.add(result); + return result; + } + } + + /** + * Releases the given cursor at the end of a visit. + *

+ * This method is internally synchronized on this NodeList. + * It is thread-safe to release a cursor. + *

+ * + * @param cursor the cursor + */ + void releaseCursor(Cursor cursor) { + synchronized (this) { + // serialize cursor management on this NodeList + this.cursors.remove(cursor); + if (this.cursors.isEmpty()) { + // important: convert empty list back to null + // otherwise the node will hang on to needless junk + this.cursors = null; + } + } + } + + /** + * Adjusts all cursors to accomodate an add/remove at the given + * index. + *

+ * This method is only used when the list is being modified. + * The AST is not thread-safe if any of the clients are modifying it. + *

+ * + * @param index the position at which the element was added + * or removed + * @param delta +1 for add, and -1 for remove + */ + private void updateCursors(int index, int delta) { + if (this.cursors == null) { + // there are no cursors to worry about + return; + } + for (Iterator it = this.cursors.iterator(); it.hasNext(); ) { + Cursor c = (Cursor) it.next(); + c.update(index, delta); + } + } + + /** + * Returns an estimate of the memory footprint of this node list + * instance in bytes. + *
    + *
  • 1 object header for the NodeList instance
  • + *
  • 5 4-byte fields of the NodeList instance
  • + *
  • 0 for cursors since null unless walk in progress
  • + *
  • 1 object header for the ArrayList instance
  • + *
  • 2 4-byte fields of the ArrayList instance
  • + *
  • 1 object header for an Object[] instance
  • + *
  • 4 bytes in array for each element
  • + *
+ * + * @return the size of this node list in bytes + */ + int memSize() { + int result = HEADERS + 5 * 4; + result += HEADERS + 2 * 4; + result += HEADERS + 4 * size(); + return result; + } + + /** + * Returns an estimate of the memory footprint in bytes of this node + * list and all its subtrees. + * + * @return the size of this list of subtrees in bytes + */ + int listSize() { + int result = memSize(); + for (Iterator it = iterator(); it.hasNext(); ) { + ASTNode child = (ASTNode) it.next(); + result += child.treeSize(); + } + return result; + } + } + + /** + * Creates a new AST node owned by the given AST. Once established, + * the relationship between an AST node and its owning AST does not change + * over the lifetime of the node. The new node has no parent node, + * and no properties. + *

+ * N.B. This constructor is package-private; all subclasses my be + * declared in the same package; clients are unable to declare + * additional subclasses. + *

+ * + * @param ast the AST that is to own this node + */ + ASTNode(AST ast) { + if (ast == null) { + throw new IllegalArgumentException(); + } + + this.ast = ast; + setNodeType(getNodeType0()); + setFlags(ast.getDefaultNodeFlag()); + // setFlags calls modifying(); + } + + /** + * Returns this node's AST. + *

+ * Note that the relationship between an AST node and its owing AST does + * not change over the lifetime of a node. + *

+ * + * @return the AST that owns this node + */ + public final AST getAST() { + return this.ast; + } + + /** + * Returns this node's parent node, or null if this is the + * root node. + *

+ * Note that the relationship between an AST node and its parent node + * may change over the lifetime of a node. + *

+ * + * @return the parent of this node, or null if none + */ + public final ASTNode getParent() { + return this.parent; + } + + /** + * Returns the location of this node within its parent, + * or null if this is a root node. + *

+ *

+	 * ASTNode node = ...;
+	 * ASTNode parent = node.getParent();
+	 * StructuralPropertyDescriptor location = node.getLocationInParent();
+	 * assert (parent != null) == (location != null);
+	 * if ((location != null) && location.isChildProperty())
+	 *    assert parent.getStructuralProperty(location) == node;
+	 * if ((location != null) && location.isChildListProperty())
+	 *    assert ((List) parent.getStructuralProperty(location)).contains(node);
+	 * 
+ *

+ *

+ * Note that the relationship between an AST node and its parent node + * may change over the lifetime of a node. + *

+ * + * @return the location of this node in its parent, + * or null if this node has no parent + */ + public final StructuralPropertyDescriptor getLocationInParent() { + return this.location; + } + + /** + * Returns the root node at or above this node; returns this node if + * it is a root. + * + * @return the root node at or above this node + */ + public final ASTNode getRoot() { + ASTNode candidate = this; + while (true) { + ASTNode p = candidate.getParent(); + if (p == null) { + // candidate has no parent - that's the guy + return candidate; + } + candidate = p; + } + } + + /** + * Returns the value of the given structural property for this node. The value + * returned depends on the kind of property: + *
    + *
  • {@link SimplePropertyDescriptor} - the value of the given simple property, + * or null if none; primitive values are "boxed"
  • + *
  • {@link ChildPropertyDescriptor} - the child node (type ASTNode), + * or null if none
  • + *
  • {@link ChildListPropertyDescriptor} - the list (element type: {@link ASTNode})
  • + *
+ * + * @param property the property + * @return the value, or null if none + * @exception RuntimeException if this node does not have the given property + */ + public final Object getStructuralProperty(StructuralPropertyDescriptor property) { + if (property instanceof SimplePropertyDescriptor) { + SimplePropertyDescriptor p = (SimplePropertyDescriptor) property; + if (p.getValueType() == int.class) { + int result = internalGetSetIntProperty(p, true, 0); + return new Integer(result); + } else if (p.getValueType() == boolean.class) { + boolean result = internalGetSetBooleanProperty(p, true, false); + return Boolean.valueOf(result); + } else { + return internalGetSetObjectProperty(p, true, null); + } + } + if (property instanceof ChildPropertyDescriptor) { + return internalGetSetChildProperty((ChildPropertyDescriptor) property, true, null); + } + if (property instanceof ChildListPropertyDescriptor) { + return internalGetChildListProperty((ChildListPropertyDescriptor) property); + } + throw new IllegalArgumentException(); + } + + /** + * Sets the value of the given structural property for this node. The value + * passed depends on the kind of property: + *
    + *
  • {@link SimplePropertyDescriptor} - the new value of the given simple property, + * or null if none; primitive values are "boxed"
  • + *
  • {@link ChildPropertyDescriptor} - the new child node (type ASTNode), + * or null if none
  • + *
  • {@link ChildListPropertyDescriptor} - not allowed
  • + *
+ * + * @param property the property + * @param value the property value + * @exception RuntimeException if this node does not have the + * given property, or if the given property cannot be set + */ + public final void setStructuralProperty(StructuralPropertyDescriptor property, Object value) { + if (property instanceof SimplePropertyDescriptor) { + SimplePropertyDescriptor p = (SimplePropertyDescriptor) property; + if (p.getValueType() == int.class) { + int arg = ((Integer) value).intValue(); + internalGetSetIntProperty(p, false, arg); + return; + } else if (p.getValueType() == boolean.class) { + boolean arg = ((Boolean) value).booleanValue(); + internalGetSetBooleanProperty(p, false, arg); + return; + } else { + if (value == null && p.isMandatory()) { + throw new IllegalArgumentException(); + } + internalGetSetObjectProperty(p, false, value); + return; + } + } + if (property instanceof ChildPropertyDescriptor) { + ChildPropertyDescriptor p = (ChildPropertyDescriptor) property; + ASTNode child = (ASTNode) value; + if (child == null && p.isMandatory()) { + throw new IllegalArgumentException(); + } + internalGetSetChildProperty(p, false, child); + return; + } + if (property instanceof ChildListPropertyDescriptor) { + throw new IllegalArgumentException("Cannot set the list of child list property"); //$NON-NLS-1$ + } + } + + /** + * Sets the value of the given int-valued property for this node. + * The default implementation of this method throws an exception explaining + * that this node does not have such a property. This method should be + * extended in subclasses that have at leasy one simple property whose value + * type is int. + * + * @param property the property + * @param get true for a get operation, and + * false for a set operation + * @param value the new property value; ignored for get operations + * @return the value; always returns + * 0 for set operations + * @exception RuntimeException if this node does not have the + * given property, or if the given value cannot be set as specified + * + */ + int internalGetSetIntProperty(SimplePropertyDescriptor property, boolean get, int value) { + throw new RuntimeException("Node does not have this property"); //$NON-NLS-1$ + } + + /** + * Sets the value of the given boolean-valued property for this node. + * The default implementation of this method throws an exception explaining + * that this node does not have such a property. This method should be + * extended in subclasses that have at leasy one simple property whose value + * type is boolean. + * + * @param property the property + * @param get true for a get operation, and + * false for a set operation + * @param value the new property value; ignored for get operations + * @return the value; always returns + * false for set operations + * @exception RuntimeException if this node does not have the + * given property, or if the given value cannot be set as specified + */ + boolean internalGetSetBooleanProperty(SimplePropertyDescriptor property, boolean get, boolean value) { + throw new RuntimeException("Node does not have this property"); //$NON-NLS-1$ + } + + /** + * Sets the value of the given property for this node. + * The default implementation of this method throws an exception explaining + * that this node does not have such a property. This method should be + * extended in subclasses that have at leasy one simple property whose value + * type is a reference type. + * + * @param property the property + * @param get true for a get operation, and + * false for a set operation + * @param value the new property value, or null if none; + * ignored for get operations + * @return the value, or null if none; always returns + * null for set operations + * @exception RuntimeException if this node does not have the + * given property, or if the given value cannot be set as specified + */ + Object internalGetSetObjectProperty(SimplePropertyDescriptor property, boolean get, Object value) { + throw new RuntimeException("Node does not have this property"); //$NON-NLS-1$ + } + + /** + * Sets the child value of the given property for this node. + * The default implementation of this method throws an exception explaining + * that this node does not have such a property. This method should be + * extended in subclasses that have at leasy one child property. + * + * @param property the property + * @param get true for a get operation, and + * false for a set operation + * @param child the new child value, or null if none; + * always null for get operations + * @return the child, or null if none; always returns + * null for set operations + * @exception RuntimeException if this node does not have the + * given property, or if the given child cannot be set as specified + */ + ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { + throw new RuntimeException("Node does not have this property"); //$NON-NLS-1$ + } + + /** + * Returns the list value of the given property for this node. + * The default implementation of this method throws an exception explaining + * that this noed does not have such a property. This method should be + * extended in subclasses that have at leasy one child list property. + * + * @param property the property + * @return the list (element type: {@link ASTNode}) + * @exception RuntimeException if the given node does not have the + * given property + */ + List internalGetChildListProperty(ChildListPropertyDescriptor property) { + throw new RuntimeException("Node does not have this property"); //$NON-NLS-1$ + } + + /** + * Returns a list of structural property descriptors for nodes of the + * same type as this node. Clients must not modify the result. + *

+ * Note that property descriptors are a meta-level mechanism + * for manipulating ASTNodes in a generic way. They are + * unrelated to get/setProperty. + *

+ * + * @return a list of property descriptors (element type: + * {@link StructuralPropertyDescriptor}) + */ + public final List structuralPropertiesForType() { + return internalStructuralPropertiesForType(this.ast.apiLevel); + } + + /** + * Returns a list of property descriptors for this node type. + * Clients must not modify the result. This abstract method + * must be implemented in each concrete AST node type. + *

+ * N.B. This method is package-private, so that the implementations + * of this method in each of the concrete AST node types do not + * clutter up the API doc. + *

+ * + * @param apiLevel the API level; one of the AST.JLS* constants + * @return a list of property descriptors (element type: + * {@link StructuralPropertyDescriptor}) + */ + abstract List internalStructuralPropertiesForType(int apiLevel); + + /** + * Internal helper method that starts the building a list of + * property descriptors for the given node type. + * + * @param nodeClass the class for a concrete node type + * @param propertyList empty list + */ + static void createPropertyList(Class nodeClass, List propertyList) { + // stuff nodeClass at head of list for future ref + propertyList.add(nodeClass); + } + + /** + * Internal helper method that adding a property descriptor. + * + * @param property the structural property descriptor + * @param propertyList list beginning with the AST node class + * followed by accumulated structural property descriptors + */ + static void addProperty(StructuralPropertyDescriptor property, List propertyList) { + Class nodeClass = (Class) propertyList.get(0); + if (property.getNodeClass() != nodeClass) { + // easily made cut-and-paste mistake + throw new RuntimeException("Structural property descriptor has wrong node class!"); //$NON-NLS-1$ + } + propertyList.add(property); + } + + /** + * Internal helper method that completes the building of + * a node type's structural property descriptor list. + * + * @param propertyList list beginning with the AST node class + * followed by accumulated structural property descriptors + * @return unmodifiable list of structural property descriptors + * (element type: StructuralPropertyDescriptor) + */ + static List reapPropertyList(List propertyList) { + propertyList.remove(0); // remove nodeClass + // compact + ArrayList a = new ArrayList(propertyList.size()); + a.addAll(propertyList); + return Collections.unmodifiableList(a); + } + + /** + * Checks that this AST operation is not used when + * building JLS2 level ASTs. + + * @exception UnsupportedOperationException + */ + final void unsupportedIn2() { + if (this.ast.apiLevel == AST.JLS2_INTERNAL) { + throw new UnsupportedOperationException("Operation not supported in JLS2 AST"); //$NON-NLS-1$ + } + } + + /** + * Checks that this AST operation is only used when + * building JLS2 level ASTs. + + * @exception UnsupportedOperationException + */ + final void supportedOnlyIn2() { + if (this.ast.apiLevel != AST.JLS2_INTERNAL) { + throw new UnsupportedOperationException("Operation only supported in JLS2 AST"); //$NON-NLS-1$ + } + } + + /** + * Sets or clears this node's parent node and location. + *

+ * Note that this method is package-private. The pointer from a node + * to its parent is set implicitly as a side effect of inserting or + * removing the node as a child of another node. This method calls + * ast.modifying(). + *

+ * + * @param parent the new parent of this node, or null if none + * @param property the location of this node in its parent, + * or null if parent is null + * @see #getLocationInParent + * @see #getParent + */ + final void setParent(ASTNode parent, StructuralPropertyDescriptor property) { + this.ast.modifying(); + this.parent = parent; + this.location = property; + } + + /** + * Removes this node from its parent. Has no effect if this node + * is unparented. If this node appears as an element of a child list + * property of its parent, then this node is removed from the + * list using List.remove. + * If this node appears as the value of a child property of its + * parent, then this node is detached from its parent + * by passing null to the appropriate setter method; + * this operation fails if this node is in a mandatory property. + * + */ + public final void delete() { + StructuralPropertyDescriptor p = getLocationInParent(); + if (p == null) { + // node is unparented + return; + } + if (p.isChildProperty()) { + getParent().setStructuralProperty(this.location, null); + return; + } + if (p.isChildListProperty()) { + List l = (List) getParent().getStructuralProperty(this.location); + l.remove(this); + } + } + + /** + * Checks whether the given new child node is a node + * in a different AST from its parent-to-be, whether it is + * already has a parent, whether adding it to its + * parent-to-be would create a cycle, and whether the child is of + * the right type. The parent-to-be is the enclosing instance. + * + * @param node the parent-to-be node + * @param newChild the new child of the parent + * @param cycleCheck true if cycles are possible and need + * to be checked, false if cycles are impossible and do + * not need to be checked + * @param nodeType a type constraint on child nodes, or null + * if no special check is required + * @exception IllegalArgumentException if: + *
    + *
  • the child is null
  • + *
  • the node belongs to a different AST
  • + *
  • the child has the incorrect node type
  • + *
  • the node already has a parent
  • + *
  • a cycle in would be created
  • + *
+ */ + static void checkNewChild(ASTNode node, ASTNode newChild, + boolean cycleCheck, Class nodeType) { + if (newChild.ast != node.ast) { + // new child is from a different AST + throw new IllegalArgumentException(); + } + if (newChild.getParent() != null) { + // new child currently has a different parent + throw new IllegalArgumentException(); + } + if (cycleCheck && newChild == node.getRoot()) { + // inserting new child would create a cycle + throw new IllegalArgumentException(); + } + Class childClass = newChild.getClass(); + if (nodeType != null && !nodeType.isAssignableFrom(childClass)) { + // new child is not of the right type + + // fix for inner function handling, Etienne Pfister + if(!(newChild instanceof org.eclipse.wst.jsdt.core.dom.FunctionDeclaration)) { + throw new ClassCastException(); + } + } + if ((newChild.typeAndFlags & PROTECT) != 0) { + // new child node is protected => cannot be parented + throw new IllegalArgumentException("AST node cannot be modified"); //$NON-NLS-1$ + } + } + + /** + * Prelude portion of the "3 step program" for replacing the + * old child of this node with another node. + * Here is the code pattern found in all AST node subclasses: + *
+     * ASTNode oldChild = this.foo;
+     * preReplaceChild(oldChild, newFoo, FOO_PROPERTY);
+     * this.foo = newFoo;
+     * postReplaceChild(oldChild, newFoo, FOO_PROPERTY);
+     * 
+ * The first part (preReplaceChild) does all the precondition checks, + * reports pre-delete events, and changes parent links. + * The old child is delinked from its parent (making it a root node), + * and the new child node is linked to its parent. The new child node + * must be a root node in the same AST as its new parent, and must not + * be an ancestor of this node. All three nodes must be + * modifiable (not PROTECTED). The replace operation must fail + * atomically; so it is crucial that all precondition checks + * be done before any linking and delinking happens. + * The final part (postReplaceChild )reports post-add events. + *

+ * This method calls ast.modifying() for the nodes affected. + *

+ * + * @param oldChild the old child of this node, or null if + * there was no old child to replace + * @param newChild the new child of this node, or null if + * there is no replacement child + * @param property the property descriptor of this node describing + * the relationship between node and child + * @exception RuntimeException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
  • a cycle in would be created
  • + *
  • any of the nodes involved are unmodifiable
  • + *
+ */ + final void preReplaceChild(ASTNode oldChild, ASTNode newChild, ChildPropertyDescriptor property) { + if ((this.typeAndFlags & PROTECT) != 0) { + // this node is protected => cannot gain or lose children + throw new IllegalArgumentException("AST node cannot be modified"); //$NON-NLS-1$ + } + if (newChild != null) { + checkNewChild(this, newChild, property.cycleRisk, null); + } + // delink old child from parent + if (oldChild != null) { + if ((oldChild.typeAndFlags & PROTECT) != 0) { + // old child node is protected => cannot be unparented + throw new IllegalArgumentException("AST node cannot be modified"); //$NON-NLS-1$ + } + if (newChild != null) { + this.ast.preReplaceChildEvent(this, oldChild, newChild, property); + } else { + this.ast.preRemoveChildEvent(this, oldChild, property); + } + oldChild.setParent(null, null); + } else { + if(newChild != null) { + this.ast.preAddChildEvent(this, newChild, property); + } + } + // link new child to parent + if (newChild != null) { + newChild.setParent(this, property); + // cannot notify postAddChildEvent until parent is linked to child too + } + } + + /** + * Postlude portion of the "3 step program" for replacing the + * old child of this node with another node. + * See {@link #preReplaceChild(ASTNode, ASTNode, ChildPropertyDescriptor)} + * for details. + */ + final void postReplaceChild(ASTNode oldChild, ASTNode newChild, ChildPropertyDescriptor property) { + // link new child to parent + if (newChild != null) { + if (oldChild != null) { + this.ast.postReplaceChildEvent(this, oldChild, newChild, property); + } else { + this.ast.postAddChildEvent(this, newChild, property); + } + } else { + this.ast.postRemoveChildEvent(this, oldChild, property); + } + } + + /** + * Prelude portion of the "3 step program" for changing the + * value of a simple property of this node. + * Here is the code pattern found in all AST node subclasses: + *
+     * preValueChange(FOO_PROPERTY);
+     * this.foo = newFoo;
+     * postValueChange(FOO_PROPERTY);
+     * 
+ * The first part (preValueChange) does the precondition check + * to make sure the node is modifiable (not PROTECTED). + * The change operation must fail atomically; so it is crucial + * that the precondition checks are done before the field is + * hammered. The final part (postValueChange)reports post-change + * events. + *

+ * This method calls ast.modifying() for the node affected. + *

+ * + * @param property the property descriptor of this node + * @exception RuntimeException if: + *
    + *
  • this node is unmodifiable
  • + *
+ */ + final void preValueChange(SimplePropertyDescriptor property) { + if ((this.typeAndFlags & PROTECT) != 0) { + // this node is protected => cannot change valure of properties + throw new IllegalArgumentException("AST node cannot be modified"); //$NON-NLS-1$ + } + this.ast.preValueChangeEvent(this, property); + this.ast.modifying(); + } + + /** + * Postlude portion of the "3 step program" for replacing the + * old child of this node with another node. + * See {@link #preValueChange(SimplePropertyDescriptor)} for details. + */ + final void postValueChange(SimplePropertyDescriptor property) { + this.ast.postValueChangeEvent(this, property); + } + + /** + * Ensures that this node is modifiable (that is, not marked PROTECTED). + * If successful, calls ast.modifying(). + * @exception RuntimeException is not modifiable + */ + final void checkModifiable() { + if ((this.typeAndFlags & PROTECT) != 0) { + throw new IllegalArgumentException("AST node cannot be modified"); //$NON-NLS-1$ + } + this.ast.modifying(); + } + + /** + * Begin lazy initialization of this node. + * Here is the code pattern found in all AST + * node subclasses: + *
+     * if (this.foo == null) {
+	 *    // lazy init must be thread-safe for readers
+     *    synchronized (this) {
+     *       if (this.foo == null) {
+     *          preLazyInit();
+     *          this.foo = ...; // code to create new node
+     *          postLazyInit(this.foo, FOO_PROPERTY);
+     *       }
+     *    }
+     * }
+     * 
+ * + */ + final void preLazyInit() { + // IMPORTANT: this method is called by readers + // ASTNode.this is locked at this point + this.ast.disableEvents(); + // will turn events back on in postLasyInit + } + + /** + * End lazy initialization of this node. + * + * @param newChild the new child of this node, or null if + * there is no replacement child + * @param property the property descriptor of this node describing + * the relationship between node and child + */ + final void postLazyInit(ASTNode newChild, ChildPropertyDescriptor property) { + // IMPORTANT: this method is called by readers + // ASTNode.this is locked at this point + // newChild is brand new (so no chance of concurrent access) + newChild.setParent(this, property); + // turn events back on (they were turned off in corresponding preLazyInit) + this.ast.reenableEvents(); + } + + /** + * Returns the named property of this node, or null if none. + * + * @param propertyName the property name + * @return the property value, or null if none + * @see #setProperty(String,Object) + */ + public final Object getProperty(String propertyName) { + if (propertyName == null) { + throw new IllegalArgumentException(); + } + if (this.property1 == null) { + // node has no properties at all + return null; + } + if (this.property1 instanceof String) { + // node has only a single property + if (propertyName.equals(this.property1)) { + return this.property2; + } else { + return null; + } + } + // otherwise node has table of properties + Map m = (Map) this.property1; + return m.get(propertyName); + } + + /** + * Sets the named property of this node to the given value, + * or to null to clear it. + *

+ * Clients should employ property names that are sufficiently unique + * to avoid inadvertent conflicts with other clients that might also be + * setting properties on the same node. + *

+ *

+ * Note that modifying a property is not considered a modification to the + * AST itself. This is to allow clients to decorate existing nodes with + * their own properties without jeopardizing certain things (like the + * validity of bindings), which rely on the underlying tree remaining static. + *

+ * + * @param propertyName the property name + * @param data the new property value, or null if none + * @see #getProperty(String) + */ + public final void setProperty(String propertyName, Object data) { + if (propertyName == null) { + throw new IllegalArgumentException(); + } + // N.B. DO NOT CALL ast.modifying(); + + if (this.property1 == null) { + // node has no properties at all + if (data == null) { + // we already know this + return; + } + // node gets its fist property + this.property1 = propertyName; + this.property2 = data; + return; + } + + if (this.property1 instanceof String) { + // node has only a single property + if (propertyName.equals(this.property1)) { + // we're in luck + this.property2 = data; + if (data == null) { + // just deleted last property + this.property1 = null; + this.property2 = null; + } + return; + } + if (data == null) { + // we already know this + return; + } + // node already has one property - getting its second + // convert to more flexible representation + HashMap m = new HashMap(2); + m.put(this.property1, this.property2); + m.put(propertyName, data); + this.property1 = m; + this.property2 = null; + return; + } + + // node has two or more properties + HashMap m = (HashMap) this.property1; + if (data == null) { + m.remove(propertyName); + // check for just one property left + if (m.size() == 1) { + // convert to more efficient representation + Map.Entry[] entries = (Map.Entry[]) m.entrySet().toArray(new Map.Entry[1]); + this.property1 = entries[0].getKey(); + this.property2 = entries[0].getValue(); + } + return; + } else { + m.put(propertyName, data); + // still has two or more properties + return; + } + } + + /** + * Returns an unmodifiable table of the properties of this node with + * non-null values. + * + * @return the table of property values keyed by property name + * (key type: String; value type: Object) + */ + public final Map properties() { + if (this.property1 == null) { + // node has no properties at all + return UNMODIFIABLE_EMPTY_MAP; + } + if (this.property1 instanceof String) { + // node has a single property + return Collections.singletonMap(this.property1, this.property2); + } + + // node has two or more properties + if (this.property2 == null) { + this.property2 = Collections.unmodifiableMap((Map) this.property1); + } + // property2 is unmodifiable wrapper for map in property1 + return (Map) this.property2; + } + + /** + * Returns the flags associated with this node. + *

+ * No flags are associated with newly created nodes. + *

+ *

+ * The flags are the bitwise-or of individual flags. + * The following flags are currently defined: + *

    + *
  • {@link #MALFORMED} - indicates node is syntactically + * malformed
  • + *
  • {@link #ORIGINAL} - indicates original node + * created by ASTParser
  • + *
  • {@link #PROTECT} - indicates node is protected + * from further modification
  • + *
  • {@link #RECOVERED} - indicates node or a part of this node + * is recovered from source that contains a syntax error
  • + *
+ * Other bit positions are reserved for future use. + *

+ * + * @return the bitwise-or of individual flags + * @see #setFlags(int) + */ + public final int getFlags() { + return this.typeAndFlags & 0xFFFF; + } + + /** + * Sets the flags associated with this node to the given value. + *

+ * The flags are the bitwise-or of individual flags. + * The following flags are currently defined: + *

    + *
  • {@link #MALFORMED} - indicates node is syntactically + * malformed
  • + *
  • {@link #ORIGINAL} - indicates original node + * created by ASTParser
  • + *
  • {@link #PROTECT} - indicates node is protected + * from further modification
  • + *
  • {@link #RECOVERED} - indicates node or a part of this node + * is recovered from source that contains a syntax error
  • + *
+ * Other bit positions are reserved for future use. + *

+ *

+ * Note that the flags are not considered a structural + * property of the node, and can be changed even if the + * node is marked as protected. + *

+ * + * @param flags the bitwise-or of individual flags + * @see #getFlags() + */ + public final void setFlags(int flags) { + this.ast.modifying(); + int old = this.typeAndFlags & 0xFFFF0000; + this.typeAndFlags = old | (flags & 0xFFFF); + } + + /** + * Returns an integer value identifying the type of this concrete AST node. + * The values are small positive integers, suitable for use in switch statements. + *

+ * For each concrete node type there is a unique node type constant (name + * and value). The unique node type constant for a concrete node type such as + * CastExpression is ASTNode.CAST_EXPRESSION. + *

+ * + * @return one of the node type constants + */ + public final int getNodeType() { + return this.typeAndFlags >>> 16; + } + + /** + * Sets the integer value identifying the type of this concrete AST node. + * The values are small positive integers, suitable for use in switch statements. + * + * @param nodeType one of the node type constants + */ + private void setNodeType(int nodeType) { + int old = this.typeAndFlags & 0xFFFF0000; + this.typeAndFlags = old | (nodeType << 16); + } + + /** + * Returns an integer value identifying the type of this concrete AST node. + *

+ * This internal method is implemented in each of the + * concrete node subclasses. + *

+ * + * @return one of the node type constants + */ + abstract int getNodeType0(); + + /** + * The ASTNode implementation of this Object + * method uses object identity (==). Use subtreeMatch to + * compare two subtrees for equality. + * + * @param obj {@inheritDoc} + * @return {@inheritDoc} + * @see #subtreeMatch(ASTMatcher matcher, Object other) + */ + public final boolean equals(Object obj) { + return this == obj; // equivalent to Object.equals + } + + /* + * (non-Javadoc) + * This makes it consistent with the fact that a equals methods has been provided. + * @see java.lang.Object#hashCode() + */ + public final int hashCode() { + return super.hashCode(); + } + + /** + * Returns whether the subtree rooted at the given node matches the + * given other object as decided by the given matcher. + * + * @param matcher the matcher + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match + */ + public final boolean subtreeMatch(ASTMatcher matcher, Object other) { + return subtreeMatch0(matcher, other); + } + + /** + * Returns whether the subtree rooted at the given node matches the + * given other object as decided by the given matcher. + *

+ * This internal method is implemented in each of the + * concrete node subclasses. + *

+ * + * @param matcher the matcher + * @param other the other object, or null + * @return true if the subtree matches, or + * false if they do not match + */ + abstract boolean subtreeMatch0(ASTMatcher matcher, Object other); + + /** + * Returns a deep copy of the subtree of AST nodes rooted at the + * given node. The resulting nodes are owned by the given AST, + * which may be different from the ASTs of the given node. + * Even if the given node has a parent, the result node will be unparented. + *

+ * Source range information on the original nodes is automatically copied to the new + * nodes. Client properties (properties) are not carried over. + *

+ *

+ * The node's AST and the target AST must support + * the same API level. + *

+ * + * @param target the AST that is to own the nodes in the result + * @param node the node to copy, or null if none + * @return the copied node, or null if node + * is null + */ + public static ASTNode copySubtree(AST target, ASTNode node) { + if (node == null) { + return null; + } + if (target == null) { + throw new IllegalArgumentException(); + } + if (target.apiLevel() != node.getAST().apiLevel()) { + throw new UnsupportedOperationException(); + } + ASTNode newNode = node.clone(target); + return newNode; + } + + /** + * Returns a deep copy of the subtrees of AST nodes rooted at the + * given list of nodes. The resulting nodes are owned by the given AST, + * which may be different from the ASTs of the nodes in the list. + * Even if the nodes in the list have parents, the nodes in the result + * will be unparented. + *

+ * Source range information on the original nodes is automatically copied to the new + * nodes. Client properties (properties) are not carried over. + *

+ * + * @param target the AST that is to own the nodes in the result + * @param nodes the list of nodes to copy + * (element type: ASTNode) + * @return the list of copied subtrees + * (element type: ASTNode) + */ + public static List copySubtrees(AST target, List nodes) { + List result = new ArrayList(nodes.size()); + for (Iterator it = nodes.iterator(); it.hasNext(); ) { + ASTNode oldNode = (ASTNode) it.next(); + ASTNode newNode = oldNode.clone(target); + result.add(newNode); + } + return result; + } + + /** + * Returns a deep copy of the subtree of AST nodes rooted at this node. + * The resulting nodes are owned by the given AST, which may be different + * from the AST of this node. Even if this node has a parent, the + * result node will be unparented. + *

+ * This method reports pre- and post-clone events, and dispatches + * to clone0(AST) which is reimplemented in node subclasses. + *

+ * + * @param target the AST that is to own the nodes in the result + * @return the root node of the copies subtree + */ + final ASTNode clone(AST target) { + this.ast.preCloneNodeEvent(this); + ASTNode c = this.clone0(target); + this.ast.postCloneNodeEvent(this, c); + return c; + } + + /** + * Returns a deep copy of the subtree of AST nodes rooted at this node. + * The resulting nodes are owned by the given AST, which may be different + * from the AST of this node. Even if this node has a parent, the + * result node will be unparented. + *

+ * This method must be implemented in subclasses. + *

+ *

+ * This method does not report pre- and post-clone events. + * All callers should instead call clone(AST) + * to ensure that pre- and post-clone events are reported. + *

+ *

+ * N.B. This method is package-private, so that the implementations + * of this method in each of the concrete AST node types do not + * clutter up the API doc. + *

+ * + * @param target the AST that is to own the nodes in the result + * @return the root node of the copies subtree + */ + abstract ASTNode clone0(AST target); + + /** + * Accepts the given visitor on a visit of the current node. + * + * @param visitor the visitor object + * @exception IllegalArgumentException if the visitor is null + */ + public final void accept(ASTVisitor visitor) { + if (visitor == null) { + throw new IllegalArgumentException(); + } + // begin with the generic pre-visit + visitor.preVisit(this); + // dynamic dispatch to internal method for type-specific visit/endVisit + accept0(visitor); + // end with the generic post-visit + visitor.postVisit(this); + } + + /** + * Accepts the given visitor on a type-specific visit of the current node. + * This method must be implemented in all concrete AST node types. + *

+ * General template for implementation on each concrete ASTNode class: + *

+	 * 
+	 * boolean visitChildren = visitor.visit(this);
+	 * if (visitChildren) {
+	 *    // visit children in normal left to right reading order
+	 *    acceptChild(visitor, getProperty1());
+	 *    acceptChildren(visitor, rawListProperty);
+	 *    acceptChild(visitor, getProperty2());
+	 * }
+	 * visitor.endVisit(this);
+	 * 
+	 * 
+ * Note that the caller (accept) take cares of invoking + * visitor.preVisit(this) and visitor.postVisit(this). + *

+ * + * @param visitor the visitor object + */ + abstract void accept0(ASTVisitor visitor); + + /** + * Accepts the given visitor on a visit of the current node. + *

+ * This method should be used by the concrete implementations of + * accept0 to traverse optional properties. Equivalent + * to child.accept(visitor) if child + * is not null. + *

+ * + * @param visitor the visitor object + * @param child the child AST node to dispatch too, or null + * if none + */ + final void acceptChild(ASTVisitor visitor, ASTNode child) { + if (child == null) { + return; + } + child.accept(visitor); + } + + /** + * Accepts the given visitor on a visit of the given live list of + * child nodes. + *

+ * This method must be used by the concrete implementations of + * accept to traverse list-values properties; it + * encapsulates the proper handling of on-the-fly changes to the list. + *

+ * + * @param visitor the visitor object + * @param children the child AST node to dispatch too, or null + * if none + */ + final void acceptChildren(ASTVisitor visitor, ASTNode.NodeList children) { + if(children == null){ + return; + } + // use a cursor to keep track of where we are up to + // (the list may be changing under foot) + NodeList.Cursor cursor = children.newCursor(); + try { + while (cursor.hasNext()) { + ASTNode child = (ASTNode) cursor.next(); + child.accept(visitor); + } + } finally { + children.releaseCursor(cursor); + } + } + + /** + * Returns the character index into the original source file indicating + * where the source fragment corresponding to this node begins. + *

+ * The parser supplies useful well-defined source ranges to the nodes it creates. + * See {@link ASTParser#setKind(int)} for details + * on precisely where source ranges begin and end. + *

+ * + * @return the 0-based character index, or -1 + * if no source position information is recorded for this node + * @see #getLength() + * @see ASTParser + */ + public final int getStartPosition() { + return this.startPosition; + } + + /** + * Returns the length in characters of the original source file indicating + * where the source fragment corresponding to this node ends. + *

+ * The parser supplies useful well-defined source ranges to the nodes it creates. + * See {@link ASTParser#setKind(int)} methods for details + * on precisely where source ranges begin and end. + *

+ * + * @return a (possibly 0) length, or 0 + * if no source position information is recorded for this node + * @see #getStartPosition() + * @see ASTParser + */ + public final int getLength() { + return this.length; + } + + /** + * Sets the source range of the original source file where the source + * fragment corresponding to this node was found. + *

+ * See {@link ASTParser#setKind(int)} for details + * on precisely where source ranges are supposed to begin and end. + *

+ * + * @param startPosition a 0-based character index, + * or -1 if no source position information is + * available for this node + * @param length a (possibly 0) length, + * or 0 if no source position information is recorded + * for this node + * @see #getStartPosition() + * @see #getLength() + * @see ASTParser + */ + public final void setSourceRange(int startPosition, int length) { + if (startPosition >= 0 && length < 0) { + throw new IllegalArgumentException(); + } + if (startPosition < 0 && length != 0) { + throw new IllegalArgumentException(); + } + // source positions are not considered a structural property + // but we protect them nevertheless + checkModifiable(); + this.startPosition = startPosition; + this.length = length; + } + + /** + * Returns a string representation of this node suitable for debugging + * purposes only. + * + * @return a debug string + */ + public final String toString() { + StringBuffer buffer = new StringBuffer(); + int p = buffer.length(); + try { + appendDebugString(buffer); + } catch (RuntimeException e) { + e.printStackTrace(); + // since debugger sometimes call toString methods, problems can easily happen when + // toString is called on an instance that is being initialized + buffer.setLength(p); + buffer.append("!"); //$NON-NLS-1$ + buffer.append(standardToString()); + } + return buffer.toString(); + } + + /** + * Returns the string representation of this node produced by the standard + * Object.toString method. + * + * @return a debug string + */ + final String standardToString() { + return super.toString(); + } + + /** + * Appends a debug representation of this node to the given string buffer. + *

+ * The ASTNode implementation of this method prints out the entire + * subtree. Subclasses may override to provide a more succinct representation. + *

+ * + * @param buffer the string buffer to append to + */ + void appendDebugString(StringBuffer buffer) { + // print the subtree by default + appendPrintString(buffer); + } + + /** + * Appends a standard JavaScript source code representation of this subtree to the given + * string buffer. + * + * @param buffer the string buffer to append to + */ + final void appendPrintString(StringBuffer buffer) { + NaiveASTFlattener printer = new NaiveASTFlattener(); + this.accept(printer); + buffer.append(printer.getResult()); + } + + /** + * Estimate of size of an object header in bytes. + */ + static final int HEADERS = 12; + + /** + * Approximate base size of an AST node instance in bytes, + * including object header and instance fields. + * That is, HEADERS + (# instance vars in ASTNode)*4. + */ + static final int BASE_NODE_SIZE = HEADERS + 7 * 4; + + /** + * Returns an estimate of the memory footprint, in bytes, + * of the given string. + * + * @param string the string to measure, or null + * @return the size of this string object in bytes, or + * 0 if the string is null + */ + static int stringSize(String string) { + int size = 0; + if (string != null) { + // Strings usually have 4 instance fields, one of which is a char[] + size += HEADERS + 4 * 4; + // char[] has 2 bytes per character + size += HEADERS + 2 * string.length(); + } + return size; + } + + /** + * Returns an estimate of the memory footprint in bytes of the entire + * subtree rooted at this node. + * + * @return the size of this subtree in bytes + */ + public final int subtreeBytes() { + return treeSize(); + } + + /** + * Returns an estimate of the memory footprint in bytes of the entire + * subtree rooted at this node. + *

+ * N.B. This method is package-private, so that the implementations + * of this method in each of the concrete AST node types do not + * clutter up the API doc. + *

+ * + * @return the size of this subtree in bytes + */ + abstract int treeSize(); + + /** + * Returns an estimate of the memory footprint of this node in bytes. + * The estimate does not include the space occupied by child nodes. + * + * @return the size of this node in bytes + */ + abstract int memSize(); + + public ASTNode getBodyChild() + { + ASTNode bodyChild=this; + while (bodyChild!=null) + { + if (bodyChild.parent instanceof JavaScriptUnit || bodyChild.parent instanceof BodyDeclaration) + return bodyChild; + bodyChild=bodyChild.parent; + } + return null; + + } + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTParser.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTParser.java new file mode 100644 index 0000000..1d7e542 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTParser.java @@ -0,0 +1,1161 @@ +/******************************************************************************* + * Copyright (c) 2004, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core.dom; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.wst.jsdt.core.IClassFile; +import org.eclipse.wst.jsdt.core.IJavaScriptUnit; +import org.eclipse.wst.jsdt.core.IJavaScriptElement; +import org.eclipse.wst.jsdt.core.IJavaScriptProject; +import org.eclipse.wst.jsdt.core.ITypeRoot; +import org.eclipse.wst.jsdt.core.JavaScriptCore; +import org.eclipse.wst.jsdt.core.JavaScriptModelException; +import org.eclipse.wst.jsdt.core.WorkingCopyOwner; +import org.eclipse.wst.jsdt.core.compiler.CategorizedProblem; +import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration; +import org.eclipse.wst.jsdt.internal.compiler.ast.ConstructorDeclaration; +import org.eclipse.wst.jsdt.internal.compiler.parser.RecoveryScanner; +import org.eclipse.wst.jsdt.internal.compiler.parser.RecoveryScannerData; +import org.eclipse.wst.jsdt.internal.compiler.parser.Scanner; +import org.eclipse.wst.jsdt.internal.core.BasicCompilationUnit; +import org.eclipse.wst.jsdt.internal.core.DefaultWorkingCopyOwner; +import org.eclipse.wst.jsdt.internal.core.PackageFragment; +import org.eclipse.wst.jsdt.internal.core.util.CodeSnippetParsingUtil; +import org.eclipse.wst.jsdt.internal.core.util.RecordedParsingInformation; +import org.eclipse.wst.jsdt.internal.core.util.Util; + +/** + * A JavaScript language parser for creating abstract syntax trees (ASTs). + *

+ * Example: Create basic AST from source string + *

+ * char[] source = ...;
+ * ASTParser parser = ASTParser.newParser(AST.JLS3);  
+ * parser.setSource(source);
+ * JavaScriptUnit result = (JavaScriptUnit) parser.createAST(null);
+ * 
+ * Once a configured parser instance has been used to create an AST, + * the settings are automatically reset to their defaults, + * ready for the parser instance to be reused. + *

+ *

+ * There are a number of configurable features: + *

    + *
  • Source string from {@link #setSource(char[]) char[]}, + * {@link #setSource(IJavaScriptUnit) IJavaScriptUnit}, + * or {@link #setSource(IClassFile) IClassFile}, and limited + * to a specified {@linkplain #setSourceRange(int,int) subrange}.
  • + *
  • Whether {@linkplain #setResolveBindings(boolean) bindings} will be created.
  • + *
  • Which {@linkplain #setWorkingCopyOwner(WorkingCopyOwner) + * working set owner} to use when resolving bindings).
  • + *
  • A hypothetical {@linkplain #setUnitName(String) javaScript unit file name} + * and {@linkplain #setProject(IJavaScriptProject) JavaScript project} + * for locating a raw source string in the JavaScript model (when + * resolving bindings)
  • + *
  • Which {@linkplain #setCompilerOptions(Map) validator options} + * to use.
  • + *
  • Whether to parse just {@linkplain #setKind(int) an expression, statements, + * or body declarations} rather than an entire javaScript unit.
  • + *
  • Whether to return a {@linkplain #setFocalPosition(int) abridged AST} + * focused on the declaration containing a given source position.
  • + *
+ *

+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public class ASTParser { + + /** + * Kind constant used to request that the source be parsed + * as a single expression. + */ + public static final int K_EXPRESSION = 0x01; + + /** + * Kind constant used to request that the source be parsed + * as a sequence of statements. + */ + public static final int K_STATEMENTS = 0x02; + + /** + * Kind constant used to request that the source be parsed + * as a sequence of class body declarations. + */ + public static final int K_CLASS_BODY_DECLARATIONS = 0x04; + + /** + * Kind constant used to request that the source be parsed + * as a javaScript unit. + */ + public static final int K_COMPILATION_UNIT = 0x08; + + /** + * Creates a new object for creating a JavaScript abstract syntax tree + * (AST) following the specified set of API rules. + * + * @param level the API level; one of the LEVEL constants + * declared on AST + * @return new ASTParser instance + */ + public static ASTParser newParser(int level) { + return new ASTParser(level); + } + + /** + * Level of AST API desired. + */ + private final int apiLevel; + + /** + * Kind of parse requested. Defaults to an entire javaScript unit. + */ + private int astKind; + + /** + * Compiler options. Defaults to JavaScriptCore.getOptions(). + */ + private Map compilerOptions; + + /** + * Request for bindings. Defaults to false. + */ + private boolean resolveBindings; + + /** + * Request for a partial AST. Defaults to false. + */ + private boolean partial = false; + + /** + * Request for a statements recovery. Defaults to false. + */ + private boolean statementsRecovery; + + /** + * Request for a bindings recovery. Defaults to false. + */ + private boolean bindingsRecovery; + + + /** + * The focal point for a partial AST request. + * Only used when partial is true. + */ + private int focalPointPosition; + + /** + * Source string. + */ + private char[] rawSource = null; + + /** + * JavaScript unit supplying the source. + */ + private ITypeRoot typeRoot = null; + + /** + * Character-based offset into the source string where parsing is to + * begin. Defaults to 0. + */ + private int sourceOffset = 0; + + /** + * Character-based length limit, or -1 if unlimited. + * All characters in the source string between offset + * and offset+length-1 inclusive are parsed. Defaults to -1, + * which means the rest of the source string. + */ + private int sourceLength = -1; + + /** + * Working copy owner. Defaults to primary owner. + */ + private WorkingCopyOwner workingCopyOwner = DefaultWorkingCopyOwner.PRIMARY; + + /** + * JavaScript project used to resolve names, or null if none. + * Defaults to none. + */ + private IJavaScriptProject project = null; + + /** + * Name of the javaScript unit for resolving bindings, or + * null if none. Defaults to none. + */ + private String unitName = null; + + /** + * Creates a new AST parser for the given API level. + *

+ * N.B. This constructor is package-private. + *

+ * + * @param level the API level; one of the LEVEL constants + * declared on AST + */ + ASTParser(int level) { + if ((level != AST.JLS2_INTERNAL) + && (level != AST.JLS3)) { + throw new IllegalArgumentException(); + } + this.apiLevel = level; + initializeDefaults(); + } + + /** + * Sets all the setting to their default values. + */ + private void initializeDefaults() { + this.astKind = K_COMPILATION_UNIT; + this.rawSource = null; + this.typeRoot = null; + this.resolveBindings = false; + this.sourceLength = -1; + this.sourceOffset = 0; + this.workingCopyOwner = DefaultWorkingCopyOwner.PRIMARY; + this.unitName = null; + this.project = null; + this.partial = false; + Map options = JavaScriptCore.getOptions(); + options.remove(JavaScriptCore.COMPILER_TASK_TAGS); // no need to parse task tags + this.compilerOptions = options; + } + + /** + * Requests that the validator should perform bindings recovery. + * When bindings recovery is enabled the validator returns incomplete bindings. + *

+ * Default to false. + *

+ *

This should be set to true only if bindings are resolved. It has no effect if there is no binding + * resolution.

+ * + * @param enabled true if incomplete bindings are expected, + * and false if only complete bindings are expected. + * + * @see IBinding#isRecovered() + */ + public void setBindingsRecovery(boolean enabled) { + this.bindingsRecovery = enabled; + } + + /** + * Sets the validator options to be used when parsing. + *

+ * Note that {@link #setSource(IClassFile)}, + * {@link #setSource(IJavaScriptUnit)}, + * and {@link #setProject(IJavaScriptProject)} reset the validator options + * based on the JavaScript project. In other cases, validator options default + * to {@link JavaScriptCore#getOptions()}. In either case, and especially + * in the latter, the caller should carefully weight the consequences of + * allowing validator options to be defaulted as opposed to being + * explicitly specified for the ASTParser instance. + * For instance, there is a validator option called "Source Compatibility Mode" + * which determines which JDK level the source code is expected to meet. + * If you specify "1.4", then "assert" is treated as a keyword and disallowed + * as an identifier; if you specify "1.3", then "assert" is allowed as an + * identifier. So this particular setting has a major bearing on what is + * considered syntactically legal. By explicitly specifying the setting, + * the client control exactly how the parser works. On the other hand, + * allowing default settings means the parsing behaves like other JDT tools. + *

+ * + * @param options the table of options (key type: String; + * value type: String), or null + * to set it back to the default + */ + public void setCompilerOptions(Map options) { + if (options == null) { + options = JavaScriptCore.getOptions(); + } else { + // copy client's options so as to not do any side effect on them + options = new HashMap(options); + } + options.remove(JavaScriptCore.COMPILER_TASK_TAGS); // no need to parse task tags + this.compilerOptions = options; + } + + /** + * Requests that the validator should provide binding information for + * the AST nodes it creates. + *

+ * Default to false (no bindings). + *

+ *

+ * If setResolveBindings(true), the various names + * and types appearing in the AST can be resolved to "bindings" + * by calling the resolveBinding methods. These bindings + * draw connections between the different parts of a program, and + * generally afford a more powerful vantage point for clients who wish to + * analyze a program's structure more deeply. These bindings come at a + * considerable cost in both time and space, however, and should not be + * requested frivolously. The additional space is not reclaimed until the + * AST, all its nodes, and all its bindings become garbage. So it is very + * important to not retain any of these objects longer than absolutely + * necessary. Bindings are resolved at the time the AST is created. Subsequent + * modifications to the AST do not affect the bindings returned by + * resolveBinding methods in any way; these methods return the + * same binding as before the AST was modified (including modifications + * that rearrange subtrees by reparenting nodes). + * If setResolveBindings(false) (the default), the analysis + * does not go beyond parsing and building the tree, and all + * resolveBinding methods return null from the + * outset. + *

+ *

+ * When bindings are requested, instead of considering javaScript units on disk only + * one can supply a WorkingCopyOwner. Working copies owned + * by this owner take precedence over the underlying javaScript units when looking + * up names and drawing the connections. + *

+ *

+ * Binding information is obtained from the JavaScript model. + * This means that the javaScript unit must be located relative to the + * JavaScript model. This happens automatically when the source code comes from + * either {@link #setSource(IJavaScriptUnit) setSource(IJavaScriptUnit)} + * or {@link #setSource(IClassFile) setSource(IClassFile)}. + * When source is supplied by {@link #setSource(char[]) setSource(char[])}, + * the location must be extablished explicitly by calling + * {@link #setProject(IJavaScriptProject)} and {@link #setUnitName(String)}. + * Note that the validator options that affect doc comment checking may also + * affect whether any bindings are resolved for nodes within doc comments. + *

+ * + * @param bindings true if bindings are wanted, + * and false if bindings are not of interest + */ + public void setResolveBindings(boolean bindings) { + this.resolveBindings = bindings; + } + + /** + * Requests an abridged abstract syntax tree. + * By default, complete ASTs are returned. + *

+ * When true the resulting AST does not have nodes for + * the entire javaScript unit. Rather, the AST is only fleshed out + * for the node that include the given source position. This kind of limited + * AST is sufficient for certain purposes but totally unsuitable for others. + * In places where it can be used, the limited AST offers the advantage of + * being smaller and faster to construct. + *

+ *

+ * The AST will include nodes for all of the javaScript unit's functions, top-level vars, + * package, import, and top-level type declarations. It will also always contain + * nodes for all the body declarations for those top-level types, as well + * as body declarations for any member types. However, some of the body + * declarations may be abridged. In particular, the statements ordinarily + * found in the body of a method declaration node will not be included + * (the block will be empty) unless the source position falls somewhere + * within the source range of that method declaration node. The same is true + * for initializer declarations; the statements ordinarily found in the body + * of initializer node will not be included unless the source position falls + * somewhere within the source range of that initializer declaration node. + * Field declarations are never abridged. Note that the AST for the body of + * that one unabridged method (or initializer) is 100% complete; it has all + * its statements, including any local or anonymous type declarations + * embedded within them. When the the given position is not located within + * the source range of any body declaration of a top-level type, the AST + * returned will be a skeleton that includes nodes for all and only the major + * declarations; this kind of AST is still quite useful because it contains + * all the constructs that introduce names visible to the world outside the + * javaScript unit. + *

+ * + * @param position a position into the corresponding body declaration + */ + public void setFocalPosition(int position) { + this.partial = true; + this.focalPointPosition = position; + } + + /** + * Sets the kind of constructs to be parsed from the source. + * Defaults to an entire javaScript unit. + *

+ * When the parse is successful the result returned includes the ASTs for the + * requested source: + *

    + *
  • {@link #K_JAVASCRIPT_UNIT K_JAVASCRIPT_UNIT}: The result node + * is a {@link JavaScriptUnit}.
  • + *
  • {@link #K_CLASS_BODY_DECLARATIONS K_CLASS_BODY_DECLARATIONS}: The result node + * is a {@link TypeDeclaration} whose + * {@link TypeDeclaration#bodyDeclarations() bodyDeclarations} + * are the new trees. Other aspects of the type declaration are unspecified.
  • + *
  • {@link #K_STATEMENTS K_STATEMENTS}: The result node is a + * {@link Block Block} whose {@link Block#statements() statements} + * are the new trees. Other aspects of the block are unspecified.
  • + *
  • {@link #K_EXPRESSION K_EXPRESSION}: The result node is a subclass of + * {@link Expression Expression}. Other aspects of the expression are unspecified.
  • + *
+ * The resulting AST node is rooted under (possibly contrived) + * {@link JavaScriptUnit JavaScriptUnit} node, to allow the + * client to retrieve the following pieces of information + * available there: + *
    + *
  • {@linkplain JavaScriptUnit#getLineNumber(int) Line number map}. Line + * numbers start at 1 and only cover the subrange scanned + * (source[offset] through source[offset+length-1]).
  • + *
  • {@linkplain JavaScriptUnit#getMessages() Compiler messages} + * and {@linkplain JavaScriptUnit#getProblems() detailed problem reports}. + * Character positions are relative to the start of + * source; line positions are for the subrange scanned.
  • + *
  • {@linkplain JavaScriptUnit#getCommentList() Comment list} + * for the subrange scanned.
  • + *
+ * The contrived nodes do not have source positions. Other aspects of the + * {@link JavaScriptUnit JavaScriptUnit} node are unspecified, including + * the exact arrangment of intervening nodes. + *

+ *

+ * Lexical or syntax errors detected while parsing can result in + * a result node being marked as {@link ASTNode#MALFORMED MALFORMED}. + * In more severe failure cases where the parser is unable to + * recognize the input, this method returns + * a {@link JavaScriptUnit JavaScriptUnit} node with at least the + * validator messages. + *

+ *

Each node in the subtree (other than the contrived nodes) + * carries source range(s) information relating back + * to positions in the given source (the given source itself + * is not remembered with the AST). + * The source range usually begins at the first character of the first token + * corresponding to the node; leading whitespace and comments are not + * included. The source range usually extends through the last character of + * the last token corresponding to the node; trailing whitespace and + * comments are not included. There are a handful of exceptions + * (including the various body declarations); the + * specification for these node type spells out the details. + * Source ranges nest properly: the source range for a child is always + * within the source range of its parent, and the source ranges of sibling + * nodes never overlap. + *

+ *

+ * Binding information is only computed when kind is + * K_JAVASCRIPT_UNIT. + *

+ * + * @param kind the kind of construct to parse: one of + * {@link #K_JAVASCRIPT_UNIT}, + * {@link #K_CLASS_BODY_DECLARATIONS}, + * {@link #K_EXPRESSION}, + * {@link #K_STATEMENTS} + */ + public void setKind(int kind) { + if ((kind != K_COMPILATION_UNIT) + && (kind != K_CLASS_BODY_DECLARATIONS) + && (kind != K_EXPRESSION) + && (kind != K_STATEMENTS)) { + throw new IllegalArgumentException(); + } + this.astKind = kind; + } + + /** + * Sets the source code to be parsed. + * + * @param source the source string to be parsed, + * or null if none + */ + public void setSource(char[] source) { + this.rawSource = source; + // clear the type root + this.typeRoot = null; + } + + /** + * Sets the source code to be parsed. + * This method automatically sets the project (and compiler + * options) based on the given javaScript unit, in a manner + * equivalent to setProject(source.getJavaProject()) + * + * @param source the JavaScript model javaScript unit whose source code + * is to be parsed, or null if none + */ + public void setSource(IJavaScriptUnit source) { + setSource((ITypeRoot)source); + } + + /** + * Sets the source code to be parsed. + *

This method automatically sets the project (and compiler + * options) based on the given javaScript unit, in a manner + * equivalent to setProject(source.getJavaProject()).

+ * + * @param source the JavaScript file whose corresponding source code + * is to be parsed, or null if none + */ + public void setSource(IClassFile source) { + setSource((ITypeRoot)source); + } + + /** + * Sets the source code to be parsed. + *

This method automatically sets the project (and compiler + * options) based on the given javaScript unit, in a manner + * equivalent to setProject(source.getJavaProject()).

+ * + * @param source the JavaScript model javaScript unit whose corresponding source code + * is to be parsed, or null if none + */ + public void setSource(ITypeRoot source) { + this.typeRoot = source; + // clear the raw source + this.rawSource = null; + if (source != null) { + this.project = source.getJavaScriptProject(); + Map options = this.project.getOptions(true); + options.remove(JavaScriptCore.COMPILER_TASK_TAGS); // no need to parse task tags + this.compilerOptions = options; + } + } + + /** + * Sets the subrange of the source code to be parsed. + * By default, the entire source string will be parsed + * (offset 0 and length -1). + * + * @param offset the index of the first character to parse + * @param length the number of characters to parse, or -1 if + * the remainder of the source string is + */ + public void setSourceRange(int offset, int length) { + if (offset < 0 || length < -1) { + throw new IllegalArgumentException(); + } + this.sourceOffset = offset; + this.sourceLength = length; + } + + /** + * Requests that the validator should perform statements recovery. + * When statements recovery is enabled the validator tries to create statement nodes + * from code containing syntax errors + *

+ * Default to false. + *

+ * + * @param enabled true if statements containing syntax errors are wanted, + * and false if these statements aren't wanted. + * + */ + public void setStatementsRecovery(boolean enabled) { + this.statementsRecovery = enabled; + } + + /** + * Sets the working copy owner using when resolving bindings, where + * null means the primary owner. Defaults to the primary owner. + * + * @param owner the owner of working copies that take precedence over underlying + * javaScript units, or null if the primary owner should be used + */ + public void setWorkingCopyOwner(WorkingCopyOwner owner) { + if (owner == null) { + this.workingCopyOwner = DefaultWorkingCopyOwner.PRIMARY; + } else { + this.workingCopyOwner = owner; + } + } + + /** + * Sets the name of the javaScript unit that would hypothetically contains + * the source string. This is used in conjunction with {@link #setSource(char[])} + * and {@link #setProject(IJavaScriptProject) } to locate the javaScript unit relative to a JavaScript project. + * Defaults to none (null). + *

+ * The name of the javaScript unit must be supplied for resolving bindings. + * This name should be suffixed by a dot ('.') followed by one of the + * {@link JavaScriptCore#getJavaScriptLikeExtensions() JavaScript-like extensions}. + * + *

This name must represent the full path of the unit inside the given project. For example, if the source + * declares a public class named "Foo" in a project "P", the name of the javaScript unit must be + * "/P/Foo.js". If the source declares a public class name "Bar" in a package "p1.p2" in a project "P", + * the name of the javaScript unit must be "/P/p1/p2/Bar.js".

+ * + * @param unitName the name of the javaScript unit that would contain the source + * string, or null if none + */ + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + /** + * Sets the JavaScript project used when resolving bindings. + * This method automatically sets the compiler + * options based on the given project: + *
+	 * setCompilerOptions(project.getOptions(true));
+	 * 
+ * See {@link #setCompilerOptions(Map)} for a discussion of + * the pros and cons of using these options vs specifying + * validator options explicitly. + * This setting is used in conjunction with setSource(char[]). + * For the purposes of resolving bindings, types declared in the + * source string will hide types by the same name available + * through the includepath of the given project. + * Defaults to none (null). + * + * @param project the JavaScript project used to resolve names, or + * null if none + */ + public void setProject(IJavaScriptProject project) { + this.project = project; + if (project != null) { + Map options = project.getOptions(true); + options.remove(JavaScriptCore.COMPILER_TASK_TAGS); // no need to parse task tags + this.compilerOptions = options; + } + } + + /** + * Creates an abstract syntax tree. + *

+ * A successful call to this method returns all settings to their + * default values so the object is ready to be reused. + *

+ * + * @param monitor the progress monitor used to report progress and request cancelation, + * or null if none + * @return an AST node whose type depends on the kind of parse + * requested, with a fallback to a JavaScriptUnit + * in the case of severe parsing errors + * @exception IllegalStateException if the settings provided + * are insufficient, contradictory, or otherwise unsupported + */ + public ASTNode createAST(IProgressMonitor monitor) { + ASTNode result = null; + if (monitor != null) monitor.beginTask("", 1); //$NON-NLS-1$ + try { + if (this.rawSource == null && this.typeRoot == null) { + throw new IllegalStateException("source not specified"); //$NON-NLS-1$ + } + result = internalCreateAST(monitor); + } finally { + // re-init defaults to allow reuse (and avoid leaking) + initializeDefaults(); + if (monitor != null) monitor.done(); + } + return result; + } + + /** + * Creates ASTs for a batch of javaScript units. + * When bindings are being resolved, processing a + * batch of javaScript units is more efficient because much + * of the work involved in resolving bindings can be shared. + *

+ * When bindings are being resolved, all javaScript units must + * come from the same JavaScript project, which must be set beforehand + * with setProject. + * The javaScript units are processed one at a time in no + * specified order. For each of the javaScript units in turn, + *

    + *
  • ASTParser.createAST is called to parse it + * and create a corresponding AST. The calls to + * ASTParser.createAST all employ the same settings.
  • + *
  • ASTRequestor.acceptAST is called passing + * the javaScript unit and the corresponding AST to + * requestor. + *
  • + *
+ * Note only ASTs from the given javaScript units are reported + * to the requestor. If additional javaScript units are required to + * resolve the original ones, the corresponding ASTs are not + * reported to the requestor. + *

+ *

+ * Note also the following parser parameters are used, regardless of what + * may have been specified: + *

    + *
  • The {@linkplain #setKind(int) parser kind} is K_JAVASCRIPT_UNIT
  • + *
  • The {@linkplain #setSourceRange(int,int) source range} is (0, -1)
  • + *
  • The {@linkplain #setFocalPosition(int) focal position} is not set
  • + *
+ *

+ *

+ * The bindingKeys parameter specifies bindings keys + * ({@link IBinding#getKey()}) that are to be looked up. These keys may + * be for elements either inside or outside the set of compilation + * units being processed. When bindings are being resolved, + * the keys and corresponding bindings (or null if none) are + * passed to ASTRequestor.acceptBinding. Note that binding keys + * for elements outside the set of javaScript units being processed are looked up + * after all ASTRequestor.acceptAST callbacks have been made. + * Binding keys for elements inside the set of javaScript units being processed + * are looked up and reported right after the corresponding + * ASTRequestor.acceptAST callback has been made. + * No ASTRequestor.acceptBinding callbacks are made unless + * bindings are being resolved. + *

+ *

+ * A successful call to this method returns all settings to their + * default values so the object is ready to be reused. + *

+ * + * @param compilationUnits the javaScript units to create ASTs for + * @param bindingKeys the binding keys to create bindings for + * @param requestor the AST requestor that collects abtract syntax trees and bindings + * @param monitor the progress monitor used to report progress and request cancelation, + * or null if none + * @exception IllegalStateException if the settings provided + * are insufficient, contradictory, or otherwise unsupported + */ + public void createASTs(IJavaScriptUnit[] compilationUnits, String[] bindingKeys, ASTRequestor requestor, IProgressMonitor monitor) { + try { + int flags = 0; + if (this.statementsRecovery) flags |= IJavaScriptUnit.ENABLE_STATEMENTS_RECOVERY; + if (this.resolveBindings) { + if (this.project == null) + throw new IllegalStateException("project not specified"); //$NON-NLS-1$ + if (this.bindingsRecovery) flags |= IJavaScriptUnit.ENABLE_BINDINGS_RECOVERY; + JavaScriptUnitResolver.resolve(compilationUnits, bindingKeys, requestor, this.apiLevel, this.compilerOptions, this.project, this.workingCopyOwner, flags, monitor); + } else { + JavaScriptUnitResolver.parse(compilationUnits, requestor, this.apiLevel, this.compilerOptions, flags, monitor); + } + } finally { + // re-init defaults to allow reuse (and avoid leaking) + initializeDefaults(); + } + } + + /** + * Creates bindings for a batch of JavaScript elements. These elements are either + * enclosed in {@link IJavaScriptUnit}s or in {@link IClassFile}s. + *

+ * All enclosing javaScript units must + * come from the same JavaScript project, which must be set beforehand + * with setProject. + *

+ *

+ * All elements must exist. If one doesn't exist, an IllegalStateException + * is thrown. + *

+ *

+ * The returned array has the same size as the given elements array. At a given position + * it contains the binding of the corresponding JavaScript element, or null + * if no binding could be created. + *

+ *

+ * Note also the following parser parameters are used, regardless of what + * may have been specified: + *

    + *
  • The {@linkplain #setResolveBindings(boolean) binding resolution flag} is true
  • + *
  • The {@linkplain #setKind(int) parser kind} is K_JAVASCRIPT_UNIT
  • + *
  • The {@linkplain #setSourceRange(int,int) source range} is (0, -1)
  • + *
  • The {@linkplain #setFocalPosition(int) focal position} is not set
  • + *
+ *

+ *

+ * A successful call to this method returns all settings to their + * default values so the object is ready to be reused. + *

+ * + * @param elements the JavaScript elements to create bindings for + * @return the bindings for the given JavaScript elements, possibly containing nulls + * if some bindings could not be created + * @exception IllegalStateException if the settings provided + * are insufficient, contradictory, or otherwise unsupported + */ + public IBinding[] createBindings(IJavaScriptElement[] elements, IProgressMonitor monitor) { + try { + if (this.project == null) + throw new IllegalStateException("project not specified"); //$NON-NLS-1$ + int flags = 0; + if (this.statementsRecovery) flags |= IJavaScriptUnit.ENABLE_STATEMENTS_RECOVERY; + if (this.bindingsRecovery) flags |= IJavaScriptUnit.ENABLE_BINDINGS_RECOVERY; + return JavaScriptUnitResolver.resolve(elements, this.apiLevel, this.compilerOptions, this.project, this.workingCopyOwner,flags, monitor); + } finally { + // re-init defaults to allow reuse (and avoid leaking) + initializeDefaults(); + } + } + + private ASTNode internalCreateAST(IProgressMonitor monitor) { + boolean needToResolveBindings = this.resolveBindings; + switch(this.astKind) { + case K_CLASS_BODY_DECLARATIONS : + case K_EXPRESSION : + case K_STATEMENTS : + if (this.rawSource != null) { + if (this.sourceOffset + this.sourceLength > this.rawSource.length) { + throw new IllegalStateException(); + } + return internalCreateASTForKind(); + } + break; + case K_COMPILATION_UNIT : + CompilationUnitDeclaration compilationUnitDeclaration = null; + try { + NodeSearcher searcher = null; + org.eclipse.wst.jsdt.internal.compiler.env.ICompilationUnit sourceUnit = null; + WorkingCopyOwner wcOwner = this.workingCopyOwner; + if (this.typeRoot instanceof IJavaScriptUnit) { + /* + * this.compilationUnitSource is an instance of org.eclipse.wst.jsdt.internal.core.CompilationUnit that implements + * both org.eclipse.wst.jsdt.core.IJavaScriptUnit and org.eclipse.wst.jsdt.internal.compiler.env.ICompilationUnit + */ + sourceUnit = (org.eclipse.wst.jsdt.internal.compiler.env.ICompilationUnit) this.typeRoot; + /* + * use a BasicCompilation that caches the source instead of using the compilationUnitSource directly + * (if it is a working copy, the source can change between the parse and the AST convertion) + * (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=75632) + */ + sourceUnit = new BasicCompilationUnit(sourceUnit.getContents(), sourceUnit.getPackageName(), new String(sourceUnit.getFileName()), this.project); + wcOwner = ((IJavaScriptUnit) this.typeRoot).getOwner(); + } else if (this.typeRoot instanceof IClassFile) { + try { + String sourceString = this.typeRoot.getSource(); + if (sourceString == null) { + throw new IllegalStateException(); + } + PackageFragment packageFragment = (PackageFragment) this.typeRoot.getParent(); +// BinaryType type = (BinaryType) this.typeRoot.findPrimaryType(); + char[] fileName =this.typeRoot.getElementName().toCharArray(); +// IBinaryType binaryType = (IBinaryType) type.getElementInfo(); +// // file name is used to recreate the JavaScript element, so it has to be the toplevel .class file name +// char[] fileName = type.getElementName().toCharArray(); +// int firstDollar = CharOperation.indexOf('$', fileName); +// if (firstDollar != -1) { +// char[] suffix = SuffixConstants.SUFFIX_class; +// int suffixLength = suffix.length; +// char[] newFileName = new char[firstDollar + suffixLength]; +// System.arraycopy(fileName, 0, newFileName, 0, firstDollar); +// System.arraycopy(suffix, 0, newFileName, firstDollar, suffixLength); +// fileName = newFileName; +// } + sourceUnit = new BasicCompilationUnit(sourceString.toCharArray(), Util.toCharArrays(packageFragment.names), new String(fileName), this.project); + } catch(JavaScriptModelException e) { + // an error occured accessing the javaScript element + throw new IllegalStateException(); + } + } else if (this.rawSource != null) { + needToResolveBindings = this.resolveBindings && this.unitName != null && this.project != null && this.compilerOptions != null; + sourceUnit = new BasicCompilationUnit(this.rawSource, null, this.unitName == null ? "" : this.unitName, this.project); //$NON-NLS-1$ + } else { + throw new IllegalStateException(); + } + if (this.partial) { + searcher = new NodeSearcher(this.focalPointPosition); + } + int flags = 0; + if (this.statementsRecovery) flags |= IJavaScriptUnit.ENABLE_STATEMENTS_RECOVERY; + if (needToResolveBindings) { + if (this.bindingsRecovery) flags |= IJavaScriptUnit.ENABLE_BINDINGS_RECOVERY; + try { + // parse and resolve + compilationUnitDeclaration = + JavaScriptUnitResolver.resolve( + sourceUnit, + this.project, + searcher, + this.compilerOptions, + this.workingCopyOwner, + flags, + monitor); + } catch (JavaScriptModelException e) { + flags &= ~IJavaScriptUnit.ENABLE_BINDINGS_RECOVERY; + compilationUnitDeclaration = JavaScriptUnitResolver.parse( + sourceUnit, + searcher, + this.compilerOptions, + flags); + needToResolveBindings = false; + } + } else { + compilationUnitDeclaration = JavaScriptUnitResolver.parse( + sourceUnit, + searcher, + this.compilerOptions, + flags); + needToResolveBindings = false; + } + JavaScriptUnit result = JavaScriptUnitResolver.convert( + compilationUnitDeclaration, + sourceUnit.getContents(), + this.apiLevel, + this.compilerOptions, + needToResolveBindings, + wcOwner, + needToResolveBindings ? new DefaultBindingResolver.BindingTables() : null, + flags, + monitor); + result.setTypeRoot(this.typeRoot); + return result; + } finally { + if (compilationUnitDeclaration != null && this.resolveBindings) { + compilationUnitDeclaration.cleanUp(); + if (compilationUnitDeclaration.scope!=null) + compilationUnitDeclaration.scope.cleanup(); + } + } + } + throw new IllegalStateException(); + } + + /** + * Parses the given source between the bounds specified by the given offset (inclusive) + * and the given length and creates and returns a corresponding abstract syntax tree. + *

+ * When the parse is successful the result returned includes the ASTs for the + * requested source: + *

    + *
  • {@link #K_CLASS_BODY_DECLARATIONS K_CLASS_BODY_DECLARATIONS}: The result node + * is a {@link TypeDeclaration TypeDeclaration} whose + * {@link TypeDeclaration#bodyDeclarations() bodyDeclarations} + * are the new trees. Other aspects of the type declaration are unspecified.
  • + *
  • {@link #K_STATEMENTS K_STATEMENTS}: The result node is a + * {@link Block Block} whose {@link Block#statements() statements} + * are the new trees. Other aspects of the block are unspecified.
  • + *
  • {@link #K_EXPRESSION K_EXPRESSION}: The result node is a subclass of + * {@link Expression Expression}. Other aspects of the expression are unspecified.
  • + *
+ * The resulting AST node is rooted under an contrived + * {@link JavaScriptUnit JavaScriptUnit} node, to allow the + * client to retrieve the following pieces of information + * available there: + *
    + *
  • {@linkplain JavaScriptUnit#getLineNumber(int) Line number map}. Line + * numbers start at 1 and only cover the subrange scanned + * (source[offset] through source[offset+length-1]).
  • + *
  • {@linkplain JavaScriptUnit#getMessages() Compiler messages} + * and {@linkplain JavaScriptUnit#getProblems() detailed problem reports}. + * Character positions are relative to the start of + * source; line positions are for the subrange scanned.
  • + *
  • {@linkplain JavaScriptUnit#getCommentList() Comment list} + * for the subrange scanned.
  • + *
+ * The contrived nodes do not have source positions. Other aspects of the + * {@link JavaScriptUnit JavaScriptUnit} node are unspecified, including + * the exact arrangment of intervening nodes. + *

+ *

+ * Lexical or syntax errors detected while parsing can result in + * a result node being marked as {@link ASTNode#MALFORMED MALFORMED}. + * In more severe failure cases where the parser is unable to + * recognize the input, this method returns + * a {@link JavaScriptUnit JavaScriptUnit} node with at least the + * validator messages. + *

+ *

Each node in the subtree (other than the contrived nodes) + * carries source range(s) information relating back + * to positions in the given source (the given source itself + * is not remembered with the AST). + * The source range usually begins at the first character of the first token + * corresponding to the node; leading whitespace and comments are not + * included. The source range usually extends through the last character of + * the last token corresponding to the node; trailing whitespace and + * comments are not included. There are a handful of exceptions + * (including the various body declarations); the + * specification for these node type spells out the details. + * Source ranges nest properly: the source range for a child is always + * within the source range of its parent, and the source ranges of sibling + * nodes never overlap. + *

+ *

+ * This method does not compute binding information; all resolveBinding + * methods applied to nodes of the resulting AST return null. + *

+ * + * @return an AST node whose type depends on the kind of parse + * requested, with a fallback to a JavaScriptUnit + * in the case of severe parsing errors + * @see ASTNode#getStartPosition() + * @see ASTNode#getLength() + */ + private ASTNode internalCreateASTForKind() { + final ASTConverter converter = new ASTConverter(this.compilerOptions, false, null); + converter.compilationUnitSource = this.rawSource; + converter.compilationUnitSourceLength = this.rawSource.length; + converter.scanner.setSource(this.rawSource); + + AST ast = AST.newAST(this.apiLevel); + ast.setDefaultNodeFlag(ASTNode.ORIGINAL); + ast.setBindingResolver(new BindingResolver()); + if (this.statementsRecovery) { + ast.setFlag(IJavaScriptUnit.ENABLE_STATEMENTS_RECOVERY); + } + converter.setAST(ast); + CodeSnippetParsingUtil codeSnippetParsingUtil = new CodeSnippetParsingUtil(); + JavaScriptUnit compilationUnit = ast.newJavaScriptUnit(); + if (this.sourceLength == -1) { + this.sourceLength = this.rawSource.length; + } + switch(this.astKind) { + case K_STATEMENTS : + ConstructorDeclaration constructorDeclaration = codeSnippetParsingUtil.parseStatements(this.rawSource, this.sourceOffset, this.sourceLength, this.compilerOptions, true, this.statementsRecovery); + RecoveryScannerData data = constructorDeclaration.compilationResult.recoveryScannerData; + if(data != null) { + Scanner scanner = converter.scanner; + converter.scanner = new RecoveryScanner(scanner, data.removeUnused()); + converter.docParser.scanner = converter.scanner; + converter.scanner.setSource(scanner.source); + } + RecordedParsingInformation recordedParsingInformation = codeSnippetParsingUtil.recordedParsingInformation; + int[][] comments = recordedParsingInformation.commentPositions; + if (comments != null) { + converter.buildCommentsTable(compilationUnit, comments); + } + compilationUnit.setLineEndTable(recordedParsingInformation.lineEnds); + Block block = ast.newBlock(); + block.setSourceRange(this.sourceOffset, this.sourceOffset + this.sourceLength); + org.eclipse.wst.jsdt.internal.compiler.ast.Statement[] statements = constructorDeclaration.statements; + if (statements != null) { + int statementsLength = statements.length; + for (int i = 0; i < statementsLength; i++) { + if (statements[i] instanceof org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration) { + converter.checkAndAddMultipleLocalDeclaration(statements, i, block.statements()); + } else { + Statement statement = converter.convert(statements[i]); + if (statement != null) { + block.statements().add(statement); + } + } + } + } + rootNodeToCompilationUnit(ast, compilationUnit, block, recordedParsingInformation, data); + ast.setDefaultNodeFlag(0); + ast.setOriginalModificationCount(ast.modificationCount()); + return block; + case K_EXPRESSION : + org.eclipse.wst.jsdt.internal.compiler.ast.Expression expression = codeSnippetParsingUtil.parseExpression(this.rawSource, this.sourceOffset, this.sourceLength, this.compilerOptions, true); + recordedParsingInformation = codeSnippetParsingUtil.recordedParsingInformation; + comments = recordedParsingInformation.commentPositions; + if (comments != null) { + converter.buildCommentsTable(compilationUnit, comments); + } + compilationUnit.setLineEndTable(recordedParsingInformation.lineEnds); + if (expression != null) { + Expression expression2 = converter.convert(expression); + rootNodeToCompilationUnit(expression2.getAST(), compilationUnit, expression2, codeSnippetParsingUtil.recordedParsingInformation, null); + ast.setDefaultNodeFlag(0); + ast.setOriginalModificationCount(ast.modificationCount()); + return expression2; + } else { + CategorizedProblem[] problems = recordedParsingInformation.problems; + if (problems != null) { + compilationUnit.setProblems(problems); + } + ast.setDefaultNodeFlag(0); + ast.setOriginalModificationCount(ast.modificationCount()); + return compilationUnit; + } + case K_CLASS_BODY_DECLARATIONS : + final org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode[] nodes = codeSnippetParsingUtil.parseClassBodyDeclarations(this.rawSource, this.sourceOffset, this.sourceLength, this.compilerOptions, true); + recordedParsingInformation = codeSnippetParsingUtil.recordedParsingInformation; + comments = recordedParsingInformation.commentPositions; + if (comments != null) { + converter.buildCommentsTable(compilationUnit, comments); + } + compilationUnit.setLineEndTable(recordedParsingInformation.lineEnds); + if (nodes != null) { +// TypeDeclaration typeDeclaration = converter.convert(nodes); +// typeDeclaration.setSourceRange(this.sourceOffset, this.sourceOffset + this.sourceLength); +// rootNodeToCompilationUnit(typeDeclaration.getAST(), compilationUnit, typeDeclaration, codeSnippetParsingUtil.recordedParsingInformation, null); + JavaScriptUnit compUnit=converter.convert(nodes, compilationUnit); + rootNodeToCompilationUnit(compUnit.getAST(), compilationUnit, compUnit, codeSnippetParsingUtil.recordedParsingInformation, null); + ast.setDefaultNodeFlag(0); + ast.setOriginalModificationCount(ast.modificationCount()); + return compilationUnit; + } else { + CategorizedProblem[] problems = recordedParsingInformation.problems; + if (problems != null) { + compilationUnit.setProblems(problems); + } + ast.setDefaultNodeFlag(0); + ast.setOriginalModificationCount(ast.modificationCount()); + return compilationUnit; + } + } + throw new IllegalStateException(); + } + + private void propagateErrors(ASTNode astNode, CategorizedProblem[] problems, RecoveryScannerData data) { + astNode.accept(new ASTSyntaxErrorPropagator(problems)); + if (data != null) { + astNode.accept(new ASTRecoveryPropagator(problems, data)); + } + } + + private void rootNodeToCompilationUnit(AST ast, JavaScriptUnit compilationUnit, ASTNode node, RecordedParsingInformation recordedParsingInformation, RecoveryScannerData data) { + final int problemsCount = recordedParsingInformation.problemsCount; + switch(node.getNodeType()) { + case ASTNode.BLOCK : + { + Block block = (Block) node; + if (problemsCount != 0) { + // propagate and record problems + final CategorizedProblem[] problems = recordedParsingInformation.problems; + propagateErrors(block, problems, data); + compilationUnit.setProblems(problems); + } + TypeDeclaration typeDeclaration = ast.newTypeDeclaration(); + Initializer initializer = ast.newInitializer(); + initializer.setBody(block); + typeDeclaration.bodyDeclarations().add(initializer); + compilationUnit.types().add(typeDeclaration); + } + break; + case ASTNode.JAVASCRIPT_UNIT : + { + JavaScriptUnit compUnit = (JavaScriptUnit) node; + if (problemsCount != 0) { + // propagate and record problems + final CategorizedProblem[] problems = recordedParsingInformation.problems; + for (int i = 0, max = compUnit.statements().size(); i < max; i++) { + propagateErrors((ASTNode) compUnit.statements().get(i), problems, data); + } + compilationUnit.setProblems(problems); + } + if (compilationUnit!=node) + for (int i = 0, max = compUnit.statements().size(); i < max; i++) + compilationUnit.statements().add(compUnit.statements().get(i)); + } + break; + case ASTNode.TYPE_DECLARATION : + { + TypeDeclaration typeDeclaration = (TypeDeclaration) node; + if (problemsCount != 0) { + // propagate and record problems + final CategorizedProblem[] problems = recordedParsingInformation.problems; + propagateErrors(typeDeclaration, problems, data); + compilationUnit.setProblems(problems); + } + compilationUnit.types().add(typeDeclaration); + } + break; + default : + if (node instanceof Expression) { + Expression expression = (Expression) node; + if (problemsCount != 0) { + // propagate and record problems + final CategorizedProblem[] problems = recordedParsingInformation.problems; + propagateErrors(expression, problems, data); + compilationUnit.setProblems(problems); + } + ExpressionStatement expressionStatement = ast.newExpressionStatement(expression); + Block block = ast.newBlock(); + block.statements().add(expressionStatement); + Initializer initializer = ast.newInitializer(); + initializer.setBody(block); + TypeDeclaration typeDeclaration = ast.newTypeDeclaration(); + typeDeclaration.bodyDeclarations().add(initializer); + compilationUnit.types().add(typeDeclaration); + } + } + } +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTRecoveryPropagator.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTRecoveryPropagator.java new file mode 100644 index 0000000..9853413 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTRecoveryPropagator.java @@ -0,0 +1,382 @@ +/******************************************************************************* + * Copyright (c) 2006, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.dom; + +import java.util.List; +import java.util.Vector; + +import org.eclipse.wst.jsdt.core.compiler.CategorizedProblem; +import org.eclipse.wst.jsdt.core.compiler.CharOperation; +import org.eclipse.wst.jsdt.core.compiler.IProblem; +import org.eclipse.wst.jsdt.internal.compiler.ast.UndefinedLiteral; +import org.eclipse.wst.jsdt.internal.compiler.parser.RecoveryScanner; +import org.eclipse.wst.jsdt.internal.compiler.parser.RecoveryScannerData; +import org.eclipse.wst.jsdt.internal.compiler.parser.TerminalTokens; +import org.eclipse.wst.jsdt.internal.compiler.util.HashtableOfObjectToIntArray; + +/** + * Internal AST visitor for propagating syntax errors. + */ +class ASTRecoveryPropagator extends DefaultASTVisitor { + private static final int NOTHING = -1; + HashtableOfObjectToIntArray endingTokens = new HashtableOfObjectToIntArray(); + { + this.endingTokens.put(AnonymousClassDeclaration.class, new int[]{TerminalTokens.TokenNameRBRACE}); + this.endingTokens.put(ArrayAccess.class, new int[]{TerminalTokens.TokenNameRBRACKET}); + this.endingTokens.put(ArrayCreation.class, new int[]{NOTHING, TerminalTokens.TokenNameRBRACKET}); + this.endingTokens.put(ArrayInitializer.class, new int[]{TerminalTokens.TokenNameRBRACKET}); + this.endingTokens.put(ArrayType.class, new int[]{TerminalTokens.TokenNameRBRACKET}); + this.endingTokens.put(Block.class, new int[]{TerminalTokens.TokenNameRBRACE}); + this.endingTokens.put(BooleanLiteral.class, new int[]{TerminalTokens.TokenNamefalse, TerminalTokens.TokenNametrue}); + this.endingTokens.put(BreakStatement.class, new int[]{TerminalTokens.TokenNameSEMICOLON}); + this.endingTokens.put(CharacterLiteral.class, new int[]{TerminalTokens.TokenNameCharacterLiteral}); + this.endingTokens.put(RegularExpressionLiteral.class, new int[]{TerminalTokens.TokenNameRegExLiteral}); + this.endingTokens.put(ClassInstanceCreation.class, new int[]{TerminalTokens.TokenNameRBRACE, TerminalTokens.TokenNameRPAREN}); + this.endingTokens.put(ConstructorInvocation.class, new int[]{TerminalTokens.TokenNameSEMICOLON}); + this.endingTokens.put(ContinueStatement.class, new int[]{TerminalTokens.TokenNameSEMICOLON}); + this.endingTokens.put(DoStatement.class, new int[]{TerminalTokens.TokenNameRPAREN}); + this.endingTokens.put(EmptyStatement.class, new int[]{TerminalTokens.TokenNameSEMICOLON}); + this.endingTokens.put(ExpressionStatement.class, new int[]{TerminalTokens.TokenNameSEMICOLON}); + this.endingTokens.put(FieldDeclaration.class, new int[]{TerminalTokens.TokenNameSEMICOLON}); + this.endingTokens.put(ImportDeclaration.class, new int[]{TerminalTokens.TokenNameSEMICOLON}); + this.endingTokens.put(Initializer.class, new int[]{TerminalTokens.TokenNameRBRACE}); + this.endingTokens.put(FunctionDeclaration.class, new int[]{NOTHING, TerminalTokens.TokenNameSEMICOLON}); + this.endingTokens.put(FunctionInvocation.class, new int[]{TerminalTokens.TokenNameRPAREN}); + this.endingTokens.put(NullLiteral.class, new int[]{TerminalTokens.TokenNamenull}); + this.endingTokens.put(UndefinedLiteral.class, new int[]{TerminalTokens.TokenNameundefined}); + this.endingTokens.put(NumberLiteral.class, new int[]{TerminalTokens.TokenNameIntegerLiteral, TerminalTokens.TokenNameLongLiteral, TerminalTokens.TokenNameFloatingPointLiteral, TerminalTokens.TokenNameDoubleLiteral}); + this.endingTokens.put(PackageDeclaration.class, new int[]{TerminalTokens.TokenNameSEMICOLON}); + this.endingTokens.put(ParenthesizedExpression.class, new int[]{TerminalTokens.TokenNameRPAREN}); + this.endingTokens.put(PostfixExpression.class, new int[]{TerminalTokens.TokenNamePLUS_PLUS, TerminalTokens.TokenNameMINUS_MINUS}); + this.endingTokens.put(PrimitiveType.class, new int[]{TerminalTokens.TokenNamebyte, TerminalTokens.TokenNameshort, TerminalTokens.TokenNamechar, TerminalTokens.TokenNameint, TerminalTokens.TokenNamelong, TerminalTokens.TokenNamefloat, TerminalTokens.TokenNameboolean, TerminalTokens.TokenNamedouble, TerminalTokens.TokenNamevoid}); + this.endingTokens.put(ReturnStatement.class, new int[]{TerminalTokens.TokenNameSEMICOLON}); + this.endingTokens.put(SimpleName.class, new int[]{TerminalTokens.TokenNameIdentifier}); + this.endingTokens.put(SingleVariableDeclaration.class, new int[]{TerminalTokens.TokenNameSEMICOLON}); + this.endingTokens.put(StringLiteral.class, new int[]{TerminalTokens.TokenNameStringLiteral}); + this.endingTokens.put(SuperConstructorInvocation.class, new int[]{TerminalTokens.TokenNameSEMICOLON}); + this.endingTokens.put(SuperMethodInvocation.class, new int[]{TerminalTokens.TokenNameRPAREN}); + this.endingTokens.put(SwitchCase.class, new int[]{TerminalTokens.TokenNameCOLON}); + this.endingTokens.put(SwitchStatement.class, new int[]{TerminalTokens.TokenNameRBRACE}); + this.endingTokens.put(ThisExpression.class, new int[]{TerminalTokens.TokenNamethis}); + this.endingTokens.put(ThrowStatement.class, new int[]{TerminalTokens.TokenNameSEMICOLON}); + this.endingTokens.put(TypeDeclaration.class, new int[]{TerminalTokens.TokenNameRBRACE}); + this.endingTokens.put(TypeLiteral.class, new int[]{TerminalTokens.TokenNameclass}); + this.endingTokens.put(VariableDeclarationStatement.class, new int[]{TerminalTokens.TokenNameSEMICOLON}); + } + + private CategorizedProblem[] problems; + private boolean[] usedOrIrrelevantProblems; + + private RecoveryScannerData data; + private int blockDepth = 0; + private int lastEnd; + + private int[] insertedTokensKind; + private int[] insertedTokensPosition; + private boolean[] insertedTokensFlagged; + + private boolean[] removedTokensFlagged; + private boolean[] replacedTokensFlagged; + + private Vector stack = new Vector(); + + ASTRecoveryPropagator(CategorizedProblem[] problems, RecoveryScannerData data) { + // visit Javadoc.tags() as well + this.problems = problems; + this.usedOrIrrelevantProblems = new boolean[problems.length]; + + this.data = data; + + if(this.data != null) { + + int length = 0; + for (int i = 0; i < data.insertedTokensPtr + 1; i++) { + length += data.insertedTokens[i].length; + } + this.insertedTokensKind = new int[length]; + this.insertedTokensPosition = new int[length]; + this.insertedTokensFlagged = new boolean[length]; + int tokenCount = 0; + for (int i = 0; i < data.insertedTokensPtr + 1; i++) { + for (int j = 0; j < data.insertedTokens[i].length; j++) { + this.insertedTokensKind[tokenCount] = data.insertedTokens[i][j]; + this.insertedTokensPosition[tokenCount] = data.insertedTokensPosition[i]; + tokenCount++; + } + } + + if(data.removedTokensPtr != -1) { + this.removedTokensFlagged = new boolean[data.removedTokensPtr + 1]; + } + if(data.replacedTokensPtr != -1) { + this.replacedTokensFlagged = new boolean[data.replacedTokensPtr + 1]; + } + } + } + + public void endVisit(Block node) { + this.blockDepth--; + if(this.blockDepth <= 0) { + flagNodeWithInsertedTokens(); + } + super.endVisit(node); + } + + + + public boolean visit(Block node) { + boolean visitChildren = super.visit(node); + this.blockDepth++; + return visitChildren; + } + + protected boolean visitNode(ASTNode node) { + if(this.blockDepth > 0) { + if (node instanceof InferredType) + return true; + int start = node.getStartPosition(); + int end = start + node.getLength() - 1; + + // continue to visit the node only if it contains tokens modifications + + if(this.insertedTokensFlagged != null) { + for (int i = 0; i < this.insertedTokensFlagged.length; i++) { + if(this.insertedTokensPosition[i] >= start && + this.insertedTokensPosition[i] <= end) { + return true; + } + } + } + + if(this.removedTokensFlagged != null) { + for (int i = 0; i <= this.data.removedTokensPtr; i++) { + if(this.data.removedTokensStart[i] >= start && + this.data.removedTokensEnd[i] <= end) { + return true; + } + } + } + + if(this.replacedTokensFlagged != null) { + for (int i = 0; i <= this.data.replacedTokensPtr; i++) { + if(this.data.replacedTokensStart[i] >= start && + this.data.replacedTokensEnd[i] <= end) { + return true; + } + } + } + + return false; + } + return true; + } + + protected void endVisitNode(ASTNode node) { + int start = node.getStartPosition(); + int end = start + node.getLength() - 1; + + // is inside diet part of the ast + if(this.blockDepth < 1) { + if(this.markIncludedProblems(start, end)) { + node.setFlags(node.getFlags() | ASTNode.RECOVERED); + } + } else { + this.markIncludedProblems(start, end); + + if(this.insertedTokensFlagged != null) { + if(this.lastEnd != end) { + flagNodeWithInsertedTokens(); + } + this.stack.add(node); + } + + if(this.removedTokensFlagged != null) { + for (int i = 0; i <= this.data.removedTokensPtr; i++) { + if(!this.removedTokensFlagged[i] && + this.data.removedTokensStart[i] >= start && + this.data.removedTokensEnd[i] <= end) { + node.setFlags(node.getFlags() | ASTNode.RECOVERED); + this.removedTokensFlagged[i] = true; + } + } + } + + if(this.replacedTokensFlagged != null) { + for (int i = 0; i <= this.data.replacedTokensPtr; i++) { + if(!this.replacedTokensFlagged[i] && + this.data.replacedTokensStart[i] >= start && + this.data.replacedTokensEnd[i] <= end) { + node.setFlags(node.getFlags() | ASTNode.RECOVERED); + this.replacedTokensFlagged[i] = true; + } + } + } + } + this.lastEnd = end; + } + + private void flagNodeWithInsertedTokens() { + if(this.insertedTokensKind != null && this.insertedTokensKind.length > 0) { + int s = this.stack.size(); + for (int i = s - 1; i > -1; i--) { + flagNodesWithInsertedTokensAtEnd((ASTNode)this.stack.get(i)); + } + for (int i = 0; i < s; i++) { + flagNodesWithInsertedTokensInside((ASTNode)this.stack.get(i)); + } + this.stack = new Vector(); + } + } + + private boolean flagNodesWithInsertedTokensAtEnd(ASTNode node) { + int[] expectedEndingToken = this.endingTokens.get(node.getClass()); + if (expectedEndingToken != null) { + int start = node.getStartPosition(); + int end = start + node.getLength() - 1; + + boolean flagParent = false; + done : for (int i = this.insertedTokensKind.length - 1; i > -1 ; i--) { + if(!this.insertedTokensFlagged[i] && + this.insertedTokensPosition[i] == end){ + this.insertedTokensFlagged[i] = true; + for (int j = 0; j < expectedEndingToken.length; j++) { + if(expectedEndingToken[j] == this.insertedTokensKind[i]) { + node.setFlags(node.getFlags() | ASTNode.RECOVERED); + break done; + } + } + flagParent = true; + } + } + + if(flagParent) { + ASTNode parent = node.getParent(); + while (parent != null) { + parent.setFlags(node.getFlags() | ASTNode.RECOVERED); + if((parent.getStartPosition() + parent.getLength() - 1) != end) { + parent = null; + } else { + parent = parent.getParent(); + } + } + } + } + return true; + } + + private boolean flagNodesWithInsertedTokensInside(ASTNode node) { + int start = node.getStartPosition(); + int end = start + node.getLength() - 1; + for (int i = 0; i < this.insertedTokensKind.length; i++) { + if(!this.insertedTokensFlagged[i] && + start <= this.insertedTokensPosition[i] && + this.insertedTokensPosition[i] < end){ + node.setFlags(node.getFlags() | ASTNode.RECOVERED); + this.insertedTokensFlagged[i] = true; + } + } + return true; + } + + private boolean markIncludedProblems(int start, int end) { + boolean foundProblems = false; + next: for (int i = 0, max = this.problems.length; i < max; i++) { + CategorizedProblem problem = this.problems[i]; + + if(this.usedOrIrrelevantProblems[i]) continue next; + + switch(problem.getID()) { + case IProblem.ParsingErrorOnKeywordNoSuggestion : + case IProblem.ParsingErrorOnKeyword : + case IProblem.ParsingError : + case IProblem.ParsingErrorNoSuggestion : + case IProblem.ParsingErrorInsertTokenBefore : + case IProblem.ParsingErrorInsertTokenAfter : + case IProblem.ParsingErrorDeleteToken : + case IProblem.ParsingErrorDeleteTokens : + case IProblem.ParsingErrorMergeTokens : + case IProblem.ParsingErrorInvalidToken : + case IProblem.ParsingErrorMisplacedConstruct : + case IProblem.ParsingErrorReplaceTokens : + case IProblem.ParsingErrorNoSuggestionForTokens : + case IProblem.ParsingErrorUnexpectedEOF : + case IProblem.ParsingErrorInsertToComplete : + case IProblem.ParsingErrorInsertToCompleteScope : + case IProblem.ParsingErrorInsertToCompletePhrase : + case IProblem.EndOfSource : + case IProblem.InvalidHexa : + case IProblem.InvalidOctal : + case IProblem.InvalidCharacterConstant : + case IProblem.InvalidEscape : + case IProblem.InvalidInput : + case IProblem.InvalidUnicodeEscape : + case IProblem.InvalidFloat : + case IProblem.NullSourceString : + case IProblem.UnterminatedString : + case IProblem.UnterminatedComment : + case IProblem.InvalidDigit : + break; + default: + this.usedOrIrrelevantProblems[i] = true; + continue next; + + } + + int problemStart = problem.getSourceStart(); + int problemEnd = problem.getSourceEnd(); + if ((start <= problemStart) && (problemStart <= end) || + (start <= problemEnd) && (problemEnd <= end)) { + this.usedOrIrrelevantProblems[i] = true; + foundProblems = true; + } + } + return foundProblems; + } + + public void endVisit(ExpressionStatement node) { + endVisitNode(node); + if ((node.getFlags() & ASTNode.RECOVERED) == 0) return; + Expression expression = node.getExpression(); + if (expression.getNodeType() == ASTNode.ASSIGNMENT) { + Assignment assignment = (Assignment) expression; + Expression rightHandSide = assignment.getRightHandSide(); + if (rightHandSide.getNodeType() == ASTNode.SIMPLE_NAME) { + SimpleName simpleName = (SimpleName) rightHandSide; + if (CharOperation.equals(RecoveryScanner.FAKE_IDENTIFIER, simpleName.getIdentifier().toCharArray())) { + Expression expression2 = assignment.getLeftHandSide(); + // unparent the expression to add it in the expression stateemnt + expression2.setParent(null, null); + expression2.setFlags(expression2.getFlags() | ASTNode.RECOVERED); + node.setExpression(expression2); + } + } + } + } + + public void endVisit(VariableDeclarationStatement node) { + endVisitNode(node); + List fragments = node.fragments(); + for (int i = 0, max = fragments.size(); i ASTParser.createASTs
. + *

+ * ASTRequestor.acceptAST is called for each of the + * javaScript units passed to ASTParser.createASTs. + * After all the javaScript units have been processed, + * ASTRequestor.acceptBindings is called for each + * of the binding keys passed to ASTParser.createASTs. + *

+ *

+ * This class is intended to be subclassed by clients. + * AST requestors are serially reusable, but neither reentrant nor + * thread-safe. + *

+ * + * @see ASTParser#createASTs(IJavaScriptUnit[], String[], ASTRequestor, org.eclipse.core.runtime.IProgressMonitor) + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public abstract class ASTRequestor { + + /** + * The javaScript unit resolver used to resolve bindings, or + * null if none. Note that this field is non-null + * only within the dynamic scope of a call to + * ASTParser.createASTs. + */ + JavaScriptUnitResolver compilationUnitResolver = null; + + /** + * Creates a new instance. + */ + protected ASTRequestor() { + // do nothing + } + + /** + * Accepts an AST corresponding to the javaScript unit. + * That is, ast is an AST for source. + *

+ * The default implementation of this method does nothing. + * Clients should override to process the resulting AST. + *

+ * + * @param source the javaScript unit the ast is coming from + * @param ast the requested abtract syntax tree + */ + public void acceptAST(IJavaScriptUnit source, JavaScriptUnit ast) { + // do nothing + } + + /** + * Accepts a binding corresponding to the binding key. + * That is, binding is the binding for + * bindingKey; binding is null + * if the key cannot be resolved. + *

+ * The default implementation of this method does nothing. + * Clients should override to process the resulting binding. + *

+ * + * @param bindingKey the key of the requested binding + * @param binding the requested binding, or null if none + */ + public void acceptBinding(String bindingKey, IBinding binding) { + // do nothing + } + + /** + * Resolves bindings for the given binding keys. + * The given binding keys must have been obtained earlier + * using {@link IBinding#getKey()}. + *

+ * If a binding key cannot be resolved, null is put in the resulting array. + * Bindings can only be resolved in the dynamic scope of a ASTParser.createASTs, + * and only if ASTParser.resolveBindings(true) was specified. + *

+ *

+ * Caveat: During an acceptAST callback, there are implementation + * limitations concerning the look up of binding keys representing local elements. + * In some cases, the binding is unavailable, and null will be returned. + * This is only an issue during an acceptAST callback, and only + * when the binding key represents a local element (e.g., local variable, + * local class, method declared in anonymous class). There is no such limitation + * outside of acceptAST callbacks, or for top-level types and their + * members even within acceptAST callbacks. + *

+ * + * @param bindingKeys the binding keys to look up + * @return a list of bindings paralleling the bindingKeys parameter, + * with null entries for keys that could not be resolved + */ + public final IBinding[] createBindings(String[] bindingKeys) { + int length = bindingKeys.length; + IBinding[] result = new IBinding[length]; + for (int i = 0; i < length; i++) { + result[i] = null; + if (this.compilationUnitResolver != null) { + result[i] = this.compilationUnitResolver.createBinding(bindingKeys[i]); + } + } + return result; + } +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTSyntaxErrorPropagator.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTSyntaxErrorPropagator.java new file mode 100644 index 0000000..9ed9163 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTSyntaxErrorPropagator.java @@ -0,0 +1,134 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.dom; + +import org.eclipse.wst.jsdt.core.compiler.CategorizedProblem; +import org.eclipse.wst.jsdt.core.compiler.IProblem; + +/** + * Internal AST visitor for propagating syntax errors. + */ +class ASTSyntaxErrorPropagator extends ASTVisitor { + + private CategorizedProblem[] problems; + + ASTSyntaxErrorPropagator(CategorizedProblem[] problems) { + // visit Javadoc.tags() as well + super(true); + this.problems = problems; + } + + private boolean checkAndTagAsMalformed(ASTNode node) { + boolean tagWithErrors = false; + search: for (int i = 0, max = this.problems.length; i < max; i++) { + CategorizedProblem problem = this.problems[i]; + switch(problem.getID()) { + case IProblem.ParsingErrorOnKeywordNoSuggestion : + case IProblem.ParsingErrorOnKeyword : + case IProblem.ParsingError : + case IProblem.ParsingErrorNoSuggestion : + case IProblem.ParsingErrorInsertTokenBefore : + case IProblem.ParsingErrorInsertTokenAfter : + case IProblem.ParsingErrorDeleteToken : + case IProblem.ParsingErrorDeleteTokens : + case IProblem.ParsingErrorMergeTokens : + case IProblem.ParsingErrorInvalidToken : + case IProblem.ParsingErrorMisplacedConstruct : + case IProblem.ParsingErrorReplaceTokens : + case IProblem.ParsingErrorNoSuggestionForTokens : + case IProblem.ParsingErrorUnexpectedEOF : + case IProblem.ParsingErrorInsertToComplete : + case IProblem.ParsingErrorInsertToCompleteScope : + case IProblem.ParsingErrorInsertToCompletePhrase : + case IProblem.EndOfSource : + case IProblem.InvalidHexa : + case IProblem.InvalidOctal : + case IProblem.InvalidCharacterConstant : + case IProblem.InvalidEscape : + case IProblem.InvalidInput : + case IProblem.InvalidUnicodeEscape : + case IProblem.InvalidFloat : + case IProblem.NullSourceString : + case IProblem.UnterminatedString : + case IProblem.UnterminatedComment : + case IProblem.InvalidDigit : + break; + default: + continue search; + } + int position = problem.getSourceStart(); + int start = node.getStartPosition(); + int end = start + node.getLength(); + if ((start <= position) && (position <= end)) { + node.setFlags(node.getFlags() | ASTNode.MALFORMED); + // clear the bits on parent + ASTNode currentNode = node.getParent(); + while (currentNode != null) { + currentNode.setFlags(currentNode.getFlags() & ~ASTNode.MALFORMED); + currentNode = currentNode.getParent(); + } + tagWithErrors = true; + } + } + return tagWithErrors; + } + + /* + * Method declared on ASTVisitor. + */ + public boolean visit(FieldDeclaration node) { + return checkAndTagAsMalformed(node); + } + + /* + * Method declared on ASTVisitor. + */ + public boolean visit(FunctionDeclaration node) { + return checkAndTagAsMalformed(node); + } + + /* + * Method declared on ASTVisitor. + */ + public boolean visit(PackageDeclaration node) { + return checkAndTagAsMalformed(node); + } + + /* + * Method declared on ASTVisitor. + */ + public boolean visit(ImportDeclaration node) { + return checkAndTagAsMalformed(node); + } + + /* + * Method declared on ASTVisitor. + */ + public boolean visit(JavaScriptUnit node) { + return checkAndTagAsMalformed(node); + } + + /* + * Method declared on ASTVisitor. + */ + public boolean visit(TypeDeclaration node) { + return checkAndTagAsMalformed(node); + } + + /* + * Method declared on ASTVisitor. + */ + public boolean visit(Initializer node) { + return checkAndTagAsMalformed(node); + } + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTVisitor.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTVisitor.java new file mode 100644 index 0000000..6ee1df0 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTVisitor.java @@ -0,0 +1,2212 @@ +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.dom; + +/** + * A visitor for abstract syntax trees. + *

+ * For each different concrete AST node type T there are + * a pair of methods: + *

    + *
  • public boolean visit(T node) - Visits + * the given node to perform some arbitrary operation. If true + * is returned, the given node's child nodes will be visited next; however, + * if false is returned, the given node's child nodes will + * not be visited. The default implementation provided by this class does + * nothing and returns true (with the exception of + * {@link #visit(JSdoc) ASTVisitor.visit(Javadoc)}). + * Subclasses may reimplement this method as needed.
  • + *
  • public void endVisit(T node) - Visits + * the given node to perform some arbitrary operation. When used in the + * conventional way, this method is called after all of the given node's + * children have been visited (or immediately, if visit returned + * false). The default implementation provided by this class does + * nothing. Subclasses may reimplement this method as needed.
  • + *
+ *

+ * In addition, there are a pair of methods for visiting AST nodes in the + * abstract, regardless of node type: + *
    + *
  • public void preVisit(ASTNode node) - Visits + * the given node to perform some arbitrary operation. + * This method is invoked prior to the appropriate type-specific + * visit method. + * The default implementation of this method does nothing. + * Subclasses may reimplement this method as needed.
  • + *
  • public void postVisit(ASTNode node) - Visits + * the given node to perform some arbitrary operation. + * This method is invoked after the appropriate type-specific + * endVisit method. + * The default implementation of this method does nothing. + * Subclasses may reimplement this method as needed.
  • + *
+ *

+ * For nodes with list-valued properties, the child nodes within the list + * are visited in order. For nodes with multiple properties, the child nodes + * are visited in the order that most closely corresponds to the lexical + * reading order of the source program. For instance, for a type declaration + * node, the child ordering is: name, superclass, superinterfaces, and + * body declarations. + *

+ *

+ * While it is possible to modify the tree in the visitor, care is required to + * ensure that the consequences are as expected and desirable. + * During the course of an ordinary visit starting at a given node, every node + * in the subtree is visited exactly twice, first with visit and + * then with endVisit. During a traversal of a stationary tree, + * each node is either behind (after endVisit), ahead (before + * visit), or in progress (between visit and + * the matching endVisit). Changes to the "behind" region of the + * tree are of no consequence to the visit in progress. Changes to the "ahead" + * region will be taken in stride. Changes to the "in progress" portion are + * the more interesting cases. With a node, the various properties are arranged + * in a linear list, with a cursor that separates the properties that have + * been visited from the ones that are still to be visited (the cursor + * is between the elements, rather than on an element). The cursor moves from + * the head to the tail of this list, advancing to the next position just + * before visit if called for that child. After the child + * subtree has been completely visited, the visit moves on the child + * immediately after the cursor. Removing a child while it is being visited + * does not alter the course of the visit. But any children added at positions + * after the cursor are considered in the "ahead" portion and will be visited. + *

+ *

+ * Cases to watch out for: + *

    + *
  • Moving a child node further down the list. This could result in the + * child subtree being visited multiple times; these visits are sequential.
  • + *
  • Moving a child node up into an ancestor. If the new home for + * the node is in the "ahead" portion, the subtree will be visited + * a second time; again, these visits are sequential.
  • + *
  • Moving a node down into a child. If the new home for + * the node is in the "ahead" portion, the subtree will be visited + * a second time; in this case, the visits will be nested. In some cases, + * this can lead to a stack overflow or out of memory condition.
  • + *
+ *

Note that {@link LineComment} and {@link BlockComment} nodes are + * not normally visited in an AST because they are not considered + * part of main structure of the AST. Use + * {@link JavaScriptUnit#getCommentList()} to find these additional + * comments nodes. + *

+ * + * @see org.eclipse.wst.jsdt.core.dom.ASTNode#accept(ASTVisitor) + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public abstract class ASTVisitor { + + /** + * Indicates whether doc tags should be visited by default. + */ + private boolean visitDocTags; + + /** + * Creates a new AST visitor instance. + *

+ * For backwards compatibility, the visitor does not visit tag + * elements below doc comments by default. Use + * {@link #ASTVisitor(boolean) ASTVisitor(true)} + * for an visitor that includes doc comments by default. + *

+ */ + public ASTVisitor() { + this(false); + } + + /** + * Creates a new AST visitor instance. + * + * @param visitDocTags true if doc comment tags are + * to be visited by default, and false otherwise + * @see JSdoc#tags() + * @see #visit(JSdoc) + */ + public ASTVisitor(boolean visitDocTags) { + this.visitDocTags = visitDocTags; + } + + /** + * Visits the given AST node prior to the type-specific visit. + * (before visit). + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void preVisit(ASTNode node) { + // default implementation: do nothing + } + + /** + * Visits the given AST node following the type-specific visit + * (after endVisit). + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void postVisit(ASTNode node) { + // default implementation: do nothing + } + + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(AnonymousClassDeclaration node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(ArrayAccess node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(ArrayCreation node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(ArrayInitializer node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(ArrayType node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(Assignment node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(Block node) { + return true; + } + + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ *

Note: {@link LineComment} and {@link BlockComment} nodes are + * not considered part of main structure of the AST. This method will + * only be called if a client goes out of their way to visit this + * kind of node explicitly. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(BlockComment node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(BooleanLiteral node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(BreakStatement node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(CatchClause node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(CharacterLiteral node) { + return true; + } + + public boolean visit(RegularExpressionLiteral node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(ClassInstanceCreation node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(JavaScriptUnit node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(ConditionalExpression node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(ConstructorInvocation node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(ContinueStatement node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(DoStatement node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(EmptyStatement node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(EnhancedForStatement node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(ExpressionStatement node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(FieldAccess node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(FieldDeclaration node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(ForStatement node) { + return true; + } + + public boolean visit(ForInStatement node) { + return true; + } + + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(IfStatement node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(ImportDeclaration node) { + return true; + } + + + public boolean visit(InferredType node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(InfixExpression node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(InstanceofExpression node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(Initializer node) { + return true; + } + + /** + * Visits the given AST node. + *

+ * Unlike other node types, the boolean returned by the default + * implementation is controlled by a constructor-supplied + * parameter {@link #ASTVisitor(boolean) ASTVisitor(boolean)} + * which is false by default. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + * @see #ASTVisitor() + * @see #ASTVisitor(boolean) + */ + public boolean visit(JSdoc node) { + // visit tag elements inside doc comments only if requested + return this.visitDocTags; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(LabeledStatement node) { + return true; + } + + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ *

Note: {@link LineComment} and {@link BlockComment} nodes are + * not considered part of main structure of the AST. This method will + * only be called if a client goes out of their way to visit this + * kind of node explicitly. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(LineComment node) { + return true; + } + + + public boolean visit(ListExpression node) { + return true; + } + + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(MemberRef node) { + return true; + } + + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(FunctionRef node) { + return true; + } + + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(FunctionRefParameter node) { + return true; + } + + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(FunctionDeclaration node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(FunctionInvocation node) { + return true; + } + + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(Modifier node) { + return true; + } + + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(NullLiteral node) { + return true; + } + + public boolean visit(UndefinedLiteral node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(NumberLiteral node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(PackageDeclaration node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(ParenthesizedExpression node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(PostfixExpression node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(PrefixExpression node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(PrimitiveType node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(QualifiedName node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(QualifiedType node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(ReturnStatement node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(SimpleName node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(SimpleType node) { + return true; + } + + + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(SingleVariableDeclaration node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(StringLiteral node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(SuperConstructorInvocation node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(SuperFieldAccess node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(SuperMethodInvocation node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(SwitchCase node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(SwitchStatement node) { + return true; + } + + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(TagElement node) { + return true; + } + + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(TextElement node) { + return true; + } + + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(ThisExpression node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(ThrowStatement node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(TryStatement node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(TypeDeclaration node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(TypeDeclarationStatement node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(TypeLiteral node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(VariableDeclarationExpression node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(VariableDeclarationStatement node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(VariableDeclarationFragment node) { + return true; + } + + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and return true. + * Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + */ + public boolean visit(WhileStatement node) { + return true; + } + + public boolean visit(WithStatement node) { + return true; + } + + public boolean visit(ObjectLiteral node) { + return true; + } + public boolean visit(ObjectLiteralField node) { + return true; + } + public boolean visit(FunctionExpression node) { + return true; + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(AnonymousClassDeclaration node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(ArrayAccess node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(ArrayCreation node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(ArrayInitializer node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(ArrayType node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(Assignment node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(Block node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ *

Note: {@link LineComment} and {@link BlockComment} nodes are + * not considered part of main structure of the AST. This method will + * only be called if a client goes out of their way to visit this + * kind of node explicitly. + *

+ * + * @param node the node to visit + */ + public void endVisit(BlockComment node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(BooleanLiteral node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(BreakStatement node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(CatchClause node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(CharacterLiteral node) { + // default implementation: do nothing + } + public void endVisit(RegularExpressionLiteral node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(ClassInstanceCreation node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(JavaScriptUnit node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(ConditionalExpression node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(ConstructorInvocation node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(ContinueStatement node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(DoStatement node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(EmptyStatement node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(EnhancedForStatement node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(ExpressionStatement node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(FieldAccess node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(FieldDeclaration node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(ForStatement node) { + // default implementation: do nothing + } + + public void endVisit(ForInStatement node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(IfStatement node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(ImportDeclaration node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(InfixExpression node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(InstanceofExpression node) { + // default implementation: do nothing + } + + public void endVisit(InferredType node) { + // default implementation: do nothing + } + + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(Initializer node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(JSdoc node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(LabeledStatement node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ *

Note: {@link LineComment} and {@link BlockComment} nodes are + * not considered part of main structure of the AST. This method will + * only be called if a client goes out of their way to visit this + * kind of node explicitly. + *

+ * + * @param node the node to visit + */ + public void endVisit(LineComment node) { + // default implementation: do nothing + } + + + public void endVisit(ListExpression node) { + // default implementation: do nothing + } + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(MemberRef node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(FunctionRef node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(FunctionRefParameter node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(FunctionDeclaration node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(FunctionInvocation node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(Modifier node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(NullLiteral node) { + // default implementation: do nothing + } + + public void endVisit(UndefinedLiteral node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(NumberLiteral node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(PackageDeclaration node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(ParenthesizedExpression node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(PostfixExpression node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(PrefixExpression node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(PrimitiveType node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(QualifiedName node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(QualifiedType node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(ReturnStatement node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(SimpleName node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(SimpleType node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(SingleVariableDeclaration node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(StringLiteral node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(SuperConstructorInvocation node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(SuperFieldAccess node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(SuperMethodInvocation node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(SwitchCase node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(SwitchStatement node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(TagElement node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(TextElement node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(ThisExpression node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(ThrowStatement node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(TryStatement node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(TypeDeclaration node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(TypeDeclarationStatement node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(TypeLiteral node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(VariableDeclarationExpression node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(VariableDeclarationStatement node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(VariableDeclarationFragment node) { + // default implementation: do nothing + } + + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + */ + public void endVisit(WhileStatement node) { + // default implementation: do nothing + } + + public void endVisit(WithStatement node) { + // default implementation: do nothing + } + + public void endVisit(ObjectLiteral node) { + // default implementation: do nothing + } + + public void endVisit(ObjectLiteralField node) { + // default implementation: do nothing + } + + public void endVisit(FunctionExpression node) { + // default implementation: do nothing + } + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AbstractTypeDeclaration.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AbstractTypeDeclaration.java new file mode 100644 index 0000000..9fe8daa --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AbstractTypeDeclaration.java @@ -0,0 +1,242 @@ +/******************************************************************************* + * Copyright (c) 2004, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core.dom; + +import java.util.List; + +/** + * Abstract subclass for type declaration AST node types. + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public abstract class AbstractTypeDeclaration extends BodyDeclaration { + + + /** + * The type name; lazily initialized; defaults to a unspecified, + * legal JavaScript class identifier. + */ + SimpleName typeName = null; + + /** + * The body declarations (element type: BodyDeclaration). + * Defaults to an empty list. + */ + ASTNode.NodeList bodyDeclarations; + + /** + * Returns structural property descriptor for the "bodyDeclarations" property + * of this node. + * + * @return the property descriptor + */ + abstract ChildListPropertyDescriptor internalBodyDeclarationsProperty(); + + /** + * Returns structural property descriptor for the "bodyDeclarations" property + * of this node. + * + * @return the property descriptor + */ + public final ChildListPropertyDescriptor getBodyDeclarationsProperty() { + return internalBodyDeclarationsProperty(); + } + + /** + * Returns structural property descriptor for the "name" property + * of this node. + * + * @return the property descriptor + */ + abstract ChildPropertyDescriptor internalNameProperty(); + + /** + * Returns structural property descriptor for the "name" property + * of this node. + * + * @return the property descriptor + */ + public final ChildPropertyDescriptor getNameProperty() { + return internalNameProperty(); + } + + /** + * Creates and returns a structural property descriptor for the + * "bodyDeclaration" property declared on the given concrete node type. + * + * @return the property descriptor + */ + static final ChildListPropertyDescriptor internalBodyDeclarationPropertyFactory(Class nodeClass) { + return new ChildListPropertyDescriptor(nodeClass, "bodyDeclarations", BodyDeclaration.class, CYCLE_RISK); //$NON-NLS-1$ + } + + /** + * Creates and returns a structural property descriptor for the + * "name" property declared on the given concrete node type. + * + * @return the property descriptor + */ + static final ChildPropertyDescriptor internalNamePropertyFactory(Class nodeClass) { + return new ChildPropertyDescriptor(nodeClass, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ + } + + /** + * Creates a new AST node for an abstract type declaration owned by the given + * AST. + *

+ * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare + * additional subclasses. + *

+ * + * @param ast the AST that is to own this node + */ + AbstractTypeDeclaration(AST ast) { + super(ast); + this.bodyDeclarations = new ASTNode.NodeList(internalBodyDeclarationsProperty()); + } + + /** + * Returns the name of the type declared in this type declaration. + * + * @return the type name node + */ + public SimpleName getName() { + if (this.typeName == null) { + // lazy init must be thread-safe for readers + synchronized (this) { + if (this.typeName == null) { + preLazyInit(); + this.typeName = new SimpleName(this.ast); + postLazyInit(this.typeName, internalNameProperty()); + } + } + } + return this.typeName; + } + + /** + * Sets the name of the type declared in this type declaration to the + * given name. + * + * @param typeName the new type name + * @exception IllegalArgumentException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
+ */ + public void setName(SimpleName typeName) { + if (typeName == null) { + throw new IllegalArgumentException(); + } + ChildPropertyDescriptor p = internalNameProperty(); + ASTNode oldChild = this.typeName; + preReplaceChild(oldChild, typeName, p); + this.typeName = typeName; + postReplaceChild(oldChild, typeName, p); + } + + /** + * Returns the live ordered list of body declarations of this type + * declaration. + * + * @return the live list of body declarations + * (element type: BodyDeclaration) + */ + public List bodyDeclarations() { + return this.bodyDeclarations; + } + + /** + * Returns whether this type declaration is a package member (that is, + * a top-level type). + *

+ * Note that this is a convenience method that simply checks whether + * this node's parent is a javaScript unit node. + *

+ * + * @return true if this type declaration is a child of + * a javaScript unit node, and false otherwise + */ + public boolean isPackageMemberTypeDeclaration() { + ASTNode parent = getParent(); + return (parent instanceof JavaScriptUnit); + } + + /** + * Returns whether this type declaration is a type member. + *

+ * Note that this is a convenience method that simply checks whether + * this node's parent is a type declaration node or an anonymous + * class declaration. + *

+ * + * @return true if this type declaration is a child of + * a type declaration node or an anonymous class declaration node, + * and false otherwise + */ + public boolean isMemberTypeDeclaration() { + ASTNode parent = getParent(); + return (parent instanceof AbstractTypeDeclaration) + || (parent instanceof AnonymousClassDeclaration); + } + + /** + * Returns whether this type declaration is a local type. + *

+ * Note that this is a convenience method that simply checks whether + * this node's parent is a type declaration statement node. + *

+ * + * @return true if this type declaration is a child of + * a type declaration statement node, and false otherwise + */ + public boolean isLocalTypeDeclaration() { + ASTNode parent = getParent(); + return (parent instanceof TypeDeclarationStatement); + } + + /** + * Resolves and returns the binding for the type declared in this type + * declaration. + *

+ * Note that bindings are generally unavailable unless requested when the + * AST is being built. + *

+ * + * @return the binding, or null if the binding cannot be + * resolved + */ + public final ITypeBinding resolveBinding() { + return internalResolveBinding(); + } + + /** + * Resolves and returns the binding for the type declared in this type + * declaration. This method must be implemented by subclasses. + * + * @return the binding, or null if the binding cannot be + * resolved + */ + abstract ITypeBinding internalResolveBinding(); + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + int memSize() { + return super.memSize() + 2 * 4; + } + +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AnonymousClassDeclaration.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AnonymousClassDeclaration.java new file mode 100644 index 0000000..06dcd07 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AnonymousClassDeclaration.java @@ -0,0 +1,191 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core.dom; + +import java.util.ArrayList; +import java.util.List; + +/** + * Anonymous class declaration AST node type. For JLS2, this type of node appears + * only as a child on a class instance creation expression. + * For JLS3, this type of node appears may also appear as the child of + * an enum constant declaration. + * + *
+ * AnonymousClassDeclaration:
+ *        { ClassBodyDeclaration }
+ * 
+ * + * @see ClassInstanceCreation + * @see EnumConstantDeclaration + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public class AnonymousClassDeclaration extends ASTNode { + + /** + * The "bodyDeclarations" structural property of this node type. + */ + public static final ChildListPropertyDescriptor BODY_DECLARATIONS_PROPERTY = + new ChildListPropertyDescriptor(AnonymousClassDeclaration.class, "bodyDeclarations", BodyDeclaration.class, CYCLE_RISK); //$NON-NLS-1$ + + /** + * A list of property descriptors (element type: + * {@link StructuralPropertyDescriptor}), + * or null if uninitialized. + */ + private static final List PROPERTY_DESCRIPTORS; + + static { + List properyList = new ArrayList(2); + createPropertyList(AnonymousClassDeclaration.class, properyList); + addProperty(BODY_DECLARATIONS_PROPERTY, properyList); + PROPERTY_DESCRIPTORS = reapPropertyList(properyList); + } + + /** + * Returns a list of structural property descriptors for this node type. + * Clients must not modify the result. + * + * @param apiLevel the API level; one of the + * AST.JLS* constants + + * @return a list of property descriptors (element type: + * {@link StructuralPropertyDescriptor}) + */ + public static List propertyDescriptors(int apiLevel) { + return PROPERTY_DESCRIPTORS; + } + + /** + * The body declarations (element type: BodyDeclaration). + * Defaults to none. + */ + private ASTNode.NodeList bodyDeclarations = + new ASTNode.NodeList(BODY_DECLARATIONS_PROPERTY); + + /** + * Creates a new AST node for an anonymous class declaration owned + * by the given AST. By default, the list of body declarations is empty. + *

+ * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare + * additional subclasses. + *

+ * + * @param ast the AST that is to own this node + */ + AnonymousClassDeclaration(AST ast) { + super(ast); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final List internalStructuralPropertiesForType(int apiLevel) { + return propertyDescriptors(apiLevel); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final List internalGetChildListProperty(ChildListPropertyDescriptor property) { + if (property == BODY_DECLARATIONS_PROPERTY) { + return bodyDeclarations(); + } + // allow default implementation to flag the error + return super.internalGetChildListProperty(property); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final int getNodeType0() { + return ANONYMOUS_CLASS_DECLARATION; + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + ASTNode clone0(AST target) { + AnonymousClassDeclaration result = new AnonymousClassDeclaration(target); + result.setSourceRange(this.getStartPosition(), this.getLength()); + result.bodyDeclarations().addAll( + ASTNode.copySubtrees(target, bodyDeclarations())); + return result; + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final boolean subtreeMatch0(ASTMatcher matcher, Object other) { + // dispatch to correct overloaded match method + return matcher.match(this, other); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + void accept0(ASTVisitor visitor) { + boolean visitChildren = visitor.visit(this); + if (visitChildren) { + // visit children in normal left to right reading order + acceptChildren(visitor, bodyDeclarations); + } + visitor.endVisit(this); + } + + /** + * Returns the live ordered list of body declarations of this + * anonymous class declaration. + * + * @return the live list of body declarations + * (element type: BodyDeclaration) + */ + public List bodyDeclarations() { + return this.bodyDeclarations; + } + + /** + * Resolves and returns the binding for the anonymous class declared in + * this declaration. + *

+ * Note that bindings are generally unavailable unless requested when the + * AST is being built. + *

+ * + * @return the binding, or null if the binding cannot be + * resolved + */ + public ITypeBinding resolveBinding() { + return this.ast.getBindingResolver().resolveType(this); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + int memSize() { + // treat Code as free + return BASE_NODE_SIZE + 4; + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + int treeSize() { + return + memSize() + + this.bodyDeclarations.listSize(); + } +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ArrayAccess.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ArrayAccess.java new file mode 100644 index 0000000..e231a28 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ArrayAccess.java @@ -0,0 +1,270 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.dom; + +import java.util.ArrayList; +import java.util.List; + +/** + * Array access expression AST node type. + * + *
+ * ArrayAccess:
+ *    Expression [ Expression ]
+ * 
+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public class ArrayAccess extends Expression { + + /** + * The "array" structural property of this node type. + */ + public static final ChildPropertyDescriptor ARRAY_PROPERTY = + new ChildPropertyDescriptor(ArrayAccess.class, "array", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ + + /** + * The "index" structural property of this node type. + */ + public static final ChildPropertyDescriptor INDEX_PROPERTY = + new ChildPropertyDescriptor(ArrayAccess.class, "index", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ + + /** + * A list of property descriptors (element type: + * {@link StructuralPropertyDescriptor}), + * or null if uninitialized. + */ + private static final List PROPERTY_DESCRIPTORS; + + static { + List properyList = new ArrayList(3); + createPropertyList(ArrayAccess.class, properyList); + addProperty(ARRAY_PROPERTY, properyList); + addProperty(INDEX_PROPERTY, properyList); + PROPERTY_DESCRIPTORS = reapPropertyList(properyList); + } + + /** + * Returns a list of structural property descriptors for this node type. + * Clients must not modify the result. + * + * @param apiLevel the API level; one of the + * AST.JLS* constants + + * @return a list of property descriptors (element type: + * {@link StructuralPropertyDescriptor}) + */ + public static List propertyDescriptors(int apiLevel) { + return PROPERTY_DESCRIPTORS; + } + + /** + * The array expression; lazily initialized; defaults to an unspecified, + * but legal, expression. + */ + private Expression arrayExpression = null; + + /** + * The index expression; lazily initialized; defaults to an unspecified, + * but legal, expression. + */ + private Expression indexExpression = null; + + /** + * Creates a new unparented array access expression node owned by the given + * AST. By default, the array and index expresssions are unspecified, + * but legal. + *

+ * N.B. This constructor is package-private. + *

+ * + * @param ast the AST that is to own this node + */ + ArrayAccess(AST ast) { + super(ast); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final List internalStructuralPropertiesForType(int apiLevel) { + return propertyDescriptors(apiLevel); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { + if (property == ARRAY_PROPERTY) { + if (get) { + return getArray(); + } else { + setArray((Expression) child); + return null; + } + } + if (property == INDEX_PROPERTY) { + if (get) { + return getIndex(); + } else { + setIndex((Expression) child); + return null; + } + } + // allow default implementation to flag the error + return super.internalGetSetChildProperty(property, get, child); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final int getNodeType0() { + return ARRAY_ACCESS; + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + ASTNode clone0(AST target) { + ArrayAccess result = new ArrayAccess(target); + result.setSourceRange(this.getStartPosition(), this.getLength()); + result.setArray((Expression) getArray().clone(target)); + result.setIndex((Expression) getIndex().clone(target)); + return result; + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final boolean subtreeMatch0(ASTMatcher matcher, Object other) { + // dispatch to correct overloaded match method + return matcher.match(this, other); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + void accept0(ASTVisitor visitor) { + boolean visitChildren = visitor.visit(this); + if (visitChildren) { + // visit children in normal left to right reading order + acceptChild(visitor, getArray()); + acceptChild(visitor, getIndex()); + } + visitor.endVisit(this); + } + + /** + * Returns the array expression of this array access expression. + * + * @return the array expression node + */ + public Expression getArray() { + if (this.arrayExpression == null) { + // lazy init must be thread-safe for readers + synchronized (this) { + if (this.arrayExpression == null) { + preLazyInit(); + this.arrayExpression = new SimpleName(this.ast); + postLazyInit(this.arrayExpression, ARRAY_PROPERTY); + } + } + } + return this.arrayExpression; + } + + /** + * Sets the array expression of this array access expression. + * + * @param expression the array expression node + * @exception IllegalArgumentException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
  • a cycle in would be created
  • + *
+ */ + public void setArray(Expression expression) { + if (expression == null) { + throw new IllegalArgumentException(); + } + // an ArrayAccess may occur inside an Expression + // must check cycles + ASTNode oldChild = this.arrayExpression; + preReplaceChild(oldChild, expression, ARRAY_PROPERTY); + this.arrayExpression = expression; + postReplaceChild(oldChild, expression, ARRAY_PROPERTY); + } + + /** + * Returns the index expression of this array access expression. + * + * @return the index expression node + */ + public Expression getIndex() { + if (this.indexExpression == null) { + // lazy init must be thread-safe for readers + synchronized (this) { + if (this.indexExpression == null) { + preLazyInit(); + this.indexExpression = new SimpleName(this.ast); + postLazyInit(this.indexExpression, INDEX_PROPERTY); + } + } + } + return this.indexExpression; + } + + /** + * Sets the index expression of this array access expression. + * + * @param expression the index expression node + * @exception IllegalArgumentException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
  • a cycle in would be created
  • + *
+ */ + public void setIndex(Expression expression) { + if (expression == null) { + throw new IllegalArgumentException(); + } + // an ArrayAccess may occur inside an Expression + // must check cycles + ASTNode oldChild = this.indexExpression; + preReplaceChild(oldChild, expression, INDEX_PROPERTY); + this.indexExpression = expression; + postReplaceChild(oldChild, expression, INDEX_PROPERTY); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + int memSize() { + return BASE_NODE_SIZE + 2 * 4; + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + int treeSize() { + return + memSize() + + (this.arrayExpression == null ? 0 : getArray().treeSize()) + + (this.indexExpression == null ? 0 : getIndex().treeSize()); + } +} + diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ArrayCreation.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ArrayCreation.java new file mode 100644 index 0000000..ccac604 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ArrayCreation.java @@ -0,0 +1,315 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core.dom; + +import java.util.ArrayList; +import java.util.List; + +/** + * Array creation expression AST node type. + * For JLS2: + *

+ * The mapping from JavaScript language syntax to AST nodes is as follows: + *

    + *
  • the type node is the array type of the creation expression, + * with one level of array per set of square brackets,
  • + *
  • the dimension expressions are collected into the dimensions + * list.
  • + *
+ *

+ * For JLS3, type arguments are added: + *
+ * ArrayCreation:
+ *    new PrimitiveType [ Expression ] { [ Expression ] } { [ ] }
+ *    new TypeName [ < Type { , Type } > ]
+ *        [ Expression ] { [ Expression ] } { [ ] }
+ *    new PrimitiveType [ ] { [ ] } ArrayInitializer
+ *    new TypeName [ < Type { , Type } > ]
+ *        [ ] { [ ] } ArrayInitializer
+ * 
+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public class ArrayCreation extends Expression { + + /** + * The "type" structural property of this node type. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ */ + public static final ChildPropertyDescriptor TYPE_PROPERTY = + new ChildPropertyDescriptor(ArrayCreation.class, "type", ArrayType.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ + + /** + * The "dimensions" structural property of this node type. + */ + public static final ChildListPropertyDescriptor DIMENSIONS_PROPERTY = + new ChildListPropertyDescriptor(ArrayCreation.class, "dimensions", Expression.class, CYCLE_RISK); //$NON-NLS-1$ + + /** + * The "initializer" structural property of this node type. + */ + public static final ChildPropertyDescriptor INITIALIZER_PROPERTY = + new ChildPropertyDescriptor(ArrayCreation.class, "initializer", ArrayInitializer.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ + + /** + * A list of property descriptors (element type: + * {@link StructuralPropertyDescriptor}), + * or null if uninitialized. + */ + private static final List PROPERTY_DESCRIPTORS; + + static { + List properyList = new ArrayList(4); + createPropertyList(ArrayCreation.class, properyList); + addProperty(TYPE_PROPERTY, properyList); + addProperty(DIMENSIONS_PROPERTY, properyList); + addProperty(INITIALIZER_PROPERTY, properyList); + PROPERTY_DESCRIPTORS = reapPropertyList(properyList); + } + + /** + * Returns a list of structural property descriptors for this node type. + * Clients must not modify the result. + * + * @param apiLevel the API level; one of the + * AST.JLS* constants + + * @return a list of property descriptors (element type: + * {@link StructuralPropertyDescriptor}) + */ + public static List propertyDescriptors(int apiLevel) { + return PROPERTY_DESCRIPTORS; + } + + /** + * The array type; lazily initialized; defaults to a unspecified, + * legal array type. + */ + private ArrayType arrayType = null; + + /** + * The list of dimension expressions (element type: + * Expression). Defaults to an empty list. + */ + private ASTNode.NodeList dimensions = + new ASTNode.NodeList(DIMENSIONS_PROPERTY); + + /** + * The optional array initializer, or null if none; + * defaults to none. + */ + private ArrayInitializer optionalInitializer = null; + + /** + * Creates a new AST node for an array creation expression owned by the + * given AST. By default, the array type is an unspecified 1-dimensional + * array, the list of dimensions is empty, and there is no array + * initializer. + * + * @param ast the AST that is to own this node + */ + ArrayCreation(AST ast) { + super(ast); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final List internalStructuralPropertiesForType(int apiLevel) { + return propertyDescriptors(apiLevel); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { + if (property == INITIALIZER_PROPERTY) { + if (get) { + return getInitializer(); + } else { + setInitializer((ArrayInitializer) child); + return null; + } + } + if (property == TYPE_PROPERTY) { + if (get) { + return getType(); + } else { + setType((ArrayType) child); + return null; + } + } + // allow default implementation to flag the error + return super.internalGetSetChildProperty(property, get, child); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final List internalGetChildListProperty(ChildListPropertyDescriptor property) { + if (property == DIMENSIONS_PROPERTY) { + return dimensions(); + } + // allow default implementation to flag the error + return super.internalGetChildListProperty(property); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final int getNodeType0() { + return ARRAY_CREATION; + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + ASTNode clone0(AST target) { + ArrayCreation result = new ArrayCreation(target); + result.setSourceRange(this.getStartPosition(), this.getLength()); + result.setType((ArrayType) getType().clone(target)); + result.dimensions().addAll(ASTNode.copySubtrees(target, dimensions())); + result.setInitializer( + (ArrayInitializer) ASTNode.copySubtree(target, getInitializer())); + return result; + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final boolean subtreeMatch0(ASTMatcher matcher, Object other) { + // dispatch to correct overloaded match method + return matcher.match(this, other); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + void accept0(ASTVisitor visitor) { + boolean visitChildren = visitor.visit(this); + if (visitChildren) { + // visit children in normal left to right reading order + acceptChild(visitor, getType()); + acceptChildren(visitor, this.dimensions); + acceptChild(visitor, getInitializer()); + } + visitor.endVisit(this); + } + + /** + * Returns the array type in this array creation expression. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @return the array type + */ + public ArrayType getType() { + if (this.arrayType == null) { + // lazy init must be thread-safe for readers + synchronized (this) { + if (this.arrayType == null) { + preLazyInit(); + this.arrayType = this.ast.newArrayType( + this.ast.newInferredType(null)); + postLazyInit(this.arrayType, TYPE_PROPERTY); + } + } + } + return this.arrayType; + } + + /** + * Sets the array type in this array creation expression. + * + * @param type the new array type + * @exception IllegalArgumentException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
+ */ + public void setType(ArrayType type) { + if (type == null) { + throw new IllegalArgumentException(); + } + // an ArrayCreation cannot occur inside a ArrayType - cycles not possible + ASTNode oldChild = this.arrayType; + preReplaceChild(oldChild, type, TYPE_PROPERTY); + this.arrayType = type; + postReplaceChild(oldChild, type, TYPE_PROPERTY); + } + + /** + * Returns the live ordered list of dimension expressions in this array + * initializer. + * + * @return the live list of dimension expressions + * (element type: Expression) + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Returns the array initializer of this array creation expression, or + * null if there is none. + * + * @return the array initializer node, or null if + * there is none + */ + public ArrayInitializer getInitializer() { + return optionalInitializer; + } + + /** + * Sets or clears the array initializer of this array creation expression. + * + * @param initializer the array initializer node, or null + * if there is none + * @exception IllegalArgumentException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
  • a cycle in would be created
  • + *
+ */ + public void setInitializer(ArrayInitializer initializer) { + // an ArrayCreation may occur inside an ArrayInitializer + // must check cycles + ASTNode oldChild = this.optionalInitializer; + preReplaceChild(oldChild, initializer, INITIALIZER_PROPERTY); + this.optionalInitializer = initializer; + postReplaceChild(oldChild, initializer, INITIALIZER_PROPERTY); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + int memSize() { + return BASE_NODE_SIZE + 3 * 4; + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + int treeSize() { + int size = memSize() + + (this.arrayType == null ? 0 : getType().treeSize()) + + (this.optionalInitializer == null ? 0 : getInitializer().treeSize()) + + this.dimensions.listSize(); + return size; + } +} + diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ArrayInitializer.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ArrayInitializer.java new file mode 100644 index 0000000..c316b56 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ArrayInitializer.java @@ -0,0 +1,161 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.dom; + +import java.util.ArrayList; +import java.util.List; + +/** + * Array initializer AST node type. + * + *
+ * ArrayInitializer:
+ * 		 { Expression { , Expression} { , }} }
+ * 
+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public class ArrayInitializer extends Expression { + + /** + * The "expressions" structural property of this node type. + */ + public static final ChildListPropertyDescriptor EXPRESSIONS_PROPERTY = + new ChildListPropertyDescriptor(ArrayInitializer.class, "expressions", Expression.class, CYCLE_RISK); //$NON-NLS-1$ + + /** + * A list of property descriptors (element type: + * {@link StructuralPropertyDescriptor}), + * or null if uninitialized. + */ + private static final List PROPERTY_DESCRIPTORS; + + static { + List properyList = new ArrayList(2); + createPropertyList(ArrayInitializer.class, properyList); + addProperty(EXPRESSIONS_PROPERTY, properyList); + PROPERTY_DESCRIPTORS = reapPropertyList(properyList); + } + + /** + * Returns a list of structural property descriptors for this node type. + * Clients must not modify the result. + * + * @param apiLevel the API level; one of the + * AST.JLS* constants + + * @return a list of property descriptors (element type: + * {@link StructuralPropertyDescriptor}) + */ + public static List propertyDescriptors(int apiLevel) { + return PROPERTY_DESCRIPTORS; + } + + /** + * The list of expressions (element type: + * Expression). Defaults to an empty list. + */ + private ASTNode.NodeList expressions = + new ASTNode.NodeList(EXPRESSIONS_PROPERTY); + + /** + * Creates a new AST node for an array initializer owned by the + * given AST. By default, the list of expressions is empty. + * + * @param ast the AST that is to own this node + */ + ArrayInitializer(AST ast) { + super(ast); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final List internalStructuralPropertiesForType(int apiLevel) { + return propertyDescriptors(apiLevel); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final List internalGetChildListProperty(ChildListPropertyDescriptor property) { + if (property == EXPRESSIONS_PROPERTY) { + return expressions(); + } + // allow default implementation to flag the error + return super.internalGetChildListProperty(property); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final int getNodeType0() { + return ARRAY_INITIALIZER; + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + ASTNode clone0(AST target) { + ArrayInitializer result = new ArrayInitializer(target); + result.setSourceRange(this.getStartPosition(), this.getLength()); + result.expressions().addAll(ASTNode.copySubtrees(target, expressions())); + return result; + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final boolean subtreeMatch0(ASTMatcher matcher, Object other) { + // dispatch to correct overloaded match method + return matcher.match(this, other); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + void accept0(ASTVisitor visitor) { + boolean visitChildren = visitor.visit(this); + if (visitChildren) { + acceptChildren(visitor, this.expressions); + } + visitor.endVisit(this); + } + + /** + * Returns the live ordered list of expressions in this array initializer. + * + * @return the live list of expressions + * (element type: Expression) + */ + public List expressions() { + return this.expressions; + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + int memSize() { + return BASE_NODE_SIZE + 1 * 4; + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + int treeSize() { + return memSize() + this.expressions.listSize(); + } +} + diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ArrayType.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ArrayType.java new file mode 100644 index 0000000..8cc0221 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ArrayType.java @@ -0,0 +1,247 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.dom; + +import java.util.ArrayList; +import java.util.List; + +/** + * Type node for an array type. + *

+ * Array types are expressed in a recursive manner, one dimension at a time. + *

+ *
+ * ArrayType:
+ *    Type [ ]
+ * 
+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public class ArrayType extends Type { + + /** + * The "componentType" structural property of this node type. + *

Note: This Field only applies to ECMAScript 4 which is not yet supported

+ * + */ + public static final ChildPropertyDescriptor COMPONENT_TYPE_PROPERTY = + new ChildPropertyDescriptor(ArrayType.class, "componentType", Type.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ + + /** + * A list of property descriptors (element type: + * {@link StructuralPropertyDescriptor}), + * or null if uninitialized. + */ + private static final List PROPERTY_DESCRIPTORS; + + static { + List properyList = new ArrayList(2); + createPropertyList(ArrayType.class, properyList); + addProperty(COMPONENT_TYPE_PROPERTY, properyList); + PROPERTY_DESCRIPTORS = reapPropertyList(properyList); + } + + /** + * Returns a list of structural property descriptors for this node type. + * Clients must not modify the result. + * + * @param apiLevel the API level; one of the + * AST.JLS* constants + + * @return a list of property descriptors (element type: + * {@link StructuralPropertyDescriptor}) + */ + public static List propertyDescriptors(int apiLevel) { + return PROPERTY_DESCRIPTORS; + } + + /** + * The component type; lazily initialized; defaults to a simple type with + * an unspecfied, but legal, name. + */ + private Type componentType = null; + + /** + * Creates a new unparented node for an array type owned by the given AST. + * By default, a 1-dimensional array of an unspecified simple type. + *

+ * N.B. This constructor is package-private. + *

+ * + * @param ast the AST that is to own this node + */ + ArrayType(AST ast) { + super(ast); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final List internalStructuralPropertiesForType(int apiLevel) { + return propertyDescriptors(apiLevel); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { + if (property == COMPONENT_TYPE_PROPERTY) { + if (get) { + return getComponentType(); + } else { + setComponentType((Type) child); + return null; + } + } + // allow default implementation to flag the error + return super.internalGetSetChildProperty(property, get, child); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final int getNodeType0() { + return ARRAY_TYPE; + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + ASTNode clone0(AST target) { + ArrayType result = new ArrayType(target); + result.setSourceRange(this.getStartPosition(), this.getLength()); + result.setComponentType((Type) getComponentType().clone(target)); + return result; + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final boolean subtreeMatch0(ASTMatcher matcher, Object other) { + // dispatch to correct overloaded match method + return matcher.match(this, other); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + void accept0(ASTVisitor visitor) { + boolean visitChildren = visitor.visit(this); + if (visitChildren) { + acceptChild(visitor, getComponentType()); + } + visitor.endVisit(this); + } + + /** + * Returns the component type of this array type. The component type + * may be another array type. + * + * @return the component type node + */ + public Type getComponentType() { + if (this.componentType == null) { + // lazy init must be thread-safe for readers + synchronized (this) { + if (this.componentType == null) { + preLazyInit(); + this.componentType = new SimpleType(this.ast); + postLazyInit(this.componentType, COMPONENT_TYPE_PROPERTY); + } + } + } + return this.componentType; + } + + /** + * Sets the component type of this array type. The component type + * may be another array type. + * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @param componentType the component type + * @exception IllegalArgumentException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
  • a cycle in would be created
  • + *
+ */ + public void setComponentType(Type componentType) { + if (componentType == null) { + throw new IllegalArgumentException(); + } + ASTNode oldChild = this.componentType; + preReplaceChild(oldChild, componentType, COMPONENT_TYPE_PROPERTY); + this.componentType = componentType; + postReplaceChild(oldChild, componentType, COMPONENT_TYPE_PROPERTY); + } + + /** + * Returns the element type of this array type. The element type is + * never an array type. + *

+ * This is a convenience method that descends a chain of nested array types + * until it reaches a non-array type. + *

+ * + *

Note: This Method only applies to ECMAScript 4 which is not yet supported

+ * + * @return the component type node + */ + public Type getElementType() { + Type t = getComponentType(); + while (t.isArrayType()) { + t = ((ArrayType) t).getComponentType(); + } + return t; + } + + /** + * Returns the number of dimensions in this array type. + *

+ * This is a convenience method that descends a chain of nested array types + * until it reaches a non-array type. + *

+ * + * @return the number of dimensions (always positive) + */ + public int getDimensions() { + Type t = getComponentType(); + int dimensions = 1; // always include this array type + while (t.isArrayType()) { + dimensions++; + t = ((ArrayType) t).getComponentType(); + } + return dimensions; + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + int memSize() { + return BASE_NODE_SIZE + 1 * 4; + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + int treeSize() { + return + memSize() + + (this.componentType == null ? 0 : getComponentType().treeSize()); + } +} + diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/Assignment.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/Assignment.java new file mode 100644 index 0000000..0f11f13 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/Assignment.java @@ -0,0 +1,439 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.dom; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Assignment expression AST node type. + * + *
+ * Assignment:
+ *    Expression AssignmentOperator Expression
+ * 
+ * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +public class Assignment extends Expression { + + /** + * Assignment operators (typesafe enumeration). + *
+	 * AssignmentOperator:
+	 *    = ASSIGN
+	 *    += PLUS_ASSIGN
+	 *    -= MINUS_ASSIGN
+	 *    *= TIMES_ASSIGN
+	 *    /= DIVIDE_ASSIGN
+	 *    &= BIT_AND_ASSIGN
+	 *    |= BIT_OR_ASSIGN
+	 *    ^= BIT_XOR_ASSIGN
+	 *    %= REMAINDER_ASSIGN
+	 *    <<= LEFT_SHIFT_ASSIGN
+	 *    >>= RIGHT_SHIFT_SIGNED_ASSIGN
+	 *    >>>= RIGHT_SHIFT_UNSIGNED_ASSIGN
+	 * 
+ */ + public static class Operator { + + /** + * The name of the operator + */ + private String op; + + /** + * Creates a new assignment operator with the given name. + *

+ * Note: this constructor is private. The only instances + * ever created are the ones for the standard operators. + *

+ * + * @param op the character sequence for the operator + */ + private Operator(String op) { + this.op = op; + } + + /** + * Returns the character sequence for the operator. + * + * @return the character sequence for the operator + */ + public String toString() { + return op; + } + + /** = operator. */ + public static final Operator ASSIGN = new Operator("=");//$NON-NLS-1$ + /** += operator. */ + public static final Operator PLUS_ASSIGN = new Operator("+=");//$NON-NLS-1$ + /** -= operator. */ + public static final Operator MINUS_ASSIGN = new Operator("-=");//$NON-NLS-1$ + /** *= operator. */ + public static final Operator TIMES_ASSIGN = new Operator("*=");//$NON-NLS-1$ + /** /= operator. */ + public static final Operator DIVIDE_ASSIGN = new Operator("/=");//$NON-NLS-1$ + /** &= operator. */ + public static final Operator BIT_AND_ASSIGN = new Operator("&=");//$NON-NLS-1$ + /** |= operator. */ + public static final Operator BIT_OR_ASSIGN = new Operator("|=");//$NON-NLS-1$ + /** ^= operator. */ + public static final Operator BIT_XOR_ASSIGN = new Operator("^=");//$NON-NLS-1$ + /** %= operator. */ + public static final Operator REMAINDER_ASSIGN = new Operator("%=");//$NON-NLS-1$ + /** <<== operator. */ + public static final Operator LEFT_SHIFT_ASSIGN = + new Operator("<<=");//$NON-NLS-1$ + /** >>= operator. */ + public static final Operator RIGHT_SHIFT_SIGNED_ASSIGN = + new Operator(">>=");//$NON-NLS-1$ + /** >>>= operator. */ + public static final Operator RIGHT_SHIFT_UNSIGNED_ASSIGN = + new Operator(">>>=");//$NON-NLS-1$ + + /** + * Returns the assignment operator corresponding to the given string, + * or null if none. + *

+ * toOperator is the converse of toString: + * that is, Operator.toOperator(op.toString()) == op for all + * operators op. + *

+ * + * @param token the character sequence for the operator + * @return the assignment operator, or null if none + */ + public static Operator toOperator(String token) { + return (Operator) CODES.get(token); + } + + /** + * Map from token to operator (key type: String; + * value type: Operator). + */ + private static final Map CODES; + static { + CODES = new HashMap(20); + Operator[] ops = { + ASSIGN, + PLUS_ASSIGN, + MINUS_ASSIGN, + TIMES_ASSIGN, + DIVIDE_ASSIGN, + BIT_AND_ASSIGN, + BIT_OR_ASSIGN, + BIT_XOR_ASSIGN, + REMAINDER_ASSIGN, + LEFT_SHIFT_ASSIGN, + RIGHT_SHIFT_SIGNED_ASSIGN, + RIGHT_SHIFT_UNSIGNED_ASSIGN + }; + for (int i = 0; i < ops.length; i++) { + CODES.put(ops[i].toString(), ops[i]); + } + } + } + + /** + * The "leftHandSide" structural property of this node type. + */ + public static final ChildPropertyDescriptor LEFT_HAND_SIDE_PROPERTY = + new ChildPropertyDescriptor(Assignment.class, "leftHandSide", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ + + /** + * The "operator" structural property of this node type. + */ + public static final SimplePropertyDescriptor OPERATOR_PROPERTY = + new SimplePropertyDescriptor(Assignment.class, "operator", Assignment.Operator.class, MANDATORY); //$NON-NLS-1$ + + /** + * The "rightHandSide" structural property of this node type. + */ + public static final ChildPropertyDescriptor RIGHT_HAND_SIDE_PROPERTY = + new ChildPropertyDescriptor(Assignment.class, "rightHandSide", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ + + /** + * A list of property descriptors (element type: + * {@link StructuralPropertyDescriptor}), + * or null if uninitialized. + */ + private static final List PROPERTY_DESCRIPTORS; + + static { + List properyList = new ArrayList(4); + createPropertyList(Assignment.class, properyList); + addProperty(LEFT_HAND_SIDE_PROPERTY, properyList); + addProperty(OPERATOR_PROPERTY, properyList); + addProperty(RIGHT_HAND_SIDE_PROPERTY, properyList); + PROPERTY_DESCRIPTORS = reapPropertyList(properyList); + } + + /** + * Returns a list of structural property descriptors for this node type. + * Clients must not modify the result. + * + * @param apiLevel the API level; one of the + * AST.JLS* constants + + * @return a list of property descriptors (element type: + * {@link StructuralPropertyDescriptor}) + */ + public static List propertyDescriptors(int apiLevel) { + return PROPERTY_DESCRIPTORS; + } + + /** + * The assignment operator; defaults to Assignment.Operator.ASSIGN + */ + private Assignment.Operator assignmentOperator = Assignment.Operator.ASSIGN; + + /** + * The left hand side; lazily initialized; defaults to an unspecified, + * but legal, simple name. + */ + private Expression leftHandSide = null; + + /** + * The right hand side; lazily initialized; defaults to an unspecified, + * but legal, simple name. + */ + private Expression rightHandSide = null; + + /** + * Creates a new AST node for an assignment expression owned by the given + * AST. By default, the node has an assignment operator, and unspecified + * left and right hand sides. + * + * @param ast the AST that is to own this node + */ + Assignment(AST ast) { + super(ast); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final List internalStructuralPropertiesForType(int apiLevel) { + return propertyDescriptors(apiLevel); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final Object internalGetSetObjectProperty(SimplePropertyDescriptor property, boolean get, Object value) { + if (property == OPERATOR_PROPERTY) { + if (get) { + return getOperator(); + } else { + setOperator((Operator) value); + return null; + } + } + // allow default implementation to flag the error + return super.internalGetSetObjectProperty(property, get, value); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { + if (property == LEFT_HAND_SIDE_PROPERTY) { + if (get) { + return getLeftHandSide(); + } else { + setLeftHandSide((Expression) child); + return null; + } + } + if (property == RIGHT_HAND_SIDE_PROPERTY) { + if (get) { + return getRightHandSide(); + } else { + setRightHandSide((Expression) child); + return null; + } + } + // allow default implementation to flag the error + return super.internalGetSetChildProperty(property, get, child); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final int getNodeType0() { + return ASSIGNMENT; + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + ASTNode clone0(AST target) { + Assignment result = new Assignment(target); + result.setSourceRange(this.getStartPosition(), this.getLength()); + result.setOperator(getOperator()); + result.setLeftHandSide((Expression) getLeftHandSide().clone(target)); + result.setRightHandSide((Expression) getRightHandSide().clone(target)); + return result; + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + final boolean subtreeMatch0(ASTMatcher matcher, Object other) { + // dispatch to correct overloaded match method + return matcher.match(this, other); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + void accept0(ASTVisitor visitor) { + boolean visitChildren = visitor.visit(this); + if (visitChildren) { + // visit children in normal left to right reading order + acceptChild(visitor, getLeftHandSide()); + acceptChild(visitor, getRightHandSide()); + } + visitor.endVisit(this); + } + + /** + * Returns the operator of this assignment expression. + * + * @return the assignment operator + */ + public Assignment.Operator getOperator() { + return this.assignmentOperator; + } + + /** + * Sets the operator of this assignment expression. + * + * @param assignmentOperator the assignment operator + * @exception IllegalArgumentException if the argument is incorrect + */ + public void setOperator(Assignment.Operator assignmentOperator) { + if (assignmentOperator == null) { + throw new IllegalArgumentException(); + } + preValueChange(OPERATOR_PROPERTY); + this.assignmentOperator = assignmentOperator; + postValueChange(OPERATOR_PROPERTY); + } + + /** + * Returns the left hand side of this assignment expression. + * + * @return the left hand side node + */ + public Expression getLeftHandSide() { + if (this.leftHandSide == null) { + // lazy init must be thread-safe for readers + synchronized (this) { + if (this.leftHandSide == null) { + preLazyInit(); + this.leftHandSide= new SimpleName(this.ast); + postLazyInit(this.leftHandSide, LEFT_HAND_SIDE_PROPERTY); + } + } + } + return this.leftHandSide; + } + + /** + * Sets the left hand side of this assignment expression. + * + * @param expression the left hand side node + * @exception IllegalArgumentException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
  • a cycle in would be created
  • + *
+ */ + public void setLeftHandSide(Expression expression) { + if (expression == null) { + throw new IllegalArgumentException(); + } + // an Assignment may occur inside a Expression - must check cycles + ASTNode oldChild = this.leftHandSide; + preReplaceChild(oldChild, expression, LEFT_HAND_SIDE_PROPERTY); + this.leftHandSide = expression; + postReplaceChild(oldChild, expression, LEFT_HAND_SIDE_PROPERTY); + } + + /** + * Returns the right hand side of this assignment expression. + * + * @return the right hand side node + */ + public Expression getRightHandSide() { + if (this.rightHandSide == null) { + // lazy init must be thread-safe for readers + synchronized (this) { + if (this.rightHandSide == null) { + preLazyInit(); + this.rightHandSide= new SimpleName(this.ast); + postLazyInit(this.rightHandSide, RIGHT_HAND_SIDE_PROPERTY); + } + } + } + return this.rightHandSide; + } + + /** + * Sets the right hand side of this assignment expression. + * + * @param expression the right hand side node + * @exception IllegalArgumentException if: + *
    + *
  • the node belongs to a different AST
  • + *
  • the node already has a parent
  • + *
  • a cycle in would be created
  • + *
+ */ + public void setRightHandSide(Expression expression) { + if (expression == null) { + throw new IllegalArgumentException(); + } + // an Assignment may occur inside a Expression - must check cycles + ASTNode oldChild = this.rightHandSide; + preReplaceChild(oldChild, expression, RIGHT_HAND_SIDE_PROPERTY); + this.rightHandSide = expression; + postReplaceChild(oldChild, expression, RIGHT_HAND_SIDE_PROPERTY); + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + int memSize() { + // treat Code as free + return BASE_NODE_SIZE + 3 * 4; + } + + /* (omit jsdoc for this method) + * Method declared on ASTNode. + */ + int treeSize() { + return + memSize() + + (this.leftHandSide == null ? 0 : getLeftHandSide().treeSize()) + + (this.rightHandSide == null ? 0 : getRightHandSide().treeSize()); + } +} + diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/BindingComparator.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/BindingComparator.java new file mode 100644 index 0000000..ec3c53d --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/BindingComparator.java @@ -0,0 +1,228 @@ +/******************************************************************************* + * Copyright (c) 2004, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.wst.jsdt.core.dom; + +import java.util.HashSet; + +import org.eclipse.wst.jsdt.core.compiler.CharOperation; +import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants; +import org.eclipse.wst.jsdt.internal.compiler.lookup.Binding; +import org.eclipse.wst.jsdt.internal.compiler.lookup.ExtraCompilerModifiers; +import org.eclipse.wst.jsdt.internal.compiler.lookup.FieldBinding; +import org.eclipse.wst.jsdt.internal.compiler.lookup.ImportBinding; +import org.eclipse.wst.jsdt.internal.compiler.lookup.LocalVariableBinding; +import org.eclipse.wst.jsdt.internal.compiler.lookup.ReferenceBinding; +import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeConstants; +import org.eclipse.wst.jsdt.internal.compiler.lookup.VariableBinding; + +/** + * Internal helper class for comparing bindings. + * + */ +class BindingComparator { + + /** + * @param declaringElement + * @param declaringElement2 + * @return true if both parameters are equals, false otherwise + */ + static boolean isEqual(Binding declaringElement, Binding declaringElement2, HashSet visitedTypes) { + if (declaringElement instanceof org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding) { + if (!(declaringElement2 instanceof org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding)){ + return false; + } + return isEqual((org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding) declaringElement, + (org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding) declaringElement2, + visitedTypes); + } else if (declaringElement instanceof org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding) { + if (!(declaringElement2 instanceof org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding)) { + return false; + } + return isEqual((org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding) declaringElement, + (org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding) declaringElement2, + visitedTypes); + } else if (declaringElement instanceof VariableBinding) { + if (!(declaringElement2 instanceof VariableBinding)) { + return false; + } + return isEqual((VariableBinding) declaringElement, + (VariableBinding) declaringElement2); + } else if (declaringElement instanceof org.eclipse.wst.jsdt.internal.compiler.lookup.PackageBinding) { + if (!(declaringElement2 instanceof org.eclipse.wst.jsdt.internal.compiler.lookup.PackageBinding)) { + return false; + } + org.eclipse.wst.jsdt.internal.compiler.lookup.PackageBinding packageBinding = (org.eclipse.wst.jsdt.internal.compiler.lookup.PackageBinding) declaringElement; + org.eclipse.wst.jsdt.internal.compiler.lookup.PackageBinding packageBinding2 = (org.eclipse.wst.jsdt.internal.compiler.lookup.PackageBinding) declaringElement2; + return CharOperation.equals(packageBinding.compoundName, packageBinding2.compoundName); + } else if (declaringElement instanceof ImportBinding) { + if (!(declaringElement2 instanceof ImportBinding)) { + return false; + } + ImportBinding importBinding = (ImportBinding) declaringElement; + ImportBinding importBinding2 = (ImportBinding) declaringElement2; + return importBinding.onDemand == importBinding2.onDemand + && CharOperation.equals(importBinding.compoundName, importBinding2.compoundName); + } + return false; + } + + static boolean isEqual(org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding methodBinding, + org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding methodBinding2) { + return isEqual(methodBinding, methodBinding2, new HashSet()); + } + + static boolean isEqual(org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding methodBinding, + org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding methodBinding2, + HashSet visitedTypes) { + if (methodBinding == null) { + return methodBinding2 == null; + } + if (methodBinding2 == null) return false; + if ( CharOperation.equals(methodBinding.selector, methodBinding2.selector) + && isEqual(methodBinding.returnType, methodBinding2.returnType, visitedTypes) +// && isEqual(methodBinding.thrownExceptions, methodBinding2.thrownExceptions, visitedTypes) + && isEqual(methodBinding.declaringClass, methodBinding2.declaringClass, visitedTypes) +// && isEqual(methodBinding.typeVariables, methodBinding2.typeVariables, visitedTypes) + && isEqual(methodBinding.parameters, methodBinding2.parameters, visitedTypes)) + return true; + org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding constructorBinding =null; + org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding methBinding =null; + if (methodBinding.selector==TypeConstants.INIT) + { + constructorBinding=methodBinding; + methBinding=methodBinding2; + } + else if (methodBinding2.selector==TypeConstants.INIT) + { + constructorBinding=methodBinding2; + methBinding=methodBinding; + + } + return (constructorBinding!=null && + CharOperation.equals(methBinding.selector,constructorBinding.declaringClass.sourceName) + && isEqual(methBinding.parameters, constructorBinding.parameters, visitedTypes)); + + } + + static boolean isEqual(VariableBinding variableBinding, VariableBinding variableBinding2) { + return (variableBinding.modifiers & ExtraCompilerModifiers.AccJustFlag) == (variableBinding2.modifiers & ExtraCompilerModifiers.AccJustFlag) + && CharOperation.equals(variableBinding.name, variableBinding2.name) + && isEqual(variableBinding.type, variableBinding2.type) + && (variableBinding.id == variableBinding2.id); + } + + static boolean isEqual(LocalVariableBinding variableBinding, LocalVariableBinding variableBinding2) { + return (variableBinding.modifiers & ExtraCompilerModifiers.AccJustFlag) == (variableBinding2.modifiers & ExtraCompilerModifiers.AccJustFlag) + && CharOperation.equals(variableBinding.name, variableBinding2.name) + && isEqual(variableBinding.type, variableBinding2.type) + && (variableBinding.id == variableBinding2.id) + && (variableBinding.declaration == variableBinding2.declaration); + } + + static boolean isEqual(FieldBinding fieldBinding, FieldBinding fieldBinding2) { + HashSet visitedTypes = new HashSet(); + return (fieldBinding.modifiers & ExtraCompilerModifiers.AccJustFlag) == (fieldBinding2.modifiers & ExtraCompilerModifiers.AccJustFlag) + && CharOperation.equals(fieldBinding.name, fieldBinding2.name) + && isEqual(fieldBinding.type, fieldBinding2.type, visitedTypes) + && isEqual(fieldBinding.declaringClass, fieldBinding2.declaringClass, visitedTypes); + } + + /** + * @param bindings + * @param otherBindings + * @return true if both parameters are equals, false otherwise + */ + static boolean isEqual(org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding[] bindings, org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding[] otherBindings) { + return isEqual(bindings, otherBindings, new HashSet()); + } + /** + * @param bindings + * @param otherBindings + * @return true if both parameters are equals, false otherwise + */ + static boolean isEqual(org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding[] bindings, org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding[] otherBindings, HashSet visitedTypes) { + if (bindings == null) { + return otherBindings == null; + } + if (otherBindings == null) { + return false; + } + int length = bindings.length; + int otherLength = otherBindings.length; + if (length != otherLength) { + return false; + } + for (int i = 0; i < length; i++) { + if (!isEqual(bindings[i], otherBindings[i], visitedTypes)) { + return false; + } + } + return true; + } + static boolean isEqual(org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding typeBinding, org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding typeBinding2, HashSet visitedTypes) { + if (typeBinding == typeBinding2) + return true; + if (typeBinding == null || typeBinding2 == null) + return false; + + switch (typeBinding.kind()) { + case Binding.BASE_TYPE : + if (!typeBinding2.isBaseType()) { + return false; + } + return typeBinding.id == typeBinding2.id; + + case Binding.ARRAY_TYPE : + if (!typeBinding2.isArrayType()) { + return false; + } + return typeBinding.dimensions() == typeBinding2.dimensions() + && isEqual(typeBinding.leafComponentType(), typeBinding2.leafComponentType(), visitedTypes); + + default : + if (!(typeBinding2 instanceof ReferenceBinding)) { + return false; + } + ReferenceBinding referenceBinding = (ReferenceBinding) typeBinding; + ReferenceBinding referenceBinding2 = (ReferenceBinding) typeBinding2; + char[] constantPoolName = referenceBinding.constantPoolName(); + char[] constantPoolName2 = referenceBinding2.constantPoolName(); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=116833 + if (constantPoolName == null) { + if (constantPoolName2 != null) { + return false; + } + if (!CharOperation.equals(referenceBinding.computeUniqueKey(), referenceBinding2.computeUniqueKey())) { + return false; + } + } else { + if (constantPoolName2 == null) { + return false; + } + if (!CharOperation.equals(constantPoolName, constantPoolName2)) { + return false; + } + } + return CharOperation.equals(referenceBinding.compoundName, referenceBinding2.compoundName) + && ((referenceBinding.modifiers & ~ClassFileConstants.AccSuper) & (ExtraCompilerModifiers.AccJustFlag)) + == ((referenceBinding2.modifiers & ~ClassFileConstants.AccSuper) & (ExtraCompilerModifiers.AccJustFlag)) + && isEqual(referenceBinding.enclosingType(), referenceBinding2.enclosingType(), visitedTypes); + } + } + /** + * @param typeBinding + * @param typeBinding2 + * @return true if both parameters are equals, false otherwise + */ + static boolean isEqual(org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding typeBinding, org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding typeBinding2) { + return isEqual(typeBinding, typeBinding2, new HashSet()); + } +} diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/BindingResolver.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/BindingResolver.java new file mode 100644 index 0000000..c6ee9b1 --- /dev/null +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/BindingResolver.java @@ -0,0 +1,787 @@ +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.jsdt.core.dom; + +import org.eclipse.wst.jsdt.core.WorkingCopyOwner; +import org.eclipse.wst.jsdt.internal.compiler.lookup.BlockScope; +import org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope; +import org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment; + +/** + * A binding resolver is an internal mechanism for figuring out the binding + * for a major declaration, type, or name reference. + *

+ * The default implementation serves as the default binding resolver + * that does no resolving whatsoever. Internal subclasses do all the real work. + *

+ * + * @see AST#getBindingResolver + * + * Provisional API: This class/interface is part of an interim API that is still under development and expected to + * change significantly before reaching stability. It is being made available at this early stage to solicit feedback + * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken + * (repeatedly) as the API evolves. + */ +class BindingResolver { + + /** + * Creates a binding resolver. + */ + BindingResolver() { + // default implementation: do nothing + } + + /** + * Finds the corresponding AST node from which the given binding originated. + * Returns null if the binding does not correspond to any node + * in the javaScript unit. + *

+ * The following table indicates the expected node type for the various + * different kinds of bindings: + *

    + *
  • + *
  • var/field - a VariableDeclarationFragment in a + * FieldDeclaration
  • + *
  • local variable - a SingleVariableDeclaration, or + * a VariableDeclarationFragment in a + * VariableDeclarationStatement or + * VariableDeclarationExpression
  • + *
  • function/method - a FunctionDeclaration
  • + *
+ *